summaryrefslogtreecommitdiff
path: root/migrate
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2010-02-26 14:08:30 +0100
committerNick Schermer <nick@xfce.org>2010-02-26 14:11:53 +0100
commit5a60c49814c329f229755c986645d269c60abb4f (patch)
tree311314c9d7c1f65035d10666f59fd0cafcce351b /migrate
parentc4afba0c0265dfc0b4ea7ec481b8402e4062437b (diff)
Make migration work with custom channel names.
Diffstat (limited to 'migrate')
-rw-r--r--migrate/migrate-46.c64
-rw-r--r--migrate/migrate-default.c10
2 files changed, 26 insertions, 48 deletions
diff --git a/migrate/migrate-46.c b/migrate/migrate-46.c
index 2a65d377..80508610 100644
--- a/migrate/migrate-46.c
+++ b/migrate/migrate-46.c
@@ -31,10 +31,10 @@
#include <xfconf/xfconf.h>
#include <libxfce4util/libxfce4util.h>
#include <migrate/migrate-46.h>
+#include <libxfce4panel/xfce-panel-macros.h>
-#define CHANNEL_NAME "xfce4-panel"
#define LAUNCHER_FOLDER "launcher"
@@ -75,58 +75,28 @@ typedef enum
}
SnapPosition;
-typedef enum
-{
- XFCE_SCREEN_POSITION_NONE,
-
- /* top */
- XFCE_SCREEN_POSITION_NW_H, /* North West Horizontal */
- XFCE_SCREEN_POSITION_N, /* North */
- XFCE_SCREEN_POSITION_NE_H, /* North East Horizontal */
-
- /* left */
- XFCE_SCREEN_POSITION_NW_V, /* North West Vertical */
- XFCE_SCREEN_POSITION_W, /* West */
- XFCE_SCREEN_POSITION_SW_V, /* South West Vertical */
-
- /* right */
- XFCE_SCREEN_POSITION_NE_V, /* North East Vertical */
- XFCE_SCREEN_POSITION_E, /* East */
- XFCE_SCREEN_POSITION_SE_V, /* South East Vertical */
-
- /* bottom */
- XFCE_SCREEN_POSITION_SW_H, /* South West Horizontal */
- XFCE_SCREEN_POSITION_S, /* South */
- XFCE_SCREEN_POSITION_SE_H, /* South East Horizontal */
-
- /* floating */
- XFCE_SCREEN_POSITION_FLOATING_H, /* Floating Horizontal */
- XFCE_SCREEN_POSITION_FLOATING_V /* Floating Vertical */
-}
-ScreenPosition;
-
typedef struct
{
- ParserState state;
- guint plugin_id_counter;
- guint panel_id_counter;
- XfconfChannel *channel;
-
- GPtrArray *panel_plugin_ids;
- gint panel_yoffset;
- gint panel_xoffset;
- ScreenPosition panel_screen_position;
- guint panel_transparency;
- gboolean panel_activetrans;
+ ParserState state;
+ guint plugin_id_counter;
+ guint panel_id_counter;
+ XfconfChannel *channel;
+
+ GPtrArray *panel_plugin_ids;
+ gint panel_yoffset;
+ gint panel_xoffset;
+ XfceScreenPosition panel_screen_position;
+ guint panel_transparency;
+ gboolean panel_activetrans;
}
ConfigParser;
static void
-migrate_46_panel_screen_position (ScreenPosition screen_position,
- SnapPosition *snap_position,
- gboolean *horizontal)
+migrate_46_panel_screen_position (XfceScreenPosition screen_position,
+ SnapPosition *snap_position,
+ gboolean *horizontal)
{
/* defaults */
*horizontal = FALSE;
@@ -602,7 +572,7 @@ migrate_46_panel_add_plugin (ConfigParser *parser,
/* open a panel with the propert base for the plugin */
g_snprintf (base, sizeof (base), "/plugins/plugin-%d", parser->plugin_id_counter);
- channel = xfconf_channel_new_with_property_base (CHANNEL_NAME, base);
+ channel = xfconf_channel_new_with_property_base (XFCE_PANEL_CHANNEL_NAME, base);
if (strcmp (name, "actions") == 0)
{
@@ -903,7 +873,7 @@ migrate_46 (const gchar *filename,
parser->state = START;
parser->plugin_id_counter = 0;
parser->panel_id_counter = 0;
- parser->channel = xfconf_channel_new (CHANNEL_NAME);
+ parser->channel = xfconf_channel_new (XFCE_PANEL_CHANNEL_NAME);
context = g_markup_parse_context_new (&markup_parser, 0, parser, NULL);
diff --git a/migrate/migrate-default.c b/migrate/migrate-default.c
index ee6f8c7c..1c59d4cc 100644
--- a/migrate/migrate-default.c
+++ b/migrate/migrate-default.c
@@ -31,6 +31,8 @@
#include <xfconf/xfconf.h>
#include <libxfce4util/libxfce4util.h>
#include <migrate/migrate-default.h>
+#include <libxfce4panel/xfce-panel-macros.h>
+
typedef struct
@@ -143,7 +145,13 @@ migrate_default_start_element_handler (GMarkupParseContext *context,
for (i = 0; attribute_names[i] != NULL; i++)
{
if (strcmp (attribute_names[i], "name") == 0)
- channel_name = attribute_values[i];
+ {
+ channel_name = attribute_values[i];
+
+ /* this is an xfce4-panel workaround to make it work
+ * with the custom channel names */
+ channel_name = XFCE_PANEL_CHANNEL_NAME;
+ }
}
}