gobjectification: 83f5c5ac: Some cleanups.

sadrul at pidgin.im sadrul at pidgin.im
Wed Jul 14 03:14:14 EDT 2010


----------------------------------------------------------------------
Revision: 83f5c5acb69db25d4b298ad6507466df8c458446
Parent:   1dce411a6ab371e9f33e1253536ed1b688a85e86
Author:   sadrul at pidgin.im
Date:     07/14/10 01:13:47
Branch:   im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/83f5c5acb69db25d4b298ad6507466df8c458446

Changelog: 

Some cleanups.

Remove purple_account_destroy, and code for yahoo-japan migration.

Changes against parent 1dce411a6ab371e9f33e1253536ed1b688a85e86

  patched  libpurple/account.c
  patched  libpurple/plugins/perl/common/Account.xs

-------------- next part --------------
============================================================
--- libpurple/account.c	5a05541ae886714c64e09395f43ef58dc071727e
+++ libpurple/account.c	f9cdbd6d988f18c2a48baa1c279b732e8dfad93c
@@ -499,41 +499,7 @@ purple_account_set_property(GObject *obj
 /*********************************************************************
  * Reading from disk                                                 *
  *********************************************************************/
-static void
-migrate_yahoo_japan(PurpleAccount *account)
-{
-	/* detect a Yahoo! JAPAN account that existed prior to 2.6.0 and convert it
-	 * to use the new prpl-yahoojp.  Also remove the account-specific settings
-	 * we no longer need */
 
-	if(purple_strequal(purple_account_get_protocol_id(account), "prpl-yahoo")) {
-		if(purple_account_get_bool(account, "yahoojp", FALSE)) {
-			PurplePlugin *prpl;
-			const char *serverjp = purple_account_get_string(account, "serverjp", NULL);
-			const char *xferjp_host = purple_account_get_string(account, "xferjp_host", NULL);
-
-			g_return_if_fail(serverjp != NULL);
-			g_return_if_fail(xferjp_host != NULL);
-
-			purple_account_set_string(account, "server", serverjp);
-			purple_account_set_string(account, "xfer_host", xferjp_host);
-
-			prpl = purple_find_prpl("prpl-yahoojp");
-			g_return_if_fail(prpl != NULL);
-
-			purple_account_set_protocol(account, prpl);
-		}
-
-		/* these should always be nuked */
-		purple_account_remove_setting(account, "yahoojp");
-		purple_account_remove_setting(account, "serverjp");
-		purple_account_remove_setting(account, "xferjp_host");
-
-	}
-
-	return;
-}
-
 /* Get method for GObject properties */
 static void
 purple_account_get_property(GObject *obj, guint param_id, GValue *value,
@@ -581,10 +547,6 @@ purple_account_get_property(GObject *obj
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
 			break;
 	}
-
-	/* we do this here because we need access to account settings to determine
-	 * if we can/should migrate an old Yahoo! JAPAN account */
-	migrate_yahoo_japan(account);
 }
 
 /* Gobject initialization function */
@@ -656,6 +618,16 @@ purple_account_finalize(GObject *obj)
 
 	priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
 
+	while (account->deny) {
+		g_free(account->deny->data);
+		account->deny = g_slist_delete_link(account->deny, account->deny);
+	}
+
+	while (account->permit) {
+		g_free(account->permit->data);
+		account->permit = g_slist_delete_link(account->permit, account->permit);
+	}
+
 	g_free(priv->username);
 	g_free(priv->alias);
 	g_free(priv->password);
@@ -763,6 +735,7 @@ static void purple_account_class_init(Pu
 				G_SIGNAL_ACTION | G_SIGNAL_DETAILED, 0, NULL, NULL,
 				g_cclosure_marshal_VOID__VOID,
 				G_TYPE_NONE, 0);
+
 #warning TODO: Setup more signals
 
 	g_type_class_add_private(klass, sizeof(PurpleAccountPrivate));
@@ -844,24 +817,6 @@ purple_account_new(const char *username,
 	return account;
 }
 
-void
-purple_account_destroy(PurpleAccount *account)
-{
-	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
-
-	while (account->deny) {
-		g_free(account->deny->data);
-		account->deny = g_slist_delete_link(account->deny, account->deny);
-	}
-
-	while (account->permit) {
-		g_free(account->permit->data);
-		account->permit = g_slist_delete_link(account->permit, account->permit);
-	}
-
-	g_object_unref(G_OBJECT(account));
-}
-
 #if 0
 void
 purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data)
============================================================
--- libpurple/plugins/perl/common/Account.xs	e2f533e570fb77c6caf5f2e05792eed1e7aaf37f
+++ libpurple/plugins/perl/common/Account.xs	dd26fae155c69df71b9e1b8a0a1acb3054810bf5
@@ -15,10 +15,6 @@ void
     username, protocol_id
 
 void
-purple_account_destroy(account)
-    Purple::Account account
-
-void
 purple_account_connect(account)
     Purple::Account account
 


More information about the Commits mailing list