diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-12 15:37:32 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-12 15:37:32 +0000 |
commit | 0a4e4a6f576fead8bc718a2d076911d8f5168cde (patch) | |
tree | c8956ae760f24584e9f2bb5edb3155e93bb38546 | |
parent | 692946fe470eae3f3e9fa9453dec7d1f62cff7f2 (diff) | |
download | telepathy-mission-control-0a4e4a6f576fead8bc718a2d076911d8f5168cde.tar.gz |
Revert "Rename commit_one() to commit()"
This reverts commit b8617c51c1729e1579f9f066ead1fa80b0fd99a1.
-rw-r--r-- | mission-control-plugins/account-storage.c | 26 | ||||
-rw-r--r-- | mission-control-plugins/account-storage.h | 6 | ||||
-rw-r--r-- | src/mcd-account-manager-default.c | 2 | ||||
-rw-r--r-- | src/mcd-storage.c | 4 | ||||
-rw-r--r-- | tests/twisted/dbus-account-plugin.c | 73 | ||||
-rw-r--r-- | tests/twisted/mcp-account-diversion.c | 5 |
6 files changed, 58 insertions, 58 deletions
diff --git a/mission-control-plugins/account-storage.c b/mission-control-plugins/account-storage.c index 7b813c4c..28ca4cfa 100644 --- a/mission-control-plugins/account-storage.c +++ b/mission-control-plugins/account-storage.c @@ -59,7 +59,7 @@ * iface->get = foo_plugin_get; * iface->set = foo_plugin_get; * iface->delete = foo_plugin_delete; - * iface->commit = foo_plugin_commit; + * iface->commit_one = foo_plugin_commit_one; * iface->list = foo_plugin_list; * iface->ready = foo_plugin_ready; * iface->get_identifier = foo_plugin_get_identifier; @@ -165,7 +165,7 @@ default_delete (const McpAccountStorage *storage, } static gboolean -default_commit (const McpAccountStorage *storage, +default_commit_one (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account) { @@ -213,7 +213,7 @@ class_init (gpointer klass, iface->set_parameter = default_set_parameter; iface->create = default_create; iface->delete = default_delete; - iface->commit = default_commit; + iface->commit_one = default_commit_one; iface->ready = default_ready; iface->get_identifier = default_get_identifier; iface->get_additional_info = default_get_additional_info; @@ -365,7 +365,7 @@ mcp_account_storage_get_type (void) * @delete: implementation of mcp_account_storage_delete() * @list: implementation of mcp_account_storage_list() * @ready: implementation of mcp_account_storage_ready() - * @commit: implementation of mcp_account_storage_commit() + * @commit_one: implementation of mcp_account_storage_commit_one() * @get_identifier: implementation of mcp_account_storage_get_identifier() * @get_additional_info: implementation of * mcp_account_storage_get_additional_info() @@ -503,7 +503,7 @@ mcp_account_storage_get (const McpAccountStorage *storage, * * The plugin is not expected to write to its long term storage * at this point. It can expect Mission Control to call - * mcp_account_storage_commit() after a short delay. + * mcp_account_storage_commit_one() after a short delay. * * Plugins that implement mcp_storage_set_attribute() and * mcp_account_storage_set_parameter() can just return %FALSE here. @@ -642,7 +642,7 @@ mcp_account_storage_set_parameter (McpAccountStorage *storage, * Inform the plugin that a new account is being created. @manager, @protocol * and @identification are given to help determining the account's unique name, * but does not need to be stored on the account yet, mcp_account_storage_set() - * and mcp_account_storage_commit() will be called later. + * and mcp_account_storage_commit_one() will be called later. * * It is recommended to use mcp_account_manager_get_unique_name() to create the * unique name, but it's not mandatory. One could base the unique name on an @@ -650,7 +650,7 @@ mcp_account_storage_set_parameter (McpAccountStorage *storage, * (e.g. goa__1234). * * #McpAccountStorage::created signal should not be emitted for this account, - * not even when mcp_account_storage_commit() will be called. + * not even when mcp_account_storage_commit_one() will be called. * * There is a default implementation, which just returns %NULL and raise an * error. @@ -735,19 +735,19 @@ mcp_account_storage_delete (const McpAccountStorage *storage, } /** - * McpAccountStorageCommitFunc: + * McpAccountStorageCommitOneFunc: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: (allow-none): the unique suffix of an account's object path, * or %NULL * - * An implementation of mcp_account_storage_commit(). + * An implementation of mcp_account_storage_commit_one(). * * Returns: %TRUE if the commit process was started successfully */ /** - * mcp_account_storage_commit: + * mcp_account_storage_commit_one: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: (allow-none): the unique suffix of an account's object path, @@ -771,7 +771,7 @@ mcp_account_storage_delete (const McpAccountStorage *storage, * obvious. */ gboolean -mcp_account_storage_commit (const McpAccountStorage *storage, +mcp_account_storage_commit_one (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account) { @@ -779,9 +779,9 @@ mcp_account_storage_commit (const McpAccountStorage *storage, SDEBUG (storage, "called for %s", account ? account : "<all accounts>"); g_return_val_if_fail (iface != NULL, FALSE); - g_return_val_if_fail (iface->commit != NULL, FALSE); + g_return_val_if_fail (iface->commit_one != NULL, FALSE); - return iface->commit (storage, am, account); + return iface->commit_one (storage, am, account); } /** diff --git a/mission-control-plugins/account-storage.h b/mission-control-plugins/account-storage.h index 14ec5770..fc0cc8f3 100644 --- a/mission-control-plugins/account-storage.h +++ b/mission-control-plugins/account-storage.h @@ -85,7 +85,7 @@ typedef gboolean (*McpAccountStorageDeleteFunc) ( typedef GList * (*McpAccountStorageListFunc) ( const McpAccountStorage *storage, const McpAccountManager *am); -typedef gboolean (*McpAccountStorageCommitFunc) ( +typedef gboolean (*McpAccountStorageCommitOneFunc) ( const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account); @@ -117,7 +117,7 @@ struct _McpAccountStorageIface McpAccountStorageDeleteFunc delete; McpAccountStorageListFunc list; McpAccountStorageReadyFunc ready; - McpAccountStorageCommitFunc commit; + McpAccountStorageCommitOneFunc commit_one; McpAccountStorageGetIdentifierFunc get_identifier; McpAccountStorageGetAdditionalInfoFunc get_additional_info; McpAccountStorageGetRestrictionsFunc get_restrictions; @@ -168,7 +168,7 @@ void mcp_account_storage_ready (const McpAccountStorage *storage, const McpAccountManager *am); gboolean -mcp_account_storage_commit (const McpAccountStorage *storage, +mcp_account_storage_commit_one (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account); diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c index 515cdbd3..202e8c43 100644 --- a/src/mcd-account-manager-default.c +++ b/src/mcd-account-manager-default.c @@ -1015,7 +1015,7 @@ account_storage_iface_init (McpAccountStorageIface *iface, iface->set_parameter = set_parameter; iface->create = _create; iface->delete = _delete; - iface->commit = _commit; + iface->commit_one = _commit; iface->list = _list; } diff --git a/src/mcd-storage.c b/src/mcd-storage.c index df79d89e..353a2b0a 100644 --- a/src/mcd-storage.c +++ b/src/mcd-storage.c @@ -2169,7 +2169,7 @@ mcd_storage_commit (McdStorage *self, const gchar *account) DEBUG ("flushing plugin %s %s to long term storage", mcp_account_storage_name (sa->storage), account); - mcp_account_storage_commit (sa->storage, ma, account); + mcp_account_storage_commit_one (sa->storage, ma, account); return; } @@ -2179,7 +2179,7 @@ mcd_storage_commit (McdStorage *self, const gchar *account) DEBUG ("flushing plugin %s to long term storage", mcp_account_storage_name (plugin)); - mcp_account_storage_commit (plugin, ma, NULL); + mcp_account_storage_commit_one (plugin, ma, NULL); } } diff --git a/tests/twisted/dbus-account-plugin.c b/tests/twisted/dbus-account-plugin.c index d1c0bf14..063b886d 100644 --- a/tests/twisted/dbus-account-plugin.c +++ b/tests/twisted/dbus-account-plugin.c @@ -1194,6 +1194,36 @@ test_dbus_account_plugin_set_parameter (McpAccountStorage *storage, return TRUE; } +static gboolean +test_dbus_account_plugin_commit (const McpAccountStorage *storage, + const McpAccountManager *am) +{ + TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); + GHashTableIter iter; + gpointer k; + + DEBUG ("called"); + + if (!self->active) + return FALSE; + + g_dbus_connection_emit_signal (self->bus, NULL, + TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, + "CommittingAll", NULL, NULL); + + g_hash_table_iter_init (&iter, self->accounts); + + while (g_hash_table_iter_next (&iter, &k, NULL)) + { + if (!mcp_account_storage_commit_one (storage, am, k)) + { + g_warning ("declined to commit account %s", (const gchar *) k); + } + } + + return TRUE; +} + static void delete_account_cb (GObject *source_object, GAsyncResult *res, @@ -1325,9 +1355,11 @@ update_parameters_cb (GObject *source_object, } static gboolean -commit_one (TestDBusAccountPlugin *self, +test_dbus_account_plugin_commit_one (const McpAccountStorage *storage, + const McpAccountManager *am, const gchar *account_name) { + TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); GHashTableIter iter; gpointer k; @@ -1338,6 +1370,9 @@ commit_one (TestDBusAccountPlugin *self, DEBUG ("%s", account_name); + if (account_name == NULL) + return test_dbus_account_plugin_commit (storage, am); + if (!self->active || account == NULL) return FALSE; @@ -1489,40 +1524,6 @@ commit_one (TestDBusAccountPlugin *self, return TRUE; } -static gboolean -test_dbus_account_plugin_commit (const McpAccountStorage *storage, - const McpAccountManager *am, - const gchar *account_name) -{ - TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); - GHashTableIter iter; - gpointer k; - - DEBUG ("called"); - - if (!self->active) - return FALSE; - - if (account_name != NULL) - return commit_one (self, account_name); - - g_dbus_connection_emit_signal (self->bus, NULL, - TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, - "CommittingAll", NULL, NULL); - - g_hash_table_iter_init (&iter, self->accounts); - - while (g_hash_table_iter_next (&iter, &k, NULL)) - { - if (!commit_one (self, k)) - { - g_warning ("declined to commit account %s", (const gchar *) k); - } - } - - return TRUE; -} - static void test_dbus_account_plugin_get_identifier (const McpAccountStorage *storage, const gchar *account_name, @@ -1593,7 +1594,7 @@ account_storage_iface_init (McpAccountStorageIface *iface) iface->list = test_dbus_account_plugin_list; iface->ready = test_dbus_account_plugin_ready; iface->delete = test_dbus_account_plugin_delete; - iface->commit = test_dbus_account_plugin_commit; + iface->commit_one = test_dbus_account_plugin_commit_one; iface->get_identifier = test_dbus_account_plugin_get_identifier; iface->get_additional_info = test_dbus_account_plugin_get_additional_info; iface->get_restrictions = test_dbus_account_plugin_get_restrictions; diff --git a/tests/twisted/mcp-account-diversion.c b/tests/twisted/mcp-account-diversion.c index c3fa55a0..9e8bb867 100644 --- a/tests/twisted/mcp-account-diversion.c +++ b/tests/twisted/mcp-account-diversion.c @@ -206,7 +206,7 @@ _delete (const McpAccountStorage *self, static gboolean -_commit (const McpAccountStorage *self, +_commit_one (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account_name) { @@ -221,7 +221,6 @@ _commit (const McpAccountStorage *self, if (!_have_config ()) _create_config (); - /* In this naïve implementation, we always commit all accounts together */ data = g_key_file_to_data (adp->keyfile, &n, NULL); rval = g_file_set_contents (_conf_filename (), data, n, NULL); adp->save = !rval; @@ -268,7 +267,7 @@ account_storage_iface_init (McpAccountStorageIface *iface, iface->get = _get; iface->set = _set; iface->delete = _delete; - iface->commit = _commit; + iface->commit_one = _commit_one; iface->list = _list; } |