aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-02-27 13:39:44 -0600
committerTed Gould <ted@gould.cx>2012-02-27 13:39:44 -0600
commitf7e5502a2a136bedfb6a72fb081883568a1ead3c (patch)
treeef36263306c06a8078193ff70a4c3ce515f1674c
parenta02d4deb0f75bb8ef43a5b293fa75a62e9a98ba9 (diff)
downloadlibayatana-indicator-f7e5502a2a136bedfb6a72fb081883568a1ead3c.tar.gz
libayatana-indicator-f7e5502a2a136bedfb6a72fb081883568a1ead3c.tar.bz2
libayatana-indicator-f7e5502a2a136bedfb6a72fb081883568a1ead3c.zip
Adding a state variable to track what kind of actions we have
-rw-r--r--libindicator/indicator-desktop-shortcuts.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c
index b17ab5e..bb25979 100644
--- a/libindicator/indicator-desktop-shortcuts.c
+++ b/libindicator/indicator-desktop-shortcuts.c
@@ -38,8 +38,16 @@ License along with this library. If not, see
#define PROP_DESKTOP_FILE_S "desktop-file"
#define PROP_IDENTITY_S "identity"
+typedef enum _actions_t actions_t;
+enum _actions_t {
+ ACTIONS_NONE,
+ ACTIONS_XAYATANA,
+ ACTIONS_DESKTOP_SPEC
+};
+
typedef struct _IndicatorDesktopShortcutsPrivate IndicatorDesktopShortcutsPrivate;
struct _IndicatorDesktopShortcutsPrivate {
+ actions_t actions;
GKeyFile * keyfile;
gchar * identity;
GArray * nicks;
@@ -107,6 +115,7 @@ indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self)
priv->identity = NULL;
priv->domain = NULL;
priv->nicks = g_array_new(TRUE, TRUE, sizeof(gchar *));
+ priv->actions = ACTIONS_NONE;
return;
}
@@ -452,6 +461,7 @@ indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, cons
g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), NULL);
IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids);
+ g_return_val_if_fail(priv->actions != ACTIONS_NONE, NULL);
g_return_val_if_fail(priv->keyfile != NULL, NULL);
g_return_val_if_fail(is_valid_nick((gchar **)priv->nicks->data, nick), NULL);
@@ -512,6 +522,7 @@ indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gc
g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), FALSE);
IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids);
+ g_return_val_if_fail(priv->actions != ACTIONS_NONE, FALSE);
g_return_val_if_fail(priv->keyfile != NULL, FALSE);
g_return_val_if_fail(is_valid_nick((gchar **)priv->nicks->data, nick), FALSE);