Browse Source

Allow custom names for the Xfconf channel.

You can override the default Xfconf channel name with
the XFCE_PANEL_CHANNEL_NAME environment variable. Also
rename the macro to a more suitable name.
upstream/xfce4-panel-4.10.1
Nick Schermer 13 years ago
parent
commit
c4afba0c02
  1. 2
      common/panel-xfconf.c
  2. 2
      docs/references/libxfce4panel-sections.txt
  3. 12
      libxfce4panel/xfce-panel-macros.h

2
common/panel-xfconf.c

@ -74,7 +74,7 @@ panel_properties_get_channel (GObject *object_for_weak_ref)
return NULL;
}
channel = xfconf_channel_get (XFCE_PANEL_PLUGIN_CHANNEL_NAME);
channel = xfconf_channel_get (XFCE_PANEL_CHANNEL_NAME);
g_object_weak_ref (object_for_weak_ref, (GWeakNotify) xfconf_shutdown, NULL);
return channel;

2
docs/references/libxfce4panel-sections.txt

@ -85,7 +85,7 @@ xfce_panel_image_get_type
<SECTION>
<FILE>xfce-panel-macros</FILE>
<TITLE>Panel Plugin Macros</TITLE>
XFCE_PANEL_PLUGIN_CHANNEL_NAME
XFCE_PANEL_CHANNEL_NAME
xfce_panel_plugin_xfconf_channel_new
XFCE_PANEL_DEFINE_PLUGIN
XFCE_PANEL_DEFINE_PLUGIN_RESIDENT

12
libxfce4panel/xfce-panel-macros.h

@ -56,16 +56,20 @@ typedef GTypeModule XfcePanelTypeModule;
/**
* XFCE_PANEL_PLUGIN_CHANNEL_NAME:
* XFCE_PANEL_CHANNEL_NAME:
*
* Macro for the name of the Xfconf channel used by the panel.
* Macro for the name of the Xfconf channel used by the panel. By default
* this returns "xfce4-panel", but you can override this value with the
* environment variable XFCE_PANEL_CHANNEL_NAME.
*
* See also: xfce_panel_plugin_xfconf_channel_new,
* xfce_panel_plugin_get_property_base
*
* Since: 4.8.0
**/
#define XFCE_PANEL_PLUGIN_CHANNEL_NAME ("xfce4-panel")
#define XFCE_PANEL_CHANNEL_NAME \
(G_LIKELY (g_getenv ("XFCE_PANEL_CHANNEL_NAME") == NULL) ? \
"xfce4-panel" : g_getenv ("XFCE_PANEL_CHANNEL_NAME"))
@ -83,7 +87,7 @@ typedef GTypeModule XfcePanelTypeModule;
* Since: 4.8.0
**/
#define xfce_panel_plugin_xfconf_channel_new(plugin) \
xfconf_channel_new_with_property_base (XFCE_PANEL_PLUGIN_CHANNEL_NAME, \
xfconf_channel_new_with_property_base (XFCE_PANEL_CHANNEL_NAME, \
xfce_panel_plugin_get_property_base (XFCE_PANEL_PLUGIN (plugin)))

Loading…
Cancel
Save