# HG changeset patch
# Node ID ccec542c6aa1
# Parent  1923e48a65a5
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -339,11 +339,17 @@
 		* purple_account_get_password.  Use
 		  purple_credential_manager_read_password_async instead.
 		* purple_account_get_public_alias
+		* purple_account_get_ui_int
+		* purple_account_get_ui_string
+		* purple_account_get_ui_bool
 		* purple_account_set_check_mail
 		* purple_account_set_current_error
 		* purple_account_set_password.  Use
 		  purple_credential_manager_write_password_async instead.
 		* purple_account_set_public_alias
+		* purple_account_set_ui_int
+		* purple_account_set_ui_string
+		* purple_account_set_ui_bool
 		* purple_accounts_add
 		* purple_accounts_find
 		* purple_accounts_get_all
diff --git a/libpurple/account.h b/libpurple/account.h
--- a/libpurple/account.h
+++ b/libpurple/account.h
@@ -532,42 +532,6 @@
 						   gboolean value);
 
 /**
- * purple_account_set_ui_int:
- * @account: The account.
- * @ui:      The UI name.
- * @name:    The name of the setting.
- * @value:   The setting's value.
- *
- * Sets a UI-specific integer setting for an account.
- */
-void purple_account_set_ui_int(PurpleAccount *account, const char *ui,
-							 const char *name, int value);
-
-/**
- * purple_account_set_ui_string:
- * @account: The account.
- * @ui:      The UI name.
- * @name:    The name of the setting.
- * @value:   The setting's value.
- *
- * Sets a UI-specific string setting for an account.
- */
-void purple_account_set_ui_string(PurpleAccount *account, const char *ui,
-								const char *name, const char *value);
-
-/**
- * purple_account_set_ui_bool:
- * @account: The account.
- * @ui:      The UI name.
- * @name:    The name of the setting.
- * @value:   The setting's value.
- *
- * Sets a UI-specific boolean setting for an account.
- */
-void purple_account_set_ui_bool(PurpleAccount *account, const char *ui,
-							  const char *name, gboolean value);
-
-/**
  * purple_account_is_connected:
  * @account: The account.
  *
@@ -1002,49 +966,6 @@
 							   gboolean default_value);
 
 /**
- * purple_account_get_ui_int:
- * @account:       The account.
- * @ui:            The UI name.
- * @name:          The name of the setting.
- * @default_value: The default value.
- *
- * Returns a UI-specific integer setting for an account.
- *
- * Returns: The value.
- */
-int purple_account_get_ui_int(PurpleAccount *account, const char *ui,
-							const char *name, int default_value);
-
-/**
- * purple_account_get_ui_string:
- * @account:       The account.
- * @ui:            The UI name.
- * @name:          The name of the setting.
- * @default_value: The default value.
- *
- * Returns a UI-specific string setting for an account.
- *
- * Returns: The value.
- */
-const char *purple_account_get_ui_string(PurpleAccount *account,
-									   const char *ui, const char *name,
-									   const char *default_value);
-
-/**
- * purple_account_get_ui_bool:
- * @account:       The account.
- * @ui:            The UI name.
- * @name:          The name of the setting.
- * @default_value: The default value.
- *
- * Returns a UI-specific boolean setting for an account.
- *
- * Returns: The value.
- */
-gboolean purple_account_get_ui_bool(PurpleAccount *account, const char *ui,
-								  const char *name, gboolean default_value);
-
-/**
  * purple_account_add_buddy:
  * @account: The account.
  * @buddy: The buddy to add.
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -75,7 +75,6 @@
 	gboolean disconnecting;     /* The account is currently disconnecting */
 
 	GHashTable *settings;       /* Protocol-specific settings.            */
-	GHashTable *ui_settings;    /* UI-specific settings.                  */
 
 	PurpleProxyInfo *proxy_info;  /* Proxy information.  This will be set */
 								/*   to NULL when the account inherits      */
@@ -470,23 +469,6 @@
 	g_free(setting);
 }
 
-static GHashTable *
-get_ui_settings_table(PurpleAccount *account, const char *ui)
-{
-	GHashTable *table;
-	PurpleAccountPrivate *priv = purple_account_get_instance_private(account);
-
-	table = g_hash_table_lookup(priv->ui_settings, ui);
-
-	if (table == NULL) {
-		table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
-									  delete_setting);
-		g_hash_table_insert(priv->ui_settings, g_strdup(ui), table);
-	}
-
-	return table;
-}
-
 static PurpleConnectionState
 purple_account_get_state(PurpleAccount *account)
 {
@@ -679,25 +661,6 @@
 	}
 }
 
