LoggerD("Removing session:" << mSession);
- // delete/unref individual contacts
- for(auto it=mContacts.begin(); it!=mContacts.end(); ++it) {
- EContact *contact = (*it).second;
- if(contact) {
- // TODO: delete also all its attribs?
- g_object_unref(contact);
+ // Changing the behavior of removeSession so that when notify is set to false,
+ // we will only close the obex session without destroying cached data, this
+ // unblocks other clients when accessing obex.
+ if (notify) {
+ // delete/unref individual contacts
+ for(auto it=mContacts.begin(); it!=mContacts.end(); ++it) {
+ EContact *contact = (*it).second;
+ if(contact) {
+ // TODO: delete also all its attribs?
+ g_object_unref(contact);
+ }
}
- }
- mContacts.clear();
- mContactsOrder.clear();
-
- // delete/unref individual cll history entries
- for(auto it=mCallHistory.begin(); it!=mCallHistory.end(); ++it) {
- EContact *item = (*it).second;
- if(item) {
- // TODO: delete also all its attribs?
- g_object_unref(item);
+ mContacts.clear();
+ mContactsOrder.clear();
+
+ // delete/unref individual call history entries
+ for(auto it=mCallHistory.begin(); it!=mCallHistory.end(); ++it) {
+ EContact *item = (*it).second;
+ if(item) {
+ // TODO: delete also all its attribs?
+ g_object_unref(item);
+ }
}
+ mCallHistory.clear();
+ mCallHistoryOrder.clear();
}
- mCallHistory.clear();
- mCallHistoryOrder.clear();
GError *err = NULL;
g_dbus_connection_call_sync( g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL),
{
char *status_str=0;
g_variant_get(var, "s", &status_str);
- //LoggerD("Status is: " << status_str);
+ LoggerD("Status is: " << status_str);
if(!strcmp(status_str, "complete"))
{
}
else if(line.find("X-IRMC-CALL-DATETIME") == 0) {
size_t index1 = line.find( "TYPE=" ) + 5;
+ if (index1 == 4) {
+ // vcard format doesn't contain "TYPE=" prefix
+ // use ";" as the index instead
+ index1 = line.find( ";" ) + 1;
+ }
size_t index2 = line.find( ":", index1 ) + 1;
std::string note = line.substr (index1, index2-index1-1);