aboutsummaryrefslogtreecommitdiff
path: root/libindicator
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-16 08:46:22 -0600
committerTed Gould <ted@gould.cx>2010-02-16 08:46:22 -0600
commit55145548b36ce11274eb7083760a0913c6731615 (patch)
tree3b99aaf00cc393460873cec7cf3115074c4ff5b6 /libindicator
parent62876d9ec2775b052493ada9e0b03e557c5ca4bb (diff)
downloadlibayatana-indicator-55145548b36ce11274eb7083760a0913c6731615.tar.gz
libayatana-indicator-55145548b36ce11274eb7083760a0913c6731615.tar.bz2
libayatana-indicator-55145548b36ce11274eb7083760a0913c6731615.zip
Start loading the keyfile.
Diffstat (limited to 'libindicator')
-rw-r--r--libindicator/indicator-desktop-shortcuts.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c
index 07fa40a..a87316f 100644
--- a/libindicator/indicator-desktop-shortcuts.c
+++ b/libindicator/indicator-desktop-shortcuts.c
@@ -55,6 +55,7 @@ static void indicator_desktop_shortcuts_dispose (GObject *object);
static void indicator_desktop_shortcuts_finalize (GObject *object);
static void set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec);
static void get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec);
+static void parse_keyfile (IndicatorDesktopShortcuts * ids);
G_DEFINE_TYPE (IndicatorDesktopShortcuts, indicator_desktop_shortcuts, G_TYPE_OBJECT);
@@ -150,14 +151,28 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object);
switch(prop_id) {
- case PROP_DESKTOP_FILE:
+ case PROP_DESKTOP_FILE: {
+ GError * error = NULL;
+ GKeyFile * keyfile = g_key_file_new();
+ g_key_file_load_from_file(keyfile, g_value_get_string(value), G_KEY_FILE_NONE, &error);
+
+ if (error != NULL) {
+ g_warning("Unable to load keyfile from file '%s': %s", g_value_get_string(value), error->message);
+ g_error_free(error);
+ g_key_file_free(keyfile);
+ }
+
+ priv->keyfile = keyfile;
+ parse_keyfile(INDICATOR_DESKTOP_SHORTCUTS(object));
break;
+ }
case PROP_IDENTITY:
if (priv->identity != NULL) {
g_warning("Identity already set to '%s' and trying to set it to '%s'.", priv->identity, g_value_get_string(value));
return;
}
priv->identity = g_value_dup_string(value);
+ parse_keyfile(INDICATOR_DESKTOP_SHORTCUTS(object));
break;
/* *********************** */
default:
@@ -188,6 +203,15 @@ get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspe
return;
}
+/* Checks to see if we can, and if we can it goes through
+ and parses the keyfile entries. */
+static void
+parse_keyfile (IndicatorDesktopShortcuts * ids)
+{
+
+ return;
+}
+
/* Looks through the nicks ot see if this one is in the list,
and thus valid to use. */
static gboolean