-static void
-ui_setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data)
-{
-	const char *ui;
-	GHashTable *table;
-	PurpleXmlNode *node, *child;
-
-	ui    = (const char *)key;
-	table = (GHashTable *)value;
-	node  = (PurpleXmlNode *)user_data;
-
-	if (g_hash_table_size(table) > 0)
-	{
-		child = purple_xmlnode_new_child(node, "settings");
-		purple_xmlnode_set_attrib(child, "ui", ui);
-		g_hash_table_foreach(table, setting_to_xmlnode, child);
-	}
-}
-
 PurpleXmlNode *
 _purple_account_to_xmlnode(PurpleAccount *account)
 {
@@ -744,11 +707,6 @@
 		g_hash_table_foreach(priv->settings, setting_to_xmlnode, child);
 	}
 
-	if (g_hash_table_size(priv->ui_settings) > 0)
-	{
-		g_hash_table_foreach(priv->ui_settings, ui_setting_to_xmlnode, node);
-	}
-
 	if ((proxy_info = purple_account_get_proxy_info(account)) != NULL)
 	{
 		child = proxy_settings_to_xmlnode(proxy_info);
@@ -874,8 +832,6 @@
 
 	priv->settings = g_hash_table_new_full(g_str_hash, g_str_equal,
 			g_free, delete_setting);
-	priv->ui_settings = g_hash_table_new_full(g_str_hash, g_str_equal,
-			g_free, (GDestroyNotify)g_hash_table_destroy);
 
 	priv->privacy_type = PURPLE_ACCOUNT_PRIVACY_ALLOW_ALL;
 }
@@ -994,7 +950,6 @@
 	g_free(priv->protocol_id);
 
 	g_hash_table_destroy(priv->settings);
-	g_hash_table_destroy(priv->ui_settings);
 
 	g_slist_free_full(priv->deny, g_free);
 	g_slist_free_full(priv->permit, g_free);
@@ -1850,78 +1805,6 @@
 	purple_accounts_schedule_save();
 }
 
-void
-purple_account_set_ui_int(PurpleAccount *account, const char *ui,
-						const char *name, int value)
-{
-	PurpleAccountSetting *setting;
-	GHashTable *table;
-
-	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
-	g_return_if_fail(ui      != NULL);
-	g_return_if_fail(name    != NULL);
-
-	setting = g_new0(PurpleAccountSetting, 1);
-
-	setting->ui            = g_strdup(ui);
-	g_value_init(&setting->value, G_TYPE_INT);
-	g_value_set_int(&setting->value, value);
-
-	table = get_ui_settings_table(account, ui);
-
-	g_hash_table_insert(table, g_strdup(name), setting);
-
-	purple_accounts_schedule_save();
-}
-
-void
-purple_account_set_ui_string(PurpleAccount *account, const char *ui,
-						   const char *name, const char *value)
-{
-	PurpleAccountSetting *setting;
-	GHashTable *table;
-
-	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
-	g_return_if_fail(ui      != NULL);
-	g_return_if_fail(name    != NULL);
-
-	setting = g_new0(PurpleAccountSetting, 1);
-
-	setting->ui           = g_strdup(ui);
-	g_value_init(&setting->value, G_TYPE_STRING);
-	g_value_set_string(&setting->value, value);
-
-	table = get_ui_settings_table(account, ui);
-
-	g_hash_table_insert(table, g_strdup(name), setting);
-
-	purple_accounts_schedule_save();
-}
-
-void
-purple_account_set_ui_bool(PurpleAccount *account, const char *ui,
-						 const char *name, gboolean value)
-{
-	PurpleAccountSetting *setting;
-	GHashTable *table;
-
-	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
-	g_return_if_fail(ui      != NULL);
-	g_return_if_fail(name    != NULL);
-
-	setting = g_new0(PurpleAccountSetting, 1);
-
-	setting->ui         = g_strdup(ui);
-	g_value_init(&setting->value, G_TYPE_BOOLEAN);
-	g_value_set_boolean(&setting->value, value);
-
-	table = get_ui_settings_table(account, ui);
-
-	g_hash_table_insert(table, g_strdup(name), setting);
-
-	purple_accounts_schedule_save();
-}
-
 gboolean
 purple_account_is_connected(PurpleAccount *account)
 {
@@ -2592,81 +2475,6 @@
 	return g_value_get_boolean(&setting->value);
 }
 
