[network-manager-applet] Revert "applet: migrate preferences from GConf to GSettings"



commit 2e0632022891846f295601306a99c27937dbb056
Author: Dan Williams <dcbw redhat com>
Date:   Fri Jul 27 00:12:43 2012 -0500

    Revert "applet: migrate preferences from GConf to GSettings"
    
    This reverts commit 7863ecb8e6e994477d3ae4230cb86ca39f5286ca.
    
    nm-applet.convert and GSettings do this for us; for some reason I
    thought they didn't because it didn't happen on a test system.
    But retesting, it seems to work, so we don't need the manual code.

 src/gconf-helpers/gconf-helpers.c |    2 +
 src/gconf-helpers/gconf-helpers.h |    1 -
 src/migration-tool.c              |   56 -------------------------------------
 3 files changed, 2 insertions(+), 57 deletions(-)
---
diff --git a/src/gconf-helpers/gconf-helpers.c b/src/gconf-helpers/gconf-helpers.c
index 7df5015..c244671 100644
--- a/src/gconf-helpers/gconf-helpers.c
+++ b/src/gconf-helpers/gconf-helpers.c
@@ -75,6 +75,8 @@
 #define DBUS_TYPE_G_IP6_ROUTE               (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID))
 #define DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE      (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ROUTE))
 
+#define APPLET_PREFS_PATH "/apps/nm-applet"
+
 /* The stamp is a mechanism for determining which applet version last
  * updated GConf for various GConf update tasks in newer applet versions.
  */
diff --git a/src/gconf-helpers/gconf-helpers.h b/src/gconf-helpers/gconf-helpers.h
index 0833c7b..2a1aca0 100644
--- a/src/gconf-helpers/gconf-helpers.h
+++ b/src/gconf-helpers/gconf-helpers.h
@@ -30,7 +30,6 @@
 #include "utils.h"
 
 #define GCONF_PATH_CONNECTIONS "/system/networking/connections"
-#define APPLET_PREFS_PATH "/apps/nm-applet"
 
 #define KEYRING_UUID_TAG "connection-uuid"
 #define KEYRING_SN_TAG "setting-name"
diff --git a/src/migration-tool.c b/src/migration-tool.c
index 903eb43..f7e44ad 100644
--- a/src/migration-tool.c
+++ b/src/migration-tool.c
@@ -29,7 +29,6 @@
 #include <nm-remote-settings.h>
 
 #include "gconf-helpers.h"
-#include "applet.h"
 
 gboolean success = TRUE;
 
@@ -63,59 +62,6 @@ import_cb (NMConnection *connection, gpointer user_data)
 	}
 }
 
-#define GC_PREF_DISABLE_CONNECTED_NOTIFICATIONS      APPLET_PREFS_PATH "/disable-connected-notifications"
-#define GC_PREF_DISABLE_DISCONNECTED_NOTIFICATIONS   APPLET_PREFS_PATH "/disable-disconnected-notifications"
-#define GC_PREF_DISABLE_VPN_NOTIFICATIONS            APPLET_PREFS_PATH "/disable-vpn-notifications"
-#define GC_PREF_DISABLE_WIFI_CREATE                  APPLET_PREFS_PATH "/disable-wifi-create"
-#define GC_PREF_SUPPRESS_WIRELESS_NETWORKS_AVAILABLE APPLET_PREFS_PATH "/suppress-wireless-networks-available"
-
-typedef struct {
-	const char *gc_path;
-	const char *gs_name;
-} Items;
-
-static const Items convert[] = {
-	{ GC_PREF_DISABLE_CONNECTED_NOTIFICATIONS,      PREF_DISABLE_CONNECTED_NOTIFICATIONS },
-	{ GC_PREF_DISABLE_DISCONNECTED_NOTIFICATIONS,   PREF_DISABLE_DISCONNECTED_NOTIFICATIONS },
-	{ GC_PREF_DISABLE_VPN_NOTIFICATIONS,            PREF_DISABLE_VPN_NOTIFICATIONS },
-	{ GC_PREF_DISABLE_WIFI_CREATE,                  PREF_DISABLE_WIFI_CREATE },
-	{ GC_PREF_SUPPRESS_WIRELESS_NETWORKS_AVAILABLE, PREF_SUPPRESS_WIRELESS_NETWORKS_AVAILABLE },
-};
-
-static void
-convert_prefs (void)
-{
-	GSettings *gs;
-	GConfClient *gc;
-	int stamp;
-	gboolean b;
-	GError *error = NULL;
-	guint i;
-
-	gc = gconf_client_get_default ();
-	if (!gc)
-		return;
-
-	gs = g_settings_new (APPLET_PREFS_SCHEMA);
-	g_assert (gs);
-	stamp = g_settings_get_int (gs, "stamp");
-	if (stamp == 0) {
-		for (i = 0; i < G_N_ELEMENTS (convert); i++) {
-			b = gconf_client_get_bool (gc, convert[i].gc_path, &error);
-			if (!error)
-				g_settings_set_boolean (gs, convert[i].gs_name, b);
-			g_clear_error (&error);
-		}
-
-		/* stamps start back at 1 with GSettings */
-		g_settings_set_int (gs, "stamp", 1);
-		g_settings_sync ();
-	}
-
-	g_object_unref (gc);
-	g_object_unref (gs);
-}
-
 int
 main (int argc, char **argv)
 {
@@ -147,8 +93,6 @@ main (int argc, char **argv)
 	g_object_unref (settings);
 	dbus_g_connection_unref (bus);
 
-	convert_prefs ();
-
 	return success ? 0 : 1;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]