aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--libindicator/indicator-desktop-shortcuts.c36
2 files changed, 38 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 813435a..1166d59 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libindicator (0.3.6-0ubuntu1~ppa2~shortcutdomain1) UNRELEASED; urgency=low
+
+ * Upstream merge
+ * Use the domain in desktop files for shortcuts
+
+ -- Ted Gould <ted@ubuntu.com> Fri, 02 Apr 2010 10:50:28 -0500
+
libindicator (0.3.6-0ubuntu1~ppa1) lucid; urgency=low
* Upstream release 0.3.6
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c
index e86a6ab..504d023 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;
@@ -411,11 +427,21 @@ indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, cons
return NULL;
}
- gchar * name = g_key_file_get_locale_string(priv->keyfile,
- groupheader,
- G_KEY_FILE_DESKTOP_KEY_NAME,
- NULL,
- NULL);
+ gchar * name = NULL;
+ if (priv->domain == NULL) {
+ name = g_key_file_get_locale_string(priv->keyfile,
+ groupheader,
+ G_KEY_FILE_DESKTOP_KEY_NAME,
+ NULL,
+ NULL);
+ } else {
+ gchar * tempname = g_key_file_get_string(priv->keyfile,
+ groupheader,
+ G_KEY_FILE_DESKTOP_KEY_NAME,
+ NULL);
+ name = g_strdup(g_dgettext(priv->domain, tempname));
+ g_free(tempname);
+ }
g_free(groupheader);