52 For a QContactRelationshipSaveRequest, the resultsAvailable() signal will be emitted when |
52 For a QContactRelationshipSaveRequest, the resultsAvailable() signal will be emitted when |
53 either the individual item errors (which may be retrieved by calling errorMap()), or the resultant |
53 either the individual item errors (which may be retrieved by calling errorMap()), or the resultant |
54 relationships (which may be retrieved by calling relationships()), are updated, as well as if |
54 relationships (which may be retrieved by calling relationships()), 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 relationship save request whose parent is the specified \a parent */ |
63 /*! Constructs a new relationship save request whose parent is the specified \a parent */ |
61 QContactRelationshipSaveRequest::QContactRelationshipSaveRequest(QObject* parent) |
64 QContactRelationshipSaveRequest::QContactRelationshipSaveRequest(QObject* parent) |
71 \endcode |
74 \endcode |
72 */ |
75 */ |
73 void QContactRelationshipSaveRequest::setRelationship(const QContactRelationship& contactRelationship) |
76 void QContactRelationshipSaveRequest::setRelationship(const QContactRelationship& contactRelationship) |
74 { |
77 { |
75 Q_D(QContactRelationshipSaveRequest); |
78 Q_D(QContactRelationshipSaveRequest); |
|
79 QMutexLocker ml(&d->m_mutex); |
76 d->m_relationships.clear(); |
80 d->m_relationships.clear(); |
77 d->m_relationships.append(contactRelationship); |
81 d->m_relationships.append(contactRelationship); |
78 } |
82 } |
79 |
83 |
80 /*! Sets the relationships to save to be \a contactRelationships */ |
84 /*! Sets the relationships to save to be \a contactRelationships */ |
81 void QContactRelationshipSaveRequest::setRelationships(const QList<QContactRelationship>& contactRelationships) |
85 void QContactRelationshipSaveRequest::setRelationships(const QList<QContactRelationship>& contactRelationships) |
82 { |
86 { |
83 Q_D(QContactRelationshipSaveRequest); |
87 Q_D(QContactRelationshipSaveRequest); |
|
88 QMutexLocker ml(&d->m_mutex); |
84 d->m_relationships = contactRelationships; |
89 d->m_relationships = contactRelationships; |
85 } |
90 } |
86 |
91 |
87 /*! Returns the list of relationships that will be saved if called prior to calling \c start(), |
92 /*! Returns the list of relationships that will be saved if called prior to calling \c start(), |
88 otherwise returns the list of relationships as they were saved in the contacts store */ |
93 otherwise returns the list of relationships as they were saved in the contacts store */ |
89 QList<QContactRelationship> QContactRelationshipSaveRequest::relationships() const |
94 QList<QContactRelationship> QContactRelationshipSaveRequest::relationships() const |
90 { |
95 { |
91 Q_D(const QContactRelationshipSaveRequest); |
96 Q_D(const QContactRelationshipSaveRequest); |
|
97 QMutexLocker ml(&d->m_mutex); |
92 return d->m_relationships; |
98 return d->m_relationships; |
93 } |
99 } |
94 |
100 |
95 /*! Returns the map of input relationship list indices to errors which occurred */ |
101 /*! Returns the map of input relationship list indices to errors which occurred */ |
96 QMap<int, QContactManager::Error> QContactRelationshipSaveRequest::errorMap() const |
102 QMap<int, QContactManager::Error> QContactRelationshipSaveRequest::errorMap() const |
97 { |
103 { |
98 Q_D(const QContactRelationshipSaveRequest); |
104 Q_D(const QContactRelationshipSaveRequest); |
|
105 QMutexLocker ml(&d->m_mutex); |
99 return d->m_errors; |
106 return d->m_errors; |
100 } |
107 } |
101 |
108 |
102 #include "moc_qcontactrelationshipsaverequest.cpp" |
109 #include "moc_qcontactrelationshipsaverequest.cpp" |
103 |
110 |