Hi all,

I am trying to do some custom code in latest qutecom code.
When qutecom is started I wanted to remove some contacts from contactlist
based on a custom type set by us.
Following is the code that I used to achieve this. (loop through all
contacts, check the custom type and remove those matched contacts) :

for (std::list<Contact>::const_iterator it =
_contactList->getContacts().begin();
                it != _contactList->getContacts().end();
                *it++* /*<<-- Suspect of crashing qutecom*/)
        {

            LOG_INFO("temp log");

                if(it->getContactType()=="Auto")
                {
                     LOG_INFO("removing : " + it->getUUID());

_contactList->removeContact(*_contactList->getContact(it->getUUID()));
                }
         }

I have used the above code in function "*void
UserProfile::loginStateChangedEventHandlerThreadSafe*" in
wengophone/src/model/profile/Userprofile.cpp

Now when this for loop executes, first loop it goes well, now when it does
it++ and tries to iterate to next contact, qutecom crashes. So can anyone
suggest me any idea how can I iterate over the contacts, check some
condition of contact and remove those ?

Any help would be appreciated.

Thank You,
Ankit Gandhi.
_______________________________________________
QuteCom-dev mailing list
[email protected]
http://lists.qutecom.org/mailman/listinfo/qutecom-dev

Reply via email to