aboutsummaryrefslogtreecommitdiff
path: root/libindicator/indicator-desktop-shortcuts.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-04-05 15:20:46 -0500
committerTed Gould <ted@gould.cx>2010-04-05 15:20:46 -0500
commit1200f51e90901eb120484ae3bb0a3912efb7bff4 (patch)
tree9c745a8e02bba0fe3c3a91ba046511d97dbb9e82 /libindicator/indicator-desktop-shortcuts.c
parente900b4c7a8fc08f73533d8a49777ebbd109028dd (diff)
downloadlibayatana-indicator-1200f51e90901eb120484ae3bb0a3912efb7bff4.tar.gz
libayatana-indicator-1200f51e90901eb120484ae3bb0a3912efb7bff4.tar.bz2
libayatana-indicator-1200f51e90901eb120484ae3bb0a3912efb7bff4.zip
Switching to only use the g_dgettext version if the locale_string function doesn't change the string from the normal lookup (and we have a domain to look in).
Diffstat (limited to 'libindicator/indicator-desktop-shortcuts.c')
-rw-r--r--libindicator/indicator-desktop-shortcuts.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c
index 161350b..cfd8eef 100644
--- a/libindicator/indicator-desktop-shortcuts.c
+++ b/libindicator/indicator-desktop-shortcuts.c
@@ -438,22 +438,25 @@ indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, cons
}
gchar * name = NULL;
- if (priv->domain == NULL) {
- name = g_key_file_get_locale_string(priv->keyfile,
+ gchar * keyvalue = g_key_file_get_string(priv->keyfile,
+ groupheader,
+ G_KEY_FILE_DESKTOP_KEY_NAME,
+ NULL);
+ gchar * localeval = g_key_file_get_locale_string(priv->keyfile,
groupheader,
G_KEY_FILE_DESKTOP_KEY_NAME,
NULL,
NULL);
+ g_free(groupheader);
+
+ if (priv->domain != NULL && g_strcmp0(keyvalue, localeval) == 0) {
+ name = g_strdup(g_dgettext(priv->domain, keyvalue));
+ g_free(localeval);
} 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);
+ name = localeval;
}
- g_free(groupheader);
+ g_free(keyvalue);
return name;
}