[mate-control-center] 04/05: debian/patches: Add 0000_fix_external_localizations_in_desktop_files.patch. Fix support for external localizations in .desktop files. (LP: #1594959)
Martin Wimpress
flexiondotorg-guest at moszumanska.debian.org
Sat Dec 30 23:04:11 UTC 2017
This is an automated email from the git hooks/post-receive script.
flexiondotorg-guest pushed a commit to branch master
in repository mate-control-center.
commit ec89eeb91fd1b73944f3ab8f6639dc3d251969c6
Author: Martin Wimpress <martin.wimpress at ubuntu.com>
Date: Sat Dec 30 23:03:13 2017 +0000
debian/patches: Add 0000_fix_external_localizations_in_desktop_files.patch. Fix support for external localizations in .desktop files. (LP: #1594959)
---
...x_external_localizations_in_desktop_files.patch | 55 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 56 insertions(+)
diff --git a/debian/patches/0000_fix_external_localizations_in_desktop_files.patch b/debian/patches/0000_fix_external_localizations_in_desktop_files.patch
new file mode 100644
index 0000000..d531f24
--- /dev/null
+++ b/debian/patches/0000_fix_external_localizations_in_desktop_files.patch
@@ -0,0 +1,55 @@
+Author: Vlad Orlov <monsta at inbox.ru>
+Description: Fix support for external localizations in .desktop files
+
+---
+ libslab/application-tile.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+diff --git a/libslab/application-tile.c b/libslab/application-tile.c
+index 7d98da8..523643d 100644
+--- a/libslab/application-tile.c
++++ b/libslab/application-tile.c
+@@ -269,10 +269,10 @@ application_tile_setup (ApplicationTile *this)
+ GtkWidget *menu_item;
+ GtkContainer *menu_ctnr;
+
+- const gchar *name;
+- const gchar *desc;
++ gchar *name;
++ gchar *desc;
+
+- const gchar *comment;
++ gchar *comment;
+
+ gchar *markup;
+ gchar *str;
+@@ -287,9 +287,13 @@ application_tile_setup (ApplicationTile *this)
+ priv->image_id = g_strdup (mate_desktop_item_get_localestring (priv->desktop_item, "Icon"));
+ image = themed_icon_new (priv->image_id, priv->image_size);
+
+- name = mate_desktop_item_get_localestring (priv->desktop_item, "Name");
+- desc = mate_desktop_item_get_localestring (priv->desktop_item, "GenericName");
+- comment = mate_desktop_item_get_localestring (priv->desktop_item, "Comment");
++ gchar *filename = g_filename_from_uri (mate_desktop_item_get_location (priv->desktop_item), NULL, NULL);
++ GKeyFile *keyfile = g_key_file_new ();
++ g_key_file_load_from_file (keyfile, filename, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
++
++ name = g_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_GROUP, "Name", NULL, NULL);
++ desc = g_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_GROUP, "GenericName", NULL, NULL);
++ comment = g_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_GROUP, "Comment", NULL, NULL);
+
+ accessible = gtk_widget_get_accessible (GTK_WIDGET (this));
+ if (name)
+@@ -392,6 +396,12 @@ application_tile_setup (ApplicationTile *this)
+ }
+
+ gtk_widget_show_all (GTK_WIDGET (TILE (this)->context_menu));
++
++ g_free (name);
++ g_free (desc);
++ g_free (comment);
++ g_free (filename);
++ g_key_file_unref (keyfile);
+ }
+
+ static GtkWidget *
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..08dfb69
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0000_fix_external_localizations_in_desktop_files.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/mate-control-center.git
More information about the pkg-mate-commits
mailing list