X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-account-mgr.c;h=913d7d492a3f91b5f420b077becbca3d9785d35c;hp=7b821f54a078cbc1453b19fd631d12d241d56c6b;hb=bd1dd4fa59a3cfac003c3fd0c13d75727f36a29c;hpb=43146a5b6e3b25f94d8650f77b71eb046a611724 diff --git a/src/modest-account-mgr.c b/src/modest-account-mgr.c index 7b821f5..913d7d4 100644 --- a/src/modest-account-mgr.c +++ b/src/modest-account-mgr.c @@ -1591,7 +1591,6 @@ modest_account_mgr_get_default_account (ModestAccountMgr *self) g_printerr ("modest: failed to get '%s': %s\n", MODEST_CONF_DEFAULT_ACCOUNT, err->message); g_error_free (err); - g_free (account); return NULL; } @@ -1651,3 +1650,28 @@ modest_account_mgr_set_display_name (ModestAccountMgr *self, if (notify) g_signal_emit (self, signals[DISPLAY_NAME_CHANGED_SIGNAL], 0, account_name); } + +gboolean +modest_account_mgr_singleton_protocol_exists (ModestAccountMgr *mgr, + ModestProtocolType protocol_type) +{ + GSList *account_names, *node; + gboolean found = FALSE; + + g_return_val_if_fail (MODEST_IS_ACCOUNT_MGR (mgr), FALSE); + account_names = modest_account_mgr_account_names (mgr, TRUE); + + for (node = account_names; node != NULL; node = g_slist_next (node)) { + ModestProtocolType current_protocol; + + current_protocol = modest_account_mgr_get_store_protocol (mgr, (gchar *) node->data); + if (current_protocol == protocol_type) { + found = TRUE; + break; + } + } + + modest_account_mgr_free_account_names (account_names); + + return found; +}