From 4ea7f17c400744b37600ec714d427c6eac214971 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 28 Aug 2012 16:53:17 +0100 Subject: [PATCH 2/8] McdAccountManager: remove useless virtual method We no longer allow McdAccountManager or McdAccount to be subclassed. --- src/mcd-account-manager.c | 17 +++-------------- src/mcd-account-manager.h | 8 -------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c index e752406..9a12d1b 100644 --- a/src/mcd-account-manager.c +++ b/src/mcd-account-manager.c @@ -326,7 +326,6 @@ created_cb (GObject *storage_plugin_obj, McpAccountStorage *plugin = MCP_ACCOUNT_STORAGE (storage_plugin_obj); McdAccountManager *am = MCD_ACCOUNT_MANAGER (data); McdAccountManagerPrivate *priv = MCD_ACCOUNT_MANAGER_PRIV (am); - McdAccountManagerClass *mclass = MCD_ACCOUNT_MANAGER_GET_CLASS (am); McdLoadAccountsData *lad = g_slice_new (McdLoadAccountsData); McdAccount *account = NULL; McdStorage *storage = priv->storage; @@ -342,7 +341,7 @@ created_cb (GObject *storage_plugin_obj, if (mcp_account_storage_get (plugin, MCP_ACCOUNT_MANAGER (storage), name, NULL)) { - account = mclass->account_new (am, name); + account = mcd_account_new (am, name); lad->account = account; } else @@ -606,12 +605,6 @@ list_connection_names_cb (const gchar * const *names, gsize n, g_free (contents); } -static McdAccount * -account_new (McdAccountManager *account_manager, const gchar *name) -{ - return mcd_account_new (account_manager, name); -} - static void on_account_validity_changed (McdAccount *account, gboolean valid, McdAccountManager *account_manager) @@ -924,8 +917,7 @@ _mcd_account_manager_create_account (McdAccountManager *account_manager, MC_ACCOUNTS_KEY_DISPLAY_NAME, display_name, FALSE); - account = MCD_ACCOUNT_MANAGER_GET_CLASS (account_manager)->account_new - (account_manager, unique_name); + account = mcd_account_new (account_manager, unique_name); g_free (unique_name); if (G_LIKELY (account)) @@ -1440,8 +1432,7 @@ _mcd_account_manager_setup (McdAccountManager *account_manager) continue; } - account = MCD_ACCOUNT_MANAGER_GET_CLASS (account_manager)->account_new - (account_manager, *name); + account = mcd_account_new (account_manager, *name); if (G_UNLIKELY (!account)) { @@ -1591,8 +1582,6 @@ mcd_account_manager_class_init (McdAccountManagerClass *klass) object_class->get_property = get_property; object_class->constructed = _mcd_account_manager_constructed; - klass->account_new = account_new; - g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "DBus daemon", "DBus daemon", diff --git a/src/mcd-account-manager.h b/src/mcd-account-manager.h index a249b19..373dffa 100644 --- a/src/mcd-account-manager.h +++ b/src/mcd-account-manager.h @@ -56,14 +56,6 @@ struct _McdAccountManager struct _McdAccountManagerClass { GObjectClass parent_class; - McdAccount *(*account_new) (McdAccountManager *account_manager, - const gchar *name); - void (*_mc_reserved2) (void); - void (*_mc_reserved3) (void); - void (*_mc_reserved4) (void); - void (*_mc_reserved5) (void); - void (*_mc_reserved6) (void); - void (*_mc_reserved7) (void); }; GType mcd_account_manager_get_type (void); -- 1.7.10.4