qtmobility/src/contacts/requests/qcontactdetaildefinitionfetchrequest.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
child 15 1f895d8a5b2b
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    52   For a QContactDetailDefinitionFetchRequest, the resultsAvailable() signal will be emitted when
    52   For a QContactDetailDefinitionFetchRequest, 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   detail definitions (which may be retrieved by calling definitions()), are updated, as well as if
    54   detail definitions (which may be retrieved by calling definitions()), 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 detail definition fetch request whose parent is the specified \a parent */
    63 /*! Constructs a new detail definition fetch request whose parent is the specified \a parent */
    61 QContactDetailDefinitionFetchRequest::QContactDetailDefinitionFetchRequest(QObject* parent)
    64 QContactDetailDefinitionFetchRequest::QContactDetailDefinitionFetchRequest(QObject* parent)
    70     \endcode
    73     \endcode
    71  */
    74  */
    72 void QContactDetailDefinitionFetchRequest::setDefinitionName(const QString& definitionName)
    75 void QContactDetailDefinitionFetchRequest::setDefinitionName(const QString& definitionName)
    73 {
    76 {
    74     Q_D(QContactDetailDefinitionFetchRequest);
    77     Q_D(QContactDetailDefinitionFetchRequest);
       
    78     QMutexLocker ml(&d->m_mutex);
    75     d->m_names.clear();
    79     d->m_names.clear();
    76     d->m_names.append(definitionName);
    80     d->m_names.append(definitionName);
    77 }
    81 }
    78 
    82 
    79 /*! Sets the names of the detail definitions to retrieve to \a names */
    83 /*! Sets the names of the detail definitions to retrieve to \a names */
    80 void QContactDetailDefinitionFetchRequest::setDefinitionNames(const QStringList& names)
    84 void QContactDetailDefinitionFetchRequest::setDefinitionNames(const QStringList& names)
    81 {
    85 {
    82     Q_D(QContactDetailDefinitionFetchRequest);
    86     Q_D(QContactDetailDefinitionFetchRequest);
       
    87     QMutexLocker ml(&d->m_mutex);
    83     d->m_names = names;
    88     d->m_names = names;
    84 }
    89 }
    85 
    90 
    86 /*! Returns the list of names of the detail definitions that will be retrieved */
    91 /*! Returns the list of names of the detail definitions that will be retrieved */
    87 QStringList QContactDetailDefinitionFetchRequest::definitionNames() const
    92 QStringList QContactDetailDefinitionFetchRequest::definitionNames() const
    88 {
    93 {
    89     Q_D(const QContactDetailDefinitionFetchRequest);
    94     Q_D(const QContactDetailDefinitionFetchRequest);
       
    95     QMutexLocker ml(&d->m_mutex);
    90     return d->m_names;
    96     return d->m_names;
    91 }
    97 }
    92 
    98 
    93 /*! Sets the type of contact for which detail definitions should be retrieved to \a contactType */
    99 /*! Sets the type of contact for which detail definitions should be retrieved to \a contactType */
    94 void QContactDetailDefinitionFetchRequest::setContactType(const QString& contactType)
   100 void QContactDetailDefinitionFetchRequest::setContactType(const QString& contactType)
    95 {
   101 {
    96     Q_D(QContactDetailDefinitionFetchRequest);
   102     Q_D(QContactDetailDefinitionFetchRequest);
       
   103     QMutexLocker ml(&d->m_mutex);
    97     d->m_contactType = contactType;
   104     d->m_contactType = contactType;
    98 }
   105 }
    99 
   106 
   100 /*! Returns the type of contact for which detail definitions will be retrieved */
   107 /*! Returns the type of contact for which detail definitions will be retrieved */
   101 QString QContactDetailDefinitionFetchRequest::contactType() const
   108 QString QContactDetailDefinitionFetchRequest::contactType() const
   102 {
   109 {
   103     Q_D(const QContactDetailDefinitionFetchRequest);
   110     Q_D(const QContactDetailDefinitionFetchRequest);
       
   111     QMutexLocker ml(&d->m_mutex);
   104     return d->m_contactType;
   112     return d->m_contactType;
   105 }
   113 }
   106 
   114 
   107 /*!
   115 /*!
   108   Returns the map of detail definition names to detail definitions that was the result of the request
   116   Returns the map of detail definition names to detail definitions that was the result of the request
   109  */
   117  */
   110 QMap<QString, QContactDetailDefinition> QContactDetailDefinitionFetchRequest::definitions() const
   118 QMap<QString, QContactDetailDefinition> QContactDetailDefinitionFetchRequest::definitions() const
   111 {
   119 {
   112     Q_D(const QContactDetailDefinitionFetchRequest);
   120     Q_D(const QContactDetailDefinitionFetchRequest);
       
   121     QMutexLocker ml(&d->m_mutex);
   113     return d->m_definitions;
   122     return d->m_definitions;
   114 }
   123 }
   115 
   124 
   116 /*! Returns the map of input name list indices to errors which occurred */
   125 /*! Returns the map of input name list indices to errors which occurred */
   117 QMap<int, QContactManager::Error> QContactDetailDefinitionFetchRequest::errorMap() const
   126 QMap<int, QContactManager::Error> QContactDetailDefinitionFetchRequest::errorMap() const
   118 {
   127 {
   119     Q_D(const QContactDetailDefinitionFetchRequest);
   128     Q_D(const QContactDetailDefinitionFetchRequest);
       
   129     QMutexLocker ml(&d->m_mutex);
   120     return d->m_errors;
   130     return d->m_errors;
   121 }
   131 }
   122 
   132 
   123 #include "moc_qcontactdetaildefinitionfetchrequest.cpp"
   133 #include "moc_qcontactdetaildefinitionfetchrequest.cpp"
   124 
   134