-int
-purple_account_get_ui_int(PurpleAccount *account, const char *ui,
-						const char *name, int default_value)
-{
-	PurpleAccountSetting *setting;
-	PurpleAccountPrivate *priv;
-	GHashTable *table;
-
-	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value);
-	g_return_val_if_fail(ui      != NULL, default_value);
-	g_return_val_if_fail(name    != NULL, default_value);
-
-	priv = purple_account_get_instance_private(account);
-
-	if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL)
-		return default_value;
-
-	if ((setting = g_hash_table_lookup(table, name)) == NULL)
-		return default_value;
-
-	g_return_val_if_fail(G_VALUE_HOLDS_INT(&setting->value), default_value);
-
-	return g_value_get_int(&setting->value);
-}
-
-const char *
-purple_account_get_ui_string(PurpleAccount *account, const char *ui,
-						   const char *name, const char *default_value)
-{
-	PurpleAccountSetting *setting;
-	PurpleAccountPrivate *priv;
-	GHashTable *table;
-
-	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value);
-	g_return_val_if_fail(ui      != NULL, default_value);
-	g_return_val_if_fail(name    != NULL, default_value);
-
-	priv = purple_account_get_instance_private(account);
-
-	if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL)
-		return default_value;
-
-	if ((setting = g_hash_table_lookup(table, name)) == NULL)
-		return default_value;
-
-	g_return_val_if_fail(G_VALUE_HOLDS_STRING(&setting->value), default_value);
-
-	return g_value_get_string(&setting->value);
-}
-
-gboolean
-purple_account_get_ui_bool(PurpleAccount *account, const char *ui,
-						 const char *name, gboolean default_value)
-{
-	PurpleAccountSetting *setting;
-	PurpleAccountPrivate *priv;
-	GHashTable *table;
-
-	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), default_value);
-	g_return_val_if_fail(ui      != NULL, default_value);
-	g_return_val_if_fail(name    != NULL, default_value);
-
-	priv = purple_account_get_instance_private(account);
-
-	if ((table = g_hash_table_lookup(priv->ui_settings, ui)) == NULL)
-		return default_value;
-
-	if ((setting = g_hash_table_lookup(table, name)) == NULL)
-		return default_value;
-
-	g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(&setting->value), default_value);
-
-	return g_value_get_boolean(&setting->value);
-}
-
 void
 purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy, const char *message)
 {
diff --git a/libpurple/accounts.c b/libpurple/accounts.c
--- a/libpurple/accounts.c
+++ b/libpurple/accounts.c
@@ -128,12 +128,8 @@
 static void
 parse_settings(PurpleXmlNode *node, PurpleAccount *account)
 {
-	const char *ui;
 	PurpleXmlNode *child;
 
-	/* Get the UI string, if these are UI settings */
-	ui = purple_xmlnode_get_attrib(node, "ui");
-
 	/* Read settings, one by one */
 	for (child = purple_xmlnode_get_child(node, "setting"); child != NULL;
 			child = purple_xmlnode_get_next_twin(child))
@@ -167,24 +163,13 @@
 			/* Ignore this setting */
 			continue;
 
-		if (ui == NULL)
-		{
-			if (type == PURPLE_PREF_STRING)
-				purple_account_set_string(account, name, data);
-			else if (type == PURPLE_PREF_INT)
-				purple_account_set_int(account, name, atoi(data));
-			else if (type == PURPLE_PREF_BOOLEAN)
-				purple_account_set_bool(account, name,
-									  (*data == '0' ? FALSE : TRUE));
-		} else {
-			if (type == PURPLE_PREF_STRING)
-				purple_account_set_ui_string(account, ui, name, data);
-			else if (type == PURPLE_PREF_INT)
-				purple_account_set_ui_int(account, ui, name, atoi(data));
-			else if (type == PURPLE_PREF_BOOLEAN)
-				purple_account_set_ui_bool(account, ui, name,
-										 (*data == '0' ? FALSE : TRUE));
-		}
+		if (type == PURPLE_PREF_STRING)
+			purple_account_set_string(account, name, data);
+		else if (type == PURPLE_PREF_INT)
+			purple_account_set_int(account, name, atoi(data));
+		else if (type == PURPLE_PREF_BOOLEAN)
+			purple_account_set_bool(account, name,
+								  (*data == '0' ? FALSE : TRUE));
 
 		g_free(data);
 	}
