52 |
52 |
53 For a QContactDetailDefinitionSaveRequest, the resultsAvailable() signal will be emitted when |
53 For a QContactDetailDefinitionSaveRequest, the resultsAvailable() signal will be emitted when |
54 either the individual item errors (which may be retrieved by calling errorMap()), or the resultant |
54 either the individual item errors (which may be retrieved by calling errorMap()), or the resultant |
55 detail definitions (which may be retrieved by calling definitions()), are updated, as well as if |
55 detail definitions (which may be retrieved by calling definitions()), are updated, as well as if |
56 the overall operation error (which may be retrieved by calling error()) is updated. |
56 the overall operation error (which may be retrieved by calling error()) is updated. |
|
57 |
|
58 Please see the class documentation of QContactAbstractRequest for more information about |
|
59 the usage of request classes and ownership semantics. |
57 |
60 |
58 \ingroup contacts-requests |
61 \ingroup contacts-requests |
59 */ |
62 */ |
60 |
63 |
61 /*! Constructs a new detail definition save request whose parent is the specified \a parent */ |
64 /*! Constructs a new detail definition save request whose parent is the specified \a parent */ |
72 \endcode |
75 \endcode |
73 */ |
76 */ |
74 void QContactDetailDefinitionSaveRequest::setDefinition(const QContactDetailDefinition& definition) |
77 void QContactDetailDefinitionSaveRequest::setDefinition(const QContactDetailDefinition& definition) |
75 { |
78 { |
76 Q_D(QContactDetailDefinitionSaveRequest); |
79 Q_D(QContactDetailDefinitionSaveRequest); |
|
80 QMutexLocker ml(&d->m_mutex); |
77 d->m_definitions.clear(); |
81 d->m_definitions.clear(); |
78 d->m_definitions.append(definition); |
82 d->m_definitions.append(definition); |
79 } |
83 } |
80 |
84 |
81 /*! Sets the definitions to save to be \a definitions */ |
85 /*! Sets the definitions to save to be \a definitions */ |
82 void QContactDetailDefinitionSaveRequest::setDefinitions(const QList<QContactDetailDefinition>& definitions) |
86 void QContactDetailDefinitionSaveRequest::setDefinitions(const QList<QContactDetailDefinition>& definitions) |
83 { |
87 { |
84 Q_D(QContactDetailDefinitionSaveRequest); |
88 Q_D(QContactDetailDefinitionSaveRequest); |
|
89 QMutexLocker ml(&d->m_mutex); |
85 d->m_definitions = definitions; |
90 d->m_definitions = definitions; |
86 } |
91 } |
87 |
92 |
88 /*! Returns the list of definitions that will be saved if called prior to calling \c start(), |
93 /*! Returns the list of definitions that will be saved if called prior to calling \c start(), |
89 otherwise returns the list of detail definitions as they were saved in the contacts store */ |
94 otherwise returns the list of detail definitions as they were saved in the contacts store */ |
90 QList<QContactDetailDefinition> QContactDetailDefinitionSaveRequest::definitions() const |
95 QList<QContactDetailDefinition> QContactDetailDefinitionSaveRequest::definitions() const |
91 { |
96 { |
92 Q_D(const QContactDetailDefinitionSaveRequest); |
97 Q_D(const QContactDetailDefinitionSaveRequest); |
|
98 QMutexLocker ml(&d->m_mutex); |
93 return d->m_definitions; |
99 return d->m_definitions; |
94 } |
100 } |
95 |
101 |
96 /*! Sets the type of contact for which detail definitions should be saved to \a contactType */ |
102 /*! Sets the type of contact for which detail definitions should be saved to \a contactType */ |
97 void QContactDetailDefinitionSaveRequest::setContactType(const QString& contactType) |
103 void QContactDetailDefinitionSaveRequest::setContactType(const QString& contactType) |
98 { |
104 { |
99 Q_D(QContactDetailDefinitionSaveRequest); |
105 Q_D(QContactDetailDefinitionSaveRequest); |
|
106 QMutexLocker ml(&d->m_mutex); |
100 d->m_contactType = contactType; |
107 d->m_contactType = contactType; |
101 } |
108 } |
102 |
109 |
103 /*! Returns the type of contact for which detail definitions will be saved */ |
110 /*! Returns the type of contact for which detail definitions will be saved */ |
104 QString QContactDetailDefinitionSaveRequest::contactType() const |
111 QString QContactDetailDefinitionSaveRequest::contactType() const |
105 { |
112 { |
106 Q_D(const QContactDetailDefinitionSaveRequest); |
113 Q_D(const QContactDetailDefinitionSaveRequest); |
|
114 QMutexLocker ml(&d->m_mutex); |
107 return d->m_contactType; |
115 return d->m_contactType; |
108 } |
116 } |
109 |
117 |
110 /*! Returns the map of input definition list indices to errors which occurred */ |
118 /*! Returns the map of input definition list indices to errors which occurred */ |
111 QMap<int, QContactManager::Error> QContactDetailDefinitionSaveRequest::errorMap() const |
119 QMap<int, QContactManager::Error> QContactDetailDefinitionSaveRequest::errorMap() const |
112 { |
120 { |
113 Q_D(const QContactDetailDefinitionSaveRequest); |
121 Q_D(const QContactDetailDefinitionSaveRequest); |
|
122 QMutexLocker ml(&d->m_mutex); |
114 return d->m_errors; |
123 return d->m_errors; |
115 } |
124 } |
116 |
125 |
117 #include "moc_qcontactdetaildefinitionsaverequest.cpp" |
126 #include "moc_qcontactdetaildefinitionsaverequest.cpp" |
118 |
127 |