qtmobility/plugins/contacts/symbian/src/transform/cnttransformname.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
   129     QList<TUid> uids;
   129     QList<TUid> uids;
   130 
   130 
   131     if (detailFieldName == QContactName::FieldPrefix)
   131     if (detailFieldName == QContactName::FieldPrefix)
   132         return uids << KUidContactFieldPrefixName;
   132         return uids << KUidContactFieldPrefixName;
   133 
   133 
   134     if (detailFieldName == QContactName::FieldFirst)
   134     if (detailFieldName == QContactName::FieldFirstName)
   135         return uids << KUidContactFieldGivenName;
   135         return uids << KUidContactFieldGivenName;
   136 
   136 
   137     if (detailFieldName == QContactName::FieldMiddle)
   137     if (detailFieldName == QContactName::FieldMiddleName)
   138         return uids << KUidContactFieldAdditionalName;
   138         return uids << KUidContactFieldAdditionalName;
   139 
   139 
   140     if (detailFieldName == QContactName::FieldLast)
   140     if (detailFieldName == QContactName::FieldLastName)
   141         return uids << KUidContactFieldFamilyName;
   141         return uids << KUidContactFieldFamilyName;
   142 
   142 
   143     if (detailFieldName == QContactName::FieldSuffix)
   143     if (detailFieldName == QContactName::FieldSuffix)
   144         return uids << KUidContactFieldSuffixName;
   144         return uids << KUidContactFieldSuffixName;
   145 
   145 
   169  */
   169  */
   170 quint32 CntTransformName::getIdForField(const QString& fieldName) const
   170 quint32 CntTransformName::getIdForField(const QString& fieldName) const
   171 {
   171 {
   172     if (QContactName::FieldPrefix == fieldName)
   172     if (QContactName::FieldPrefix == fieldName)
   173         return KUidContactFieldPrefixName.iUid;
   173         return KUidContactFieldPrefixName.iUid;
   174     else if (QContactName::FieldFirst == fieldName)
   174     else if (QContactName::FieldFirstName == fieldName)
   175         return KUidContactFieldGivenName.iUid;
   175         return KUidContactFieldGivenName.iUid;
   176     else if (QContactName::FieldMiddle == fieldName)
   176     else if (QContactName::FieldMiddleName == fieldName)
   177         return KUidContactFieldAdditionalName.iUid;
   177         return KUidContactFieldAdditionalName.iUid;
   178     else if (QContactName::FieldLast == fieldName)
   178     else if (QContactName::FieldLastName == fieldName)
   179         return KUidContactFieldFamilyName.iUid;
   179         return KUidContactFieldFamilyName.iUid;
   180     else if (QContactName::FieldSuffix == fieldName)
   180     else if (QContactName::FieldSuffix == fieldName)
   181         return KUidContactFieldSuffixName.iUid;
   181         return KUidContactFieldSuffixName.iUid;
   182     else if (QContactName::FieldCustomLabel == fieldName)
   182     else if (QContactName::FieldCustomLabel == fieldName)
   183         return KUidContactFieldTemplateLabel.iUid;
   183         return KUidContactFieldTemplateLabel.iUid;
   200         QMap<QString, QContactDetailFieldDefinition> fields = d.fields();
   200         QMap<QString, QContactDetailFieldDefinition> fields = d.fields();
   201 
   201 
   202         // groups support only custom label
   202         // groups support only custom label
   203         if(contactType == QContactType::TypeGroup) {
   203         if(contactType == QContactType::TypeGroup) {
   204             fields.remove(QContactName::FieldPrefix);
   204             fields.remove(QContactName::FieldPrefix);
   205             fields.remove(QContactName::FieldFirst);
   205             fields.remove(QContactName::FieldFirstName);
   206             fields.remove(QContactName::FieldMiddle);
   206             fields.remove(QContactName::FieldMiddleName);
   207             fields.remove(QContactName::FieldLast);
   207             fields.remove(QContactName::FieldLastName);
   208             fields.remove(QContactName::FieldSuffix);
   208             fields.remove(QContactName::FieldSuffix);
   209         } else {
   209         } else {
   210             // Note: Custom labels cannot be enabled for a contact in pre-10.1
   210             // Note: Custom labels cannot be enabled for a contact in pre-10.1
   211             // platforms because setting custom label for a contact causes
   211             // platforms because setting custom label for a contact causes
   212             // issues for S60 Phonebook editor. If custom label support is
   212             // issues for S60 Phonebook editor. If custom label support is
   213             // needed in 10.1 or later, it needs to be variated away from
   213             // needed in 10.1 or later, it needs to be variated away from
   214             // pre-10.1 platforms.
   214             // pre-10.1 platforms.
       
   215 #ifndef SYMBIAN_BACKEND_USE_SQLITE        
   215             fields.remove(QContactName::FieldCustomLabel);
   216             fields.remove(QContactName::FieldCustomLabel);
       
   217 #endif            
   216         }
   218         }
   217 
   219 
   218         // Context not supported in symbian back-end, remove
   220         // Context not supported in symbian back-end, remove
   219         fields.remove(QContactName::FieldContext);
   221         fields.remove(QContactName::FieldContext);
   220 
   222