From 462e00b13b2f9d0756d67b3b46e768b722f93276 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 10 Sep 2013 12:20:00 +0100 Subject: [PATCH 3/8] Remove partially-implemented McpAccountStorage::altered --- mission-control-plugins/account-storage.c | 34 +--------------- mission-control-plugins/account-storage.h | 3 -- src/mcd-account-manager.c | 65 ------------------------------- 3 files changed, 1 insertion(+), 101 deletions(-) diff --git a/mission-control-plugins/account-storage.c b/mission-control-plugins/account-storage.c index 3991c0c..f4bec62 100644 --- a/mission-control-plugins/account-storage.c +++ b/mission-control-plugins/account-storage.c @@ -103,7 +103,6 @@ enum { CREATED, - ALTERED, TOGGLED, DELETED, ALTERED_ONE, @@ -192,23 +191,6 @@ class_init (gpointer klass, 1, G_TYPE_STRING); /** - * McpAccountStorage::altered - * @account: the unique name of the altered account - * - * This signal does not appear to be fully implemented - * (see freedesktop.org bug 28288). - * Emit #McpAccountStorage::altered-one instead. - * - * Should not be fired until mcp_account_storage_ready() has been called - * - */ - signals[ALTERED] = g_signal_new ("altered", - type, G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED, 0, NULL, NULL, - g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, - 1, G_TYPE_STRING); - - /** * McpAccountStorage::altered-one * @account: the unique name of the altered account * @name: the name of the altered property (its key) @@ -966,7 +948,7 @@ mcp_account_storage_list (const McpAccountStorage *storage, * @am: an #McpAccountManager instance * * Informs the plugin that it is now permitted to create new accounts, - * ie it can now fire its "created", "altered", "toggled" and "deleted" + * ie it can now fire its "created", "altered-one", "toggled" and "deleted" * signals. */ void @@ -1180,20 +1162,6 @@ mcp_account_storage_emit_created (McpAccountStorage *storage, } /** - * mcp_account_storage_emit_altered: - * @storage: an #McpAccountStorage instance - * @account: the unique name of the altered account - * - * Emits the #McpAccountStorage::altered signal - */ -void -mcp_account_storage_emit_altered (McpAccountStorage *storage, - const gchar *account) -{ - g_signal_emit (storage, signals[ALTERED], 0, account); -} - -/** * mcp_account_storage_emit_altered_one: * @storage: an #McpAccountStorage instance * @account: the unique name of the altered account diff --git a/mission-control-plugins/account-storage.h b/mission-control-plugins/account-storage.h index 91cdd78..171f460 100644 --- a/mission-control-plugins/account-storage.h +++ b/mission-control-plugins/account-storage.h @@ -284,9 +284,6 @@ gboolean mcp_account_storage_set_parameter (McpAccountStorage *storage, void mcp_account_storage_emit_created (McpAccountStorage *storage, const gchar *account); -G_DEPRECATED_FOR (something that is actually implemented) -void mcp_account_storage_emit_altered (McpAccountStorage *storage, - const gchar *account); void mcp_account_storage_emit_altered_one (McpAccountStorage *storage, const gchar *account, const gchar *key); diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c index 57296cd..66cc851 100644 --- a/src/mcd-account-manager.c +++ b/src/mcd-account-manager.c @@ -146,70 +146,6 @@ static void account_loaded (McdAccount *account, const GError *error, gpointer user_data); -/* calback chain for asynchronously updates from backends: */ -static void -async_altered_validity_cb (McdAccount *account, const GError *invalid_reason, gpointer data) -{ - DEBUG ("asynchronously altered account %s is %svalid", - mcd_account_get_unique_name (account), (invalid_reason == NULL) ? "" : "in"); - - g_object_unref (account); -} - -static void -async_altered_manager_cb (McdManager *cm, const GError *error, gpointer data) -{ - McdAccount *account = data; - const gchar *name = NULL; - - if (cm != NULL) - name = mcd_manager_get_name (cm); - - if (error != NULL) - DEBUG ("manager %s not ready: %s", name, error->message); - else - DEBUG ("manager %s is ready", name); - - /* this triggers the final parameter check which results in dbus signals * - * being fired and (potentially) the account going online automatically */ - mcd_account_check_validity (account, async_altered_validity_cb, NULL); - - g_object_unref (cm); -} - -/* account has been updated by a third party, and the McpAccountStorage * - * plugin has just informed us of this fact */ -static void -altered_cb (GObject *storage, const gchar *name, gpointer data) -{ - McdAccountManager *am = MCD_ACCOUNT_MANAGER (data); - McdMaster *master = mcd_master_get_default (); - McdAccount *account = NULL; - McdManager *cm = NULL; - const gchar *cm_name = NULL; - - account = mcd_account_manager_lookup_account (am, name); - - if (G_UNLIKELY (!account)) - { - g_warning ("%s: account %s does not exist", G_STRFUNC, name); - return; - } - - /* in theory, the CM is already ready by this point, but make sure: */ - cm_name = mcd_account_get_manager_name (account); - - if (cm_name != NULL) - cm = _mcd_master_lookup_manager (master, cm_name); - - if (cm != NULL) - { - g_object_ref (cm); - g_object_ref (account); - mcd_manager_call_when_ready (cm, async_altered_manager_cb, account); - } -} - static void async_altered_one_manager_cb (McdManager *cm, const GError *error, @@ -1658,7 +1594,6 @@ _mcd_account_manager_constructed (GObject *obj) guint i = 0; static struct { const gchar *name; GCallback handler; } sig[] = { { "created", G_CALLBACK (created_cb) }, - { "altered", G_CALLBACK (altered_cb) }, { "toggled", G_CALLBACK (toggled_cb) }, { "deleted", G_CALLBACK (deleted_cb) }, { "altered-one", G_CALLBACK (altered_one_cb) }, -- 1.8.4.rc3