On 30/07/2011 01:24, Friedrich W. H. Kossebau wrote:
Are you sure here about the memory contact manager as default one?
Can you tell what contactMgr.managerUri() returns as string?

managerName() returns "memory"
managerURI() returns "qtcontacts:memory:id=simulator"

Hm, did this compile? IMNSHO this needs to be:
        QContact contact = list[0];

Possibly. The code I have included here is not the actual code, it's just for illustration. The actual code implements a custom ContactModel class derived from QAbstractListModel, and used by a QML view. The contacts are actually displayed in the view, so I am sure about which one I'm manipulating, even after reload.

Who stored the contacts? And have any favorite details been stored before?

Those are the default contacts in the simulator.

Because by default a QContact does not have a QContactFavorite detail. So
        contact.detail<QContactFavorite>()
will just return a default QContactFavorite().
Test the returned detail with .isEmpty() to see yourself.
With an empty detail any fields will have the same value as converting a
QVariant() to the field type will have.

I understand that, but....

// invert favorite detail and save it back into the contact
favorite.setFavorite(!favorite.isFavorite());
contactP->saveDetail(&favorite);

... wouldn't that above create the favorite detail if it didn't exist?

Thank you for your time.

Eric
_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev
http://wiki.meego.com/Mailing_list_guidelines

Reply via email to