qtmobility/src/contacts/requests/qcontactfetchrequest.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
child 15 1f895d8a5b2b
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    52 
    52 
    53   For a QContactFetchRequest, the resultsAvailable() signal will be emitted when the resultant
    53   For a QContactFetchRequest, the resultsAvailable() signal will be emitted when the resultant
    54   contacts (which may be retrieved by calling contacts()), are updated, as well as if
    54   contacts (which may be retrieved by calling contacts()), are updated, as well as if
    55   the overall operation error (which may be retrieved by calling error()) is updated.
    55   the overall operation error (which may be retrieved by calling error()) is updated.
    56 
    56 
       
    57   Please see the class documentation of QContactAbstractRequest for more information about
       
    58   the usage of request classes and ownership semantics.
       
    59 
    57   \ingroup contacts-requests
    60   \ingroup contacts-requests
    58  */
    61  */
    59 
    62 
    60 /*! Constructs a new contact fetch request whose parent is the specified \a parent */
    63 /*! Constructs a new contact fetch request whose parent is the specified \a parent */
    61 QContactFetchRequest::QContactFetchRequest(QObject* parent)
    64 QContactFetchRequest::QContactFetchRequest(QObject* parent)
    65 
    68 
    66 /*! Sets the contact filter used to determine which contacts will be retrieved to \a filter */
    69 /*! Sets the contact filter used to determine which contacts will be retrieved to \a filter */
    67 void QContactFetchRequest::setFilter(const QContactFilter& filter)
    70 void QContactFetchRequest::setFilter(const QContactFilter& filter)
    68 {
    71 {
    69     Q_D(QContactFetchRequest);
    72     Q_D(QContactFetchRequest);
       
    73     QMutexLocker ml(&d->m_mutex);
    70     d->m_filter = filter;
    74     d->m_filter = filter;
    71 }
    75 }
    72 
    76 
    73 /*! Sets the sort order of the result to \a sorting.  Only has an effect if called prior to calling \c start() */
    77 /*! Sets the sort order of the result to \a sorting.  Only has an effect if called prior to calling \c start() */
    74 void QContactFetchRequest::setSorting(const QList<QContactSortOrder>& sorting)
    78 void QContactFetchRequest::setSorting(const QList<QContactSortOrder>& sorting)
    75 {
    79 {
    76     Q_D(QContactFetchRequest);
    80     Q_D(QContactFetchRequest);
       
    81     QMutexLocker ml(&d->m_mutex);
    77     d->m_sorting = sorting;
    82     d->m_sorting = sorting;
    78 }
    83 }
    79 
    84 
    80 /*!
    85 /*!
    81   Sets the fetch hint which may be used by the backend to optimize contact retrieval
    86   Sets the fetch hint which may be used by the backend to optimize contact retrieval
    86   \sa QContactFetchHint
    91   \sa QContactFetchHint
    87  */
    92  */
    88 void QContactFetchRequest::setFetchHint(const QContactFetchHint &fetchHint)
    93 void QContactFetchRequest::setFetchHint(const QContactFetchHint &fetchHint)
    89 {
    94 {
    90     Q_D(QContactFetchRequest);
    95     Q_D(QContactFetchRequest);
       
    96     QMutexLocker ml(&d->m_mutex);
    91     d->m_fetchHint = fetchHint;
    97     d->m_fetchHint = fetchHint;
    92 }
    98 }
    93 
    99 
    94 /*! Returns the filter that will be used to select contacts to be returned */
   100 /*! Returns the filter that will be used to select contacts to be returned */
    95 QContactFilter QContactFetchRequest::filter() const
   101 QContactFilter QContactFetchRequest::filter() const
    96 {
   102 {
    97     Q_D(const QContactFetchRequest);
   103     Q_D(const QContactFetchRequest);
       
   104     QMutexLocker ml(&d->m_mutex);
    98     return d->m_filter;
   105     return d->m_filter;
    99 }
   106 }
   100 
   107 
   101 /*! Returns the sort ordering that will be used sort the results of this request */
   108 /*! Returns the sort ordering that will be used sort the results of this request */
   102 QList<QContactSortOrder> QContactFetchRequest::sorting() const
   109 QList<QContactSortOrder> QContactFetchRequest::sorting() const
   103 {
   110 {
   104     Q_D(const QContactFetchRequest);
   111     Q_D(const QContactFetchRequest);
       
   112     QMutexLocker ml(&d->m_mutex);
   105     return d->m_sorting;
   113     return d->m_sorting;
   106 }
   114 }
   107 
   115 
   108 /*!
   116 /*!
   109   Returns the fetch hint which may be used by the backend to optimize contact retrieval.
   117   Returns the fetch hint which may be used by the backend to optimize contact retrieval.
   114   \sa QContactFetchHint
   122   \sa QContactFetchHint
   115  */
   123  */
   116 QContactFetchHint QContactFetchRequest::fetchHint() const
   124 QContactFetchHint QContactFetchRequest::fetchHint() const
   117 {
   125 {
   118     Q_D(const QContactFetchRequest);
   126     Q_D(const QContactFetchRequest);
       
   127     QMutexLocker ml(&d->m_mutex);
   119     return d->m_fetchHint;
   128     return d->m_fetchHint;
   120 }
   129 }
   121 
   130 
   122 /*! Returns the list of contacts retrieved by this request */
   131 /*! Returns the list of contacts retrieved by this request */
   123 QList<QContact> QContactFetchRequest::contacts() const
   132 QList<QContact> QContactFetchRequest::contacts() const
   124 {
   133 {
   125     Q_D(const QContactFetchRequest);
   134     Q_D(const QContactFetchRequest);
       
   135     QMutexLocker ml(&d->m_mutex);
   126     return d->m_contacts;
   136     return d->m_contacts;
   127 }
   137 }
   128 
   138 
   129 #include "moc_qcontactfetchrequest.cpp"
   139 #include "moc_qcontactfetchrequest.cpp"
   130 
   140