Browse Source

Make the value array type shared.

upstream/xfce4-panel-4.10.1
Nick Schermer 13 years ago
parent
commit
97d4b70af5
  1. 19
      common/panel-xfconf.c
  2. 18
      common/panel-xfconf.h
  3. 6
      plugins/launcher/launcher.c

19
common/panel-xfconf.c

@ -20,6 +20,8 @@
#include <config.h>
#endif
#include <dbus/dbus-glib.h>
#include <common/panel-private.h>
#include <common/panel-xfconf.h>
#include <libxfce4panel/xfce-panel-macros.h>
@ -120,3 +122,20 @@ panel_properties_unbind (GObject *object)
{
xfconf_g_property_unbind_all (object);
}
GType
panel_properties_value_array_get_type (void)
{
static volatile gsize type__volatile = 0;
GType type;
if (g_once_init_enter (&type__volatile))
{
type = dbus_g_type_get_collection ("GPtrArray", G_TYPE_VALUE);
g_once_init_leave (&type__volatile, type);
}
return type__volatile;
}

18
common/panel-xfconf.h

@ -21,6 +21,8 @@
#include <xfconf/xfconf.h>
#define PANEL_PROPERTIES_TYPE_VALUE_ARRAY (panel_properties_value_array_get_type ())
typedef struct _PanelProperty PanelProperty;
@ -32,14 +34,16 @@ struct _PanelProperty
XfconfChannel *panel_properties_get_channel (GObject *object_for_weak_ref);
XfconfChannel *panel_properties_get_channel (GObject *object_for_weak_ref);
void panel_properties_bind (XfconfChannel *channel,
GObject *object,
const gchar *property_base,
const PanelProperty *properties,
gboolean save_properties);
void panel_properties_bind (XfconfChannel *channel,
GObject *object,
const gchar *property_base,
const PanelProperty *properties,
gboolean save_properties);
void panel_properties_unbind (GObject *object);
void panel_properties_unbind (GObject *object);
GType panel_properties_value_array_get_type (void) G_GNUC_CONST;
#endif /* !__PANEL_XFCONF_H__ */

6
plugins/launcher/launcher.c

@ -25,7 +25,6 @@
#endif
#include <exo/exo.h>
#include <dbus/dbus-glib.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
#include <garcon/garcon.h>
@ -44,7 +43,6 @@
#define NO_ARROW_INSIDE_BUTTON(plugin) ((plugin)->arrow_position != LAUNCHER_ARROW_INTERNAL \
|| LIST_HAS_ONE_OR_NO_ENTRIES ((plugin)->items))
#define ARROW_INSIDE_BUTTON(plugin) (!NO_ARROW_INSIDE_BUTTON (plugin))
#define LAUNCHER_TYPE_PTR_ARRAY (dbus_g_type_get_collection("GPtrArray", G_TYPE_VALUE))
#define RELATIVE_CONFIG_PATH PANEL_PLUGIN_RELATIVE_PATH G_DIR_SEPARATOR_S "%s-%d"
@ -273,7 +271,7 @@ launcher_plugin_class_init (LauncherPluginClass *klass)
PROP_ITEMS,
g_param_spec_boxed ("items",
NULL, NULL,
LAUNCHER_TYPE_PTR_ARRAY,
PANEL_PROPERTIES_TYPE_VALUE_ARRAY,
EXO_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
@ -941,7 +939,7 @@ launcher_plugin_construct (XfcePanelPlugin *panel_plugin)
const PanelProperty properties[] =
{
{ "show-label", G_TYPE_BOOLEAN },
{ "items", LAUNCHER_TYPE_PTR_ARRAY },
{ "items", PANEL_PROPERTIES_TYPE_VALUE_ARRAY },
{ "disable-tooltips", G_TYPE_BOOLEAN },
{ "move-first", G_TYPE_BOOLEAN },
{ "arrow-position", G_TYPE_UINT },

Loading…
Cancel
Save