[gnome-panel/wip/3.0-freeze-break] panel: Add forgotten _KEY suffixes to defines



commit c8546f5e71a563e21e8a7dc13818669eecbd017d
Author: Vincent Untz <vuntz gnome org>
Date:   Fri Mar 25 04:19:07 2011 +0100

    panel: Add forgotten _KEY suffixes to defines
    
    Also remove a duplicate g_settings_bind() call in panel-toplevel.c

 gnome-panel/panel-layout.c   |   56 +++++++++++++++++++++---------------------
 gnome-panel/panel-schemas.h  |   44 ++++++++++++++++----------------
 gnome-panel/panel-toplevel.c |   44 ++++++++++++++------------------
 3 files changed, 69 insertions(+), 75 deletions(-)
---
diff --git a/gnome-panel/panel-layout.c b/gnome-panel/panel-layout.c
index f2a87d9..99a8cf2 100644
--- a/gnome-panel/panel-layout.c
+++ b/gnome-panel/panel-layout.c
@@ -78,25 +78,25 @@ typedef struct {
 } PanelLayoutKeyDefinition;
 
 static PanelLayoutKeyDefinition panel_layout_toplevel_keys[] = {
-        { PANEL_TOPLEVEL_NAME,            G_TYPE_STRING   },
-        { PANEL_TOPLEVEL_SCREEN,          G_TYPE_INT      },
-        { PANEL_TOPLEVEL_MONITOR,         G_TYPE_INT      },
-        { PANEL_TOPLEVEL_EXPAND,          G_TYPE_BOOLEAN  },
-        { PANEL_TOPLEVEL_ORIENTATION,     G_TYPE_STRING   },
-        { PANEL_TOPLEVEL_SIZE,            G_TYPE_INT      },
-        { PANEL_TOPLEVEL_X,               G_TYPE_INT      },
-        { PANEL_TOPLEVEL_Y,               G_TYPE_INT      },
-        { PANEL_TOPLEVEL_X_RIGHT,         G_TYPE_INT      },
-        { PANEL_TOPLEVEL_Y_BOTTOM,        G_TYPE_INT      },
-        { PANEL_TOPLEVEL_X_CENTERED,      G_TYPE_BOOLEAN  },
-        { PANEL_TOPLEVEL_Y_CENTERED,      G_TYPE_BOOLEAN  },
-        { PANEL_TOPLEVEL_AUTO_HIDE,       G_TYPE_BOOLEAN  },
-        { PANEL_TOPLEVEL_ENABLE_BUTTONS,  G_TYPE_BOOLEAN  },
-        { PANEL_TOPLEVEL_ENABLE_ARROWS,   G_TYPE_BOOLEAN  },
-        { PANEL_TOPLEVEL_HIDE_DELAY,      G_TYPE_INT      },
-        { PANEL_TOPLEVEL_UNHIDE_DELAY,    G_TYPE_INT      },
-        { PANEL_TOPLEVEL_AUTO_HIDE_SIZE,  G_TYPE_INT      },
-        { PANEL_TOPLEVEL_ANIMATION_SPEED, G_TYPE_STRING   }
+        { PANEL_TOPLEVEL_NAME_KEY,            G_TYPE_STRING   },
+        { PANEL_TOPLEVEL_SCREEN_KEY,          G_TYPE_INT      },
+        { PANEL_TOPLEVEL_MONITOR_KEY,         G_TYPE_INT      },
+        { PANEL_TOPLEVEL_EXPAND_KEY,          G_TYPE_BOOLEAN  },
+        { PANEL_TOPLEVEL_ORIENTATION_KEY,     G_TYPE_STRING   },
+        { PANEL_TOPLEVEL_SIZE_KEY,            G_TYPE_INT      },
+        { PANEL_TOPLEVEL_X_KEY,               G_TYPE_INT      },
+        { PANEL_TOPLEVEL_Y_KEY,               G_TYPE_INT      },
+        { PANEL_TOPLEVEL_X_RIGHT_KEY,         G_TYPE_INT      },
+        { PANEL_TOPLEVEL_Y_BOTTOM_KEY,        G_TYPE_INT      },
+        { PANEL_TOPLEVEL_X_CENTERED_KEY,      G_TYPE_BOOLEAN  },
+        { PANEL_TOPLEVEL_Y_CENTERED_KEY,      G_TYPE_BOOLEAN  },
+        { PANEL_TOPLEVEL_AUTO_HIDE_KEY,       G_TYPE_BOOLEAN  },
+        { PANEL_TOPLEVEL_ENABLE_BUTTONS_KEY,  G_TYPE_BOOLEAN  },
+        { PANEL_TOPLEVEL_ENABLE_ARROWS_KEY,   G_TYPE_BOOLEAN  },
+        { PANEL_TOPLEVEL_HIDE_DELAY_KEY,      G_TYPE_INT      },
+        { PANEL_TOPLEVEL_UNHIDE_DELAY_KEY,    G_TYPE_INT      },
+        { PANEL_TOPLEVEL_AUTO_HIDE_SIZE_KEY,  G_TYPE_INT      },
+        { PANEL_TOPLEVEL_ANIMATION_SPEED_KEY, G_TYPE_STRING   }
 };
 
 static PanelLayoutKeyDefinition panel_layout_object_keys[] = {
@@ -399,7 +399,7 @@ panel_layout_append_group_helper (GKeyFile                  *keyfile,
                 if (set_screen_to != -1 &&
                     g_strcmp0 (schema, PANEL_TOPLEVEL_SCHEMA) == 0)
                         g_settings_set_int (settings,
-                                            PANEL_TOPLEVEL_SCREEN,
+                                            PANEL_TOPLEVEL_SCREEN_KEY,
                                             set_screen_to);
 
                 panel_gsettings_append_strv (layout_settings,
@@ -435,7 +435,7 @@ panel_layout_append_group (GKeyFile    *keyfile,
                                         keyfile, group,
                                         screen_for_toplevels,
                                         "Toplevel",
-                                        PANEL_LAYOUT_TOPLEVEL_ID_LIST,
+                                        PANEL_LAYOUT_TOPLEVEL_ID_LIST_KEY,
                                         PANEL_TOPLEVEL_SCHEMA,
                                         PANEL_LAYOUT_TOPLEVEL_PATH,
                                         PANEL_LAYOUT_TOPLEVEL_DEFAULT_PREFIX,
@@ -448,7 +448,7 @@ panel_layout_append_group (GKeyFile    *keyfile,
                                         keyfile, group,
                                         -1,
                                         "Object",
-                                        PANEL_LAYOUT_OBJECT_ID_LIST,
+                                        PANEL_LAYOUT_OBJECT_ID_LIST_KEY,
                                         PANEL_OBJECT_SCHEMA,
                                         PANEL_LAYOUT_OBJECT_PATH,
                                         PANEL_LAYOUT_OBJECT_DEFAULT_PREFIX,
@@ -562,7 +562,7 @@ panel_layout_load_toplevel (const char *toplevel_id)
 
         /* Check that the screen is valid */
         settings = g_settings_new_with_path (PANEL_TOPLEVEL_SCHEMA, path);
-        screen = g_settings_get_int (settings, PANEL_TOPLEVEL_SCREEN);
+        screen = g_settings_get_int (settings, PANEL_TOPLEVEL_SCREEN_KEY);
         g_object_unref (settings);
 
         if (screen < 0 || screen >= panel_multiscreen_screens ()) {
@@ -652,7 +652,7 @@ panel_layout_load (void)
         panel_layout_init ();
 
         toplevels = g_settings_get_strv (layout_settings,
-                                         PANEL_LAYOUT_TOPLEVEL_ID_LIST);
+                                         PANEL_LAYOUT_TOPLEVEL_ID_LIST_KEY);
 
         if (!toplevels[0]) {
                 char *default_layout_file;
@@ -660,9 +660,9 @@ panel_layout_load (void)
                 g_strfreev (toplevels);
 
                 if (!g_settings_is_writable (layout_settings,
-                                             PANEL_LAYOUT_TOPLEVEL_ID_LIST) ||
+                                             PANEL_LAYOUT_TOPLEVEL_ID_LIST_KEY) ||
                     !g_settings_is_writable (layout_settings,
-                                             PANEL_LAYOUT_OBJECT_ID_LIST)) {
+                                             PANEL_LAYOUT_OBJECT_ID_LIST_KEY)) {
                         g_printerr (_("Cannot create initial panel layout.\n"));
 
                         return FALSE;
@@ -673,7 +673,7 @@ panel_layout_load (void)
                 g_free (default_layout_file);
 
                 toplevels = g_settings_get_strv (layout_settings,
-                                                 PANEL_LAYOUT_TOPLEVEL_ID_LIST);
+                                                 PANEL_LAYOUT_TOPLEVEL_ID_LIST_KEY);
 
                 if (!toplevels[0]) {
                         g_strfreev (toplevels);
@@ -689,7 +689,7 @@ panel_layout_load (void)
         g_strfreev (toplevels);
 
         objects = g_settings_get_strv (layout_settings,
-                                       PANEL_LAYOUT_OBJECT_ID_LIST);
+                                       PANEL_LAYOUT_OBJECT_ID_LIST_KEY);
 
         for (i = 0; objects[i] != NULL; i++)
                 panel_layout_load_object (objects[i]);
diff --git a/gnome-panel/panel-schemas.h b/gnome-panel/panel-schemas.h
index 27a6884..4c8c211 100644
--- a/gnome-panel/panel-schemas.h
+++ b/gnome-panel/panel-schemas.h
@@ -22,8 +22,8 @@
 #define PANEL_RUN_SHOW_LIST_KEY          "show-program-list"
 
 #define PANEL_LAYOUT_SCHEMA               "org.gnome.gnome-panel.layout"
-#define PANEL_LAYOUT_TOPLEVEL_ID_LIST     "toplevel-id-list"
-#define PANEL_LAYOUT_OBJECT_ID_LIST       "object-id-list"
+#define PANEL_LAYOUT_TOPLEVEL_ID_LIST_KEY "toplevel-id-list"
+#define PANEL_LAYOUT_OBJECT_ID_LIST_KEY   "object-id-list"
 
 #define PANEL_LAYOUT_TOPLEVEL_PATH           "/org/gnome/gnome-panel/layout/toplevels/"
 #define PANEL_LAYOUT_TOPLEVEL_DEFAULT_PREFIX "toplevel"
@@ -31,26 +31,26 @@
 #define PANEL_LAYOUT_OBJECT_DEFAULT_PREFIX   "object"
 #define PANEL_LAYOUT_OBJECT_CONFIG_SUFFIX    "/instance-config/"
 
-#define PANEL_TOPLEVEL_SCHEMA           "org.gnome.gnome-panel.toplevel"
-#define PANEL_TOPLEVEL_NAME             "name"
-#define PANEL_TOPLEVEL_SCREEN           "screen"
-#define PANEL_TOPLEVEL_MONITOR          "monitor"
-#define PANEL_TOPLEVEL_EXPAND           "expand"
-#define PANEL_TOPLEVEL_ORIENTATION      "orientation"
-#define PANEL_TOPLEVEL_SIZE             "size"
-#define PANEL_TOPLEVEL_X                "x"
-#define PANEL_TOPLEVEL_Y                "y"
-#define PANEL_TOPLEVEL_X_RIGHT          "x-right"
-#define PANEL_TOPLEVEL_Y_BOTTOM         "y-bottom"
-#define PANEL_TOPLEVEL_X_CENTERED       "x-centered"
-#define PANEL_TOPLEVEL_Y_CENTERED       "y-centered"
-#define PANEL_TOPLEVEL_AUTO_HIDE        "auto-hide"
-#define PANEL_TOPLEVEL_ENABLE_BUTTONS   "enable-buttons"
-#define PANEL_TOPLEVEL_ENABLE_ARROWS    "enable-arrows"
-#define PANEL_TOPLEVEL_HIDE_DELAY       "hide-delay"
-#define PANEL_TOPLEVEL_UNHIDE_DELAY     "unhide-delay"
-#define PANEL_TOPLEVEL_AUTO_HIDE_SIZE   "auto-hide-size"
-#define PANEL_TOPLEVEL_ANIMATION_SPEED  "animation-speed"
+#define PANEL_TOPLEVEL_SCHEMA               "org.gnome.gnome-panel.toplevel"
+#define PANEL_TOPLEVEL_NAME_KEY             "name"
+#define PANEL_TOPLEVEL_SCREEN_KEY           "screen"
+#define PANEL_TOPLEVEL_MONITOR_KEY          "monitor"
+#define PANEL_TOPLEVEL_EXPAND_KEY           "expand"
+#define PANEL_TOPLEVEL_ORIENTATION_KEY      "orientation"
+#define PANEL_TOPLEVEL_SIZE_KEY             "size"
+#define PANEL_TOPLEVEL_X_KEY                "x"
+#define PANEL_TOPLEVEL_Y_KEY                "y"
+#define PANEL_TOPLEVEL_X_RIGHT_KEY          "x-right"
+#define PANEL_TOPLEVEL_Y_BOTTOM_KEY         "y-bottom"
+#define PANEL_TOPLEVEL_X_CENTERED_KEY       "x-centered"
+#define PANEL_TOPLEVEL_Y_CENTERED_KEY       "y-centered"
+#define PANEL_TOPLEVEL_AUTO_HIDE_KEY        "auto-hide"
+#define PANEL_TOPLEVEL_ENABLE_BUTTONS_KEY   "enable-buttons"
+#define PANEL_TOPLEVEL_ENABLE_ARROWS_KEY    "enable-arrows"
+#define PANEL_TOPLEVEL_HIDE_DELAY_KEY       "hide-delay"
+#define PANEL_TOPLEVEL_UNHIDE_DELAY_KEY     "unhide-delay"
+#define PANEL_TOPLEVEL_AUTO_HIDE_SIZE_KEY   "auto-hide-size"
+#define PANEL_TOPLEVEL_ANIMATION_SPEED_KEY  "animation-speed"
 
 #define PANEL_BACKGROUND_SCHEMA_CHILD   "background"
 #define PANEL_BACKGROUND_TYPE_KEY       "type"
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index fa57668..641f74b 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -4358,55 +4358,55 @@ panel_toplevel_bind_gsettings (PanelToplevel *toplevel)
 	/* Delayed settings: the ones related to the position */
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_MONITOR,
+			 PANEL_TOPLEVEL_MONITOR_KEY,
 			 toplevel,
 			 "monitor",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_SIZE,
+			 PANEL_TOPLEVEL_SIZE_KEY,
 			 toplevel,
 			 "size",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_ORIENTATION,
+			 PANEL_TOPLEVEL_ORIENTATION_KEY,
 			 toplevel,
 			 "orientation",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_X,
+			 PANEL_TOPLEVEL_X_KEY,
 			 toplevel,
 			 "x",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_X_RIGHT,
+			 PANEL_TOPLEVEL_X_RIGHT_KEY,
 			 toplevel,
 			 "x-right",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_X_CENTERED,
+			 PANEL_TOPLEVEL_X_CENTERED_KEY,
 			 toplevel,
 			 "x-centered",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_Y,
+			 PANEL_TOPLEVEL_Y_KEY,
 			 toplevel,
 			 "y",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_Y_BOTTOM,
+			 PANEL_TOPLEVEL_Y_BOTTOM_KEY,
 			 toplevel,
 			 "y-bottom",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->delayed_settings,
-			 PANEL_TOPLEVEL_Y_CENTERED,
+			 PANEL_TOPLEVEL_Y_CENTERED_KEY,
 			 toplevel,
 			 "y-centered",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
@@ -4414,7 +4414,7 @@ panel_toplevel_bind_gsettings (PanelToplevel *toplevel)
 	/* Normal settings */
 
 	g_settings_bind_with_mapping (toplevel->priv->settings,
-				      PANEL_TOPLEVEL_SCREEN,
+				      PANEL_TOPLEVEL_SCREEN_KEY,
 				      toplevel,
 				      "screen",
 				      G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY,
@@ -4423,64 +4423,58 @@ panel_toplevel_bind_gsettings (PanelToplevel *toplevel)
 				      toplevel, NULL);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_NAME,
+			 PANEL_TOPLEVEL_NAME_KEY,
 			 toplevel,
 			 "name",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_EXPAND,
+			 PANEL_TOPLEVEL_EXPAND_KEY,
 			 toplevel,
 			 "expand",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_AUTO_HIDE,
+			 PANEL_TOPLEVEL_AUTO_HIDE_KEY,
 			 toplevel,
 			 "auto-hide",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_HIDE_DELAY,
+			 PANEL_TOPLEVEL_HIDE_DELAY_KEY,
 			 toplevel,
 			 "hide-delay",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_UNHIDE_DELAY,
+			 PANEL_TOPLEVEL_UNHIDE_DELAY_KEY,
 			 toplevel,
 			 "unhide-delay",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_AUTO_HIDE_SIZE,
+			 PANEL_TOPLEVEL_AUTO_HIDE_SIZE_KEY,
 			 toplevel,
 			 "auto-hide-size",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_ANIMATION_SPEED,
+			 PANEL_TOPLEVEL_ANIMATION_SPEED_KEY,
 			 toplevel,
 			 "animation-speed",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_ENABLE_BUTTONS,
+			 PANEL_TOPLEVEL_ENABLE_BUTTONS_KEY,
 			 toplevel,
 			 "buttons-enabled",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 
 	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_ENABLE_ARROWS,
+			 PANEL_TOPLEVEL_ENABLE_ARROWS_KEY,
 			 toplevel,
 			 "arrows-enabled",
 			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
-
-	g_settings_bind (toplevel->priv->settings,
-			 PANEL_TOPLEVEL_NAME,
-			 toplevel,
-			 "name",
-			 G_SETTINGS_BIND_DEFAULT|G_SETTINGS_BIND_NO_SENSITIVITY);
 }
 
 static void



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