Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QContactManager bug?

QContactManager bug?

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrBlueSky125
    wrote on last edited by
    #1

    I had problems to fetch contacts in my QML application, that I described here: "Contact model not working":http://developer.qt.nokia.com/forums/viewthread/7846

    But after further testing it seems like a bug in the ContactManager. I always get the QContactManager::InvalidDetailError if i try to fetch contacts (only from symbian backend, "symbiansim" or the simulator works fine).

    This code in my main.cpp:
    @
    QContactManager cm;
    qDebug() << cm.availableManagers();
    qDebug() << cm.contacts();
    qDebug() << cm.managerName();
    qDebug() << cm.managerParameters();
    qDebug() << cm.managerUri();
    qDebug() << cm.managerVersion();
    qDebug() << cm.error();
    @

    leads always to this console output:
    @
    [Qt Message] ("symbian", "memory", "invalid", "symbiansim")
    [Qt Message] ()
    [Qt Message] "symbian"
    [Qt Message] QMap()
    [Qt Message] "qtcontacts:symbian:"
    [Qt Message] 1
    [Qt Message] 3
    @

    After reading this: "QContactManager contact fetching broken on Symbian^3?":http://developer.qt.nokia.com/forums/viewthread/6078 I purged my complete contacts from my phone but it still gives me the same error, even if there are no contacts anymore.

    Maybe I still doing something wrong...

    Qt version: 4.7.3
    QtMobility version : 1.1.3

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chriadam
      wrote on last edited by
      #2

      A couple of things: if the number of contacts in the device phonebook (not the sim phonebook) is zero, then a default constructed contact manager will return zero contacts (that's expected behaviour). A manager should never set the error to invalid detail error after a synchronous fetch operation, though, so that certainly sounds like a bug.

      Out of interest, what happens if you attempt to fetch contactIds() instead of contacts()? If that returns some list of ids, can you then call contacts(idList) overload, and then post what the errorMap is filled with?

      Cheers,
      Chris.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MrBlueSky125
        wrote on last edited by
        #3

        Thanks for the reply. I tried what you said and called contactIds(), which returned a list of ids. I called the contacts() functions with this ids and voilĂ  all of the contacts are returned with no errors.

        So as a workaround I can assign that list to my QML context to display the contacts.

        Tahnks again, that hint helped me alot.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved