summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Gorodnichev <[email protected]>2017-05-16 00:12:05 +0300
committermonsta <[email protected]>2017-05-20 14:13:05 +0300
commit8f21060a9ff44690d566377acb94ca621f01dd86 (patch)
tree90c867d6e6295f583cd2c16252d56d295b3927e3
parent214aa89bc9ece6444894489d3b7da94d906e2b27 (diff)
downloadmate-panel-8f21060a9ff44690d566377acb94ca621f01dd86.tar.bz2
mate-panel-8f21060a9ff44690d566377acb94ca621f01dd86.tar.xz
localized application's name and description
g_desktop_app_info_get_string return unlocalized strings. g_app_info_get_name and g_app_info_get_description to get localized application's name and comment(description)
-rw-r--r--mate-panel/launcher.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mate-panel/launcher.c b/mate-panel/launcher.c
index 052c0b57..c59b67a8 100644
--- a/mate-panel/launcher.c
+++ b/mate-panel/launcher.c
@@ -513,8 +513,8 @@ create_launcher (const char *location)
static void
setup_button (Launcher *launcher)
{
- char *comment;
- char *name;
+ const char *comment;
+ const char *name;
char *str;
char *icon;
char *unescaped_str;
@@ -556,8 +556,8 @@ setup_button (Launcher *launcher)
_("_Properties"),
launcher_properties_enabled);
- name = g_desktop_app_info_get_string (launcher->app_info, G_KEY_FILE_DESKTOP_KEY_NAME);
- comment = g_desktop_app_info_get_string (launcher->app_info, G_KEY_FILE_DESKTOP_KEY_COMMENT);
+ name = g_app_info_get_name (G_APP_INFO(launcher->app_info));
+ comment = g_app_info_get_description (G_APP_INFO(launcher->app_info));
/* Setup tooltip */
if (!PANEL_GLIB_STR_EMPTY (name) && !PANEL_GLIB_STR_EMPTY (comment))
str = g_strdup_printf ("%s\n%s", name, comment);
@@ -566,8 +566,6 @@ setup_button (Launcher *launcher)
else
str = g_strdup (comment);
- g_free (name);
- g_free (comment);
/* If we can unescape the string, then we probably have an escaped
* string (a location e.g.). If we can't, then it most probably means