qtmobility/src/contacts/requests/qcontactrelationshipfetchrequest.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
child 15 1f895d8a5b2b
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    54 
    54 
    55   For a QContactRelationshipFetchRequest, the resultsAvailable() signal will be emitted when the resultant
    55   For a QContactRelationshipFetchRequest, the resultsAvailable() signal will be emitted when the resultant
    56   relationships (which may be retrieved by calling relationships()), are updated, as well as if
    56   relationships (which may be retrieved by calling relationships()), are updated, as well as if
    57   the overall operation error (which may be retrieved by calling error()) is updated.
    57   the overall operation error (which may be retrieved by calling error()) is updated.
    58 
    58 
       
    59   Please see the class documentation of QContactAbstractRequest for more information about
       
    60   the usage of request classes and ownership semantics.
       
    61 
    59   \ingroup contacts-requests
    62   \ingroup contacts-requests
    60  */
    63  */
    61 
    64 
    62 /*! Constructs a new relationship fetch request whose parent is the specified \a parent
    65 /*! Constructs a new relationship fetch request whose parent is the specified \a parent
    63  */
    66  */
    71     the request will fetch relationships involving any first contact.
    74     the request will fetch relationships involving any first contact.
    72 */
    75 */
    73 void QContactRelationshipFetchRequest::setFirst(const QContactId& firstId)
    76 void QContactRelationshipFetchRequest::setFirst(const QContactId& firstId)
    74 {
    77 {
    75     Q_D(QContactRelationshipFetchRequest);
    78     Q_D(QContactRelationshipFetchRequest);
       
    79     QMutexLocker ml(&d->m_mutex);
    76     d->m_first = firstId;
    80     d->m_first = firstId;
    77 }
    81 }
    78 
    82 
    79 /*! Returns the source contact criterion of the fetch request
    83 /*! Returns the source contact criterion of the fetch request
    80  */
    84  */
    81 QContactId QContactRelationshipFetchRequest::first() const
    85 QContactId QContactRelationshipFetchRequest::first() const
    82 {
    86 {
    83     Q_D(const QContactRelationshipFetchRequest);
    87     Q_D(const QContactRelationshipFetchRequest);
       
    88     QMutexLocker ml(&d->m_mutex);
    84     return d->m_first;
    89     return d->m_first;
    85 }
    90 }
    86 
    91 
    87 /*! Sets the relationship type criterion of the fetch request to \a relationshipType.
    92 /*! Sets the relationship type criterion of the fetch request to \a relationshipType.
    88     If \a relationshipType is empty, or the relationship type is not set,
    93     If \a relationshipType is empty, or the relationship type is not set,
    89     the request will fetch relationships of any type.
    94     the request will fetch relationships of any type.
    90 */
    95 */
    91 void QContactRelationshipFetchRequest::setRelationshipType(const QString& relationshipType)
    96 void QContactRelationshipFetchRequest::setRelationshipType(const QString& relationshipType)
    92 {
    97 {
    93     Q_D(QContactRelationshipFetchRequest);
    98     Q_D(QContactRelationshipFetchRequest);
       
    99     QMutexLocker ml(&d->m_mutex);
    94     d->m_relationshipType = relationshipType;
   100     d->m_relationshipType = relationshipType;
    95 }
   101 }
    96 
   102 
    97 /*! Returns the relationship type criterion of the fetch request
   103 /*! Returns the relationship type criterion of the fetch request
    98  */
   104  */
    99 QString QContactRelationshipFetchRequest::relationshipType() const
   105 QString QContactRelationshipFetchRequest::relationshipType() const
   100 {
   106 {
   101     Q_D(const QContactRelationshipFetchRequest);
   107     Q_D(const QContactRelationshipFetchRequest);
       
   108     QMutexLocker ml(&d->m_mutex);
   102     return d->m_relationshipType;
   109     return d->m_relationshipType;
   103 }
   110 }
   104 
   111 
   105 /*! Sets the destination contact criterion of the fetch request to \a secondId.
   112 /*! Sets the destination contact criterion of the fetch request to \a secondId.
   106     If \a secondId is the default-constructed id, or the second contact id is not set,
   113     If \a secondId is the default-constructed id, or the second contact id is not set,
   107     the request will fetch relationships involving any second contact.
   114     the request will fetch relationships involving any second contact.
   108 */
   115 */
   109 void QContactRelationshipFetchRequest::setSecond(const QContactId& secondId)
   116 void QContactRelationshipFetchRequest::setSecond(const QContactId& secondId)
   110 {
   117 {
   111     Q_D(QContactRelationshipFetchRequest);
   118     Q_D(QContactRelationshipFetchRequest);
       
   119     QMutexLocker ml(&d->m_mutex);
   112     d->m_second = secondId;
   120     d->m_second = secondId;
   113 }
   121 }
   114 
   122 
   115 /*! Returns the destination contact criterion of the fetch request
   123 /*! Returns the destination contact criterion of the fetch request
   116  */
   124  */
   117 QContactId QContactRelationshipFetchRequest::second() const
   125 QContactId QContactRelationshipFetchRequest::second() const
   118 {
   126 {
   119     Q_D(const QContactRelationshipFetchRequest);
   127     Q_D(const QContactRelationshipFetchRequest);
       
   128     QMutexLocker ml(&d->m_mutex);
   120     return d->m_second;
   129     return d->m_second;
   121 }
   130 }
   122 
   131 
   123 /*! Returns the list of relationships that was the result of the request
   132 /*! Returns the list of relationships that was the result of the request
   124  */
   133  */
   125 QList<QContactRelationship> QContactRelationshipFetchRequest::relationships() const
   134 QList<QContactRelationship> QContactRelationshipFetchRequest::relationships() const
   126 {
   135 {
   127     Q_D(const QContactRelationshipFetchRequest);
   136     Q_D(const QContactRelationshipFetchRequest);
       
   137     QMutexLocker ml(&d->m_mutex);
   128     return d->m_relationships;
   138     return d->m_relationships;
   129 }
   139 }
   130 
   140 
   131 #include "moc_qcontactrelationshipfetchrequest.cpp"
   141 #include "moc_qcontactrelationshipfetchrequest.cpp"
   132 
   142