diff options
author | Ted Gould <ted@gould.cx> | 2010-02-15 15:20:09 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-15 15:20:09 -0600 |
commit | 5d2ace5acc4c15d3ced8439ab8afa216806a1b53 (patch) | |
tree | cf50b80df4fb09275d2e5fcf28875a73f3deaa13 | |
parent | a32a078bd850762c40577db69d589f660bf5e957 (diff) | |
download | libayatana-indicator-5d2ace5acc4c15d3ced8439ab8afa216806a1b53.tar.gz libayatana-indicator-5d2ace5acc4c15d3ced8439ab8afa216806a1b53.tar.bz2 libayatana-indicator-5d2ace5acc4c15d3ced8439ab8afa216806a1b53.zip |
Fleshing out _new and _get_nicks Both are lovely functions.
-rw-r--r-- | libindicator/indicator-desktop-shortcuts.c | 16 | ||||
-rw-r--r-- | 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; |