From 5d2ace5acc4c15d3ced8439ab8afa216806a1b53 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 15 Feb 2010 15:20:09 -0600 Subject: Fleshing out _new and _get_nicks Both are lovely functions. --- libindicator/indicator-desktop-shortcuts.c | 16 +++++++++++----- libindicator/indicator-desktop-shortcuts.h | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index e6f5a69..4ae95b9 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -27,6 +27,9 @@ License along with this library. If not, see #include "indicator-desktop-shortcuts.h" +#define PROP_DESKTOP_FILE_S "desktop-file" +#define PROP_IDENTITY_S "identity" + typedef struct _IndicatorDesktopShortcutsPrivate IndicatorDesktopShortcutsPrivate; struct _IndicatorDesktopShortcutsPrivate { GKeyFile * keyfile; @@ -131,8 +134,11 @@ indicator_desktop_shortcuts_finalize (GObject *object) IndicatorDesktopShortcuts * indicator_desktop_shortcuts_new (const gchar * file, const gchar * identity) { - - return NULL; + GObject * obj = g_object_new(INDICATOR_TYPE_DESKTOP_SHORTCUTS, + PROP_DESKTOP_FILE_S, file, + PROP_IDENTITY_S, identity, + NULL); + return INDICATOR_DESKTOP_SHORTCUTS(obj); } /** @@ -150,9 +156,9 @@ indicator_desktop_shortcuts_new (const gchar * file, const gchar * identity) const gchar ** indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids) { - - - return NULL; + g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), NULL); + IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids); + return (const gchar **)priv->nicks->data; } /** diff --git a/libindicator/indicator-desktop-shortcuts.h b/libindicator/indicator-desktop-shortcuts.h index bda65a6..16a23a4 100644 --- a/libindicator/indicator-desktop-shortcuts.h +++ b/libindicator/indicator-desktop-shortcuts.h @@ -32,8 +32,8 @@ G_BEGIN_DECLS #define INDICATOR_TYPE_DESKTOP_SHORTCUTS (indicator_desktop_shortcuts_get_type ()) #define INDICATOR_DESKTOP_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcuts)) #define INDICATOR_DESKTOP_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcutsClass)) -#define IS_INDICATOR_DESKTOP_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_TYPE_DESKTOP_SHORTCUTS)) -#define IS_INDICATOR_DESKTOP_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_TYPE_DESKTOP_SHORTCUTS)) +#define INDICATOR_IS_DESKTOP_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_TYPE_DESKTOP_SHORTCUTS)) +#define INDICATOR_IS_DESKTOP_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_TYPE_DESKTOP_SHORTCUTS)) #define INDICATOR_DESKTOP_SHORTCUTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcutsClass)) typedef struct _IndicatorDesktopShortcuts IndicatorDesktopShortcuts; -- cgit v1.2.3