Hi,

I can't seem to be able to save a modified contact in the simulator. I use a single instance of a QContactManager to load the contacts. Then I modify the favorite detail, save it into the contact and then save the contact itself into the store. All the result codes are OK, but if I then load the contacts again and get the supposedly modified contact again, I see it was not saved.

Here is the code:

QContactManager contactMgr; // this instantiates the memory contact manager
QList<QContact> list = contactMgr.contacts();

QContact *contact = list[0];
QContactFavorite favorite = contact->detail<QContactFavorite>();

qDebug("%s Favorite set to %d", contact->displayLabel().toAscii().data(), favorite.isFavorite());
--> all favorites are always zero after simulator startup

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

// save the contact back into the store
bool result = contactMgr.saveContact (contactP);
--> this returns true, which means success

// now, reload all contacts from the manager
QList<QContact> list2 = contactMgr.contacts();

// At this point, if I fetch the same contact again that I just saved, I see it was not modified.
QContact *contact2 = list2[0];

Any idea what I'm doing wrong? or maybe it's a normal behavior when using the memory contact manager ?

Thanks

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