diff --git a/src/calls-account-provider.c b/src/calls-account-provider.c index 1ff474f..322ee81 100644 --- a/src/calls-account-provider.c +++ b/src/calls-account-provider.c @@ -62,6 +62,8 @@ calls_account_provider_add_account (CallsAccountProvider *self, iface = CALLS_ACCOUNT_PROVIDER_GET_IFACE (self); g_return_val_if_fail (iface->add_account != NULL, FALSE); + g_debug ("Trying to add account for %s", calls_credentials_get_name (credentials)); + return iface->add_account (self, credentials); } @@ -85,6 +87,8 @@ calls_account_provider_remove_account (CallsAccountProvider *self, iface = CALLS_ACCOUNT_PROVIDER_GET_IFACE (self); g_return_val_if_fail (iface->remove_account != NULL, FALSE); + g_debug ("Trying to remove account from %s", calls_credentials_get_name (credentials)); + return iface->remove_account (self, credentials); } @@ -106,5 +110,7 @@ calls_account_provider_get_account (CallsAccountProvider *self, iface = CALLS_ACCOUNT_PROVIDER_GET_IFACE (self); g_return_val_if_fail (iface->get_account != NULL, NULL); + g_debug ("Trying to get account from %s", calls_credentials_get_name (credentials)); + return iface->get_account (self, credentials); } diff --git a/src/calls-credentials.c b/src/calls-credentials.c index 41508df..97002b1 100644 --- a/src/calls-credentials.c +++ b/src/calls-credentials.c @@ -389,3 +389,29 @@ calls_credentials_update_from_keyfile (CallsCredentials *self, return TRUE; } + +const char * +calls_credentials_get_name (CallsCredentials *self) +{ + g_return_val_if_fail (CALLS_IS_CREDENTIALS (self), NULL); + + return self->name; +} + +void +calls_credentials_set_name (CallsCredentials *self, + const char *name) +{ + g_return_if_fail (CALLS_IS_CREDENTIALS (self)); + + if (!name) + return; + + if (g_strcmp0 (name, self->name) == 0) + return; + + g_free (self->name); + self->name = g_strdup (name); + + g_object_notify_by_pspec (G_OBJECT (self), props[PROP_NAME]); +} diff --git a/src/calls-credentials.h b/src/calls-credentials.h index 8ff192b..f8439f8 100644 --- a/src/calls-credentials.h +++ b/src/calls-credentials.h @@ -37,6 +37,9 @@ CallsCredentials *calls_credentials_new (); gboolean calls_credentials_update_from_keyfile (CallsCredentials *self, GKeyFile *key_file, const char *name); +void calls_credentials_set_name (CallsCredentials *self, + const char *name); +const char *calls_credentials_get_name (CallsCredentials *self); G_END_DECLS