summaryrefslogtreecommitdiff
path: root/migrate
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2011-12-10 15:24:33 +0100
committerNick Schermer <nick@xfce.org>2011-12-24 13:07:36 +0100
commit96baf38570437374795eb2d7e3983adf54df02bd (patch)
tree6d8a23659eecbca093fa76666bce22a1e9d006a1 /migrate
parentbe15b49f892c7799091b7996d484fbf6f9acc048 (diff)
Add deskbar mode and nrows property to plugins.
Instead of the horizontal property, there is now a mode property with 3 values. The orientation communication has been completely removed, only the properties exist. Properly migrate the orientation property. Plugins and the panel should not act any different with this commit.
Diffstat (limited to 'migrate')
-rw-r--r--migrate/migrate-config.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/migrate/migrate-config.c b/migrate/migrate-config.c
index 2bce672e..367e7e47 100644
--- a/migrate/migrate-config.c
+++ b/migrate/migrate-config.c
@@ -117,7 +117,6 @@ migrate_config_action_48 (gpointer key,
gint first_action;
gint second_action;
-
/* skip non root plugin properties */
if (!G_VALUE_HOLDS_STRING (gvalue)
|| migrate_config_strchr_count (prop, G_DIR_SEPARATOR) != 2
@@ -167,6 +166,9 @@ migrate_config (XfconfChannel *channel,
GError **error)
{
GHashTable *plugins;
+ guint n, n_panels;
+ gchar buf[50];
+ gboolean horizontal;
plugins = xfconf_channel_get_properties (channel, "/plugins");
@@ -180,5 +182,24 @@ migrate_config (XfconfChannel *channel,
g_hash_table_foreach (plugins, migrate_config_action_48, channel);
}
+ /* migrate horizontal to mode property */
+ if (configver < 2)
+ {
+ n_panels = xfconf_channel_get_uint (channel, "/panels", 0);
+ for (n = 0; n < n_panels; n++)
+ {
+ /* read and remove old property */
+ g_snprintf (buf, sizeof (buf), "/panels/panel-%u/horizontal", n);
+ horizontal = xfconf_channel_get_bool (channel, buf, TRUE);
+ xfconf_channel_reset_property (channel, buf, FALSE);
+
+ /* set new mode */
+ g_snprintf (buf, sizeof (buf), "/panels/panel-%u/mode", n);
+ xfconf_channel_set_uint (channel, buf, horizontal ? 0 : 1);
+ }
+ }
+
+ g_hash_table_destroy (plugins);
+
return TRUE;
}