Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-1816

API dox of QContactManager::saveContact(...) does not specify clearly which contact ids are allowed and what error code to use there

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 1.2.x
    • Contacts
    • None

    Description

      API dox of QContactManager::saveContact(..)[1] is unclear if the manager uri can be also empty for existing localIds or not: "Adds the given contact to the database if contact has a default-constructed id, or an id with the manager URI set to the URI of this manager and a local id of zero.
      If the manager URI of the id of the contact is neither empty nor equal to the URI of this manager, or local id of the contact is non-zero but does not exist in the manager, the operation will fail and calling error() will return QContactManager::DoesNotExistError".
      [1] http://doc.qt.nokia.com/qtmobility-1.2/qcontactmanager.html#saveContact

      The implementation seem to indicate an empty manager uri is not allowed:
      a) The test tst_QContactManager::partialSave() expects DoesNotExistError to be returned on an empty manager uri with an existing localId, see https://qt.gitorious.org/qt-mobility/contacts/blobs/5684483/plugins/contacts/symbian/plugin/src/cntsymbianengine.cpp#line378
      b) The Symbian backend also only allows contact->id().managerUri() == m_managerUri for an existing localId, see https://qt.gitorious.org/qt-mobility/contacts/blobs/48c5131/tests/auto/qcontactmanager/tst_qcontactmanager.cpp#line3921

      But: other than tested in QContactManager::partialSave() and hinted/specified in the API dox the Symbian backend returns BadArgumentError, not DoesNotExistError. Which somehow also makes sense, as a wrong manager uri is just a bad argument, cannot point to any existing contact. DoesNotExistError only should be returned for proper ids, but where the localId points to a not existing one IMHO.

      So please fix the API dox to be complete about the behaviour with regard to allowed contact ids and adapt the unit test and/or the Symbian backend, perhaps even more. This problem impedes us in qtcontacts-tracker development.

      Attachments

        Activity

          People

            satu.m.makela satu makela
            kossebau Friedrich W. H. Kossebau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: