diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-02-03 14:39:34 +0100 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-02-03 14:39:34 +0100 |
commit | 001cd99d51b18ce30d2808e6209544336aadb4bc (patch) | |
tree | 42b529543d06166b484e57c79100fb190992f285 /src/indicator-printers.c | |
parent | 77e7554604917b07811added685043ede4fb2396 (diff) | |
download | ayatana-indicator-printers-001cd99d51b18ce30d2808e6209544336aadb4bc.tar.gz ayatana-indicator-printers-001cd99d51b18ce30d2808e6209544336aadb4bc.tar.bz2 ayatana-indicator-printers-001cd99d51b18ce30d2808e6209544336aadb4bc.zip |
Use priv member instead of calling g_type_instance_get_private repeatedly
Diffstat (limited to 'src/indicator-printers.c')
-rw-r--r-- | src/indicator-printers.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/indicator-printers.c b/src/indicator-printers.c index def019a..e9f9560 100644 --- a/src/indicator-printers.c +++ b/src/indicator-printers.c @@ -37,9 +37,6 @@ INDICATOR_SET_TYPE(INDICATOR_PRINTERS_TYPE) G_DEFINE_TYPE (IndicatorPrinters, indicator_printers, INDICATOR_OBJECT_TYPE) -#define INDICATOR_PRINTERS_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_PRINTERS_TYPE, IndicatorPrintersPrivate)) - struct _IndicatorPrintersPrivate { @@ -50,9 +47,9 @@ struct _IndicatorPrintersPrivate static void dispose (GObject *object) { - IndicatorPrintersPrivate *priv = INDICATOR_PRINTERS_GET_PRIVATE (object); - g_clear_object (&priv->entry.menu); - g_clear_object (&priv->entry.image); + IndicatorPrinters *self = INDICATOR_PRINTERS (object); + g_clear_object (&self->priv->entry.menu); + g_clear_object (&self->priv->entry.image); G_OBJECT_CLASS (indicator_printers_parent_class)->dispose (object); } @@ -60,8 +57,8 @@ dispose (GObject *object) static GList * get_entries (IndicatorObject *io) { - IndicatorPrintersPrivate *priv = INDICATOR_PRINTERS_GET_PRIVATE (io); - return g_list_append (NULL, &priv->entry); + IndicatorPrinters *self = INDICATOR_PRINTERS (io); + return g_list_append (NULL, &self->priv->entry); } @@ -214,13 +211,18 @@ new_indicator_item (DbusmenuMenuitem *newitem, static void -indicator_printers_init (IndicatorPrinters *io) +indicator_printers_init (IndicatorPrinters *self) { - IndicatorPrintersPrivate *priv = INDICATOR_PRINTERS_GET_PRIVATE (io); + IndicatorPrintersPrivate *priv; DbusmenuGtkMenu *menu; DbusmenuClient *client; GtkImage *image; + priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + INDICATOR_PRINTERS_TYPE, + IndicatorPrintersPrivate); + self->priv = priv; + menu = dbusmenu_gtkmenu_new(INDICATOR_PRINTERS_DBUS_NAME, INDICATOR_PRINTERS_DBUS_OBJECT_PATH); |