aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-04-02 10:44:57 -0500
committerTed Gould <ted@gould.cx>2010-04-02 10:44:57 -0500
commit5d02c0c8366127655de02c14514b9e39fba6172a (patch)
tree66d0c2c7cd09fb1663b26bbe138ba5f48038050f
parent999f1483f967db63d71ff2a9453b5866eec339bf (diff)
downloadlibayatana-indicator-5d02c0c8366127655de02c14514b9e39fba6172a.tar.gz
libayatana-indicator-5d02c0c8366127655de02c14514b9e39fba6172a.tar.bz2
libayatana-indicator-5d02c0c8366127655de02c14514b9e39fba6172a.zip
Adding a private variable for the translation domain and grabbing it from the keyfile.
-rw-r--r--libindicator/indicator-desktop-shortcuts.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c
index e86a6ab..a370c0f 100644
--- a/libindicator/indicator-desktop-shortcuts.c
+++ b/libindicator/indicator-desktop-shortcuts.c
@@ -39,6 +39,7 @@ struct _IndicatorDesktopShortcutsPrivate {
GKeyFile * keyfile;
gchar * identity;
GArray * nicks;
+ gchar * domain;
};
enum {
@@ -100,6 +101,7 @@ indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self)
priv->keyfile = NULL;
priv->identity = NULL;
+ priv->domain = NULL;
priv->nicks = g_array_new(TRUE, TRUE, sizeof(gchar *));
return;
@@ -131,6 +133,11 @@ indicator_desktop_shortcuts_finalize (GObject *object)
priv->identity = NULL;
}
+ if (priv->domain != NULL) {
+ g_free(priv->domain);
+ priv->domain = NULL;
+ }
+
if (priv->nicks != NULL) {
gint i;
for (i = 0; i < priv->nicks->len; i++) {
@@ -227,6 +234,15 @@ parse_keyfile (IndicatorDesktopShortcuts * ids)
return;
}
+ /* Check to see if there is a custom translation domain that
+ we should take into account. */
+ if (g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL)) {
+ if (priv->domain != NULL) {
+ g_free(priv->domain);
+ }
+ priv->domain = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL);
+ }
+
/* Okay, we've got everything we need. Let's get it on! */
gint i;
gsize num_nicks = 0;