[Xfce4-commits] [panel-plugins/xfce4-xkb-plugin] 17/17: Bug 12884: Load flags from XDG_DATA_HOME if present

noreply at xfce.org noreply at xfce.org
Sat Jun 10 14:31:50 CEST 2017


This is an automated email from the git hooks/post-receive script.

n   i   n   e   t   l   s       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-xkb-plugin.

commit 7f74d7e811e8031d4e8c475919493d93dd0bbf3d
Author: Viktor Odintsev <zakhams at gmail.com>
Date:   Mon Jun 5 17:53:14 2017 +0300

    Bug 12884: Load flags from XDG_DATA_HOME if present
---
 panel-plugin/Makefile.am  | 5 +++--
 panel-plugin/xkb-plugin.c | 2 +-
 panel-plugin/xkb-util.c   | 7 ++++++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 164a6c5..60a1b65 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -36,8 +36,9 @@ libxkb_la_CFLAGS = \
 	$(LIBWNCK_CFLAGS) \
 	$(GARCON_CFLAGS) \
 	$(PLATFORM_CFLAGS) \
-	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
-	-DFLAGSDIR=\"$(datadir)/xfce4/xkb/flags\" \
+	-DLOCALEDIR=\"$(localedir)\" \
+	-DDATADIR=\"$(datadir)\" \
+	-DFLAGSRELDIR=\"xfce4/xkb/flags\" \
 	-DWNCK_I_KNOW_THIS_IS_UNSTABLE
 
 libxkb_la_LDFLAGS = \
diff --git a/panel-plugin/xkb-plugin.c b/panel-plugin/xkb-plugin.c
index 2bc49c9..dcb3d9f 100644
--- a/panel-plugin/xkb-plugin.c
+++ b/panel-plugin/xkb-plugin.c
@@ -234,7 +234,7 @@ xkb_plugin_construct (XfcePanelPlugin *plugin)
     g_signal_connect (G_OBJECT (wnck_screen), "application-closed",
             G_CALLBACK (xkb_plugin_application_closed), xkb_plugin);
 
-    xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+    xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
 
     xfce_panel_plugin_menu_show_configure (plugin);
     xfce_panel_plugin_menu_show_about (plugin);
diff --git a/panel-plugin/xkb-util.c b/panel-plugin/xkb-util.c
index eb75f6e..c105ca3 100644
--- a/panel-plugin/xkb-util.c
+++ b/panel-plugin/xkb-util.c
@@ -35,7 +35,12 @@ xkb_util_get_flag_filename (const gchar* group_name)
     if (!group_name)
         return NULL;
 
-    filename = g_strconcat (FLAGSDIR, "/", group_name, ".svg", NULL);
+    filename = g_strconcat (g_get_user_data_dir (), "/", FLAGSRELDIR, "/", group_name, ".svg", NULL);
+
+    if (!g_file_test (filename, G_FILE_TEST_EXISTS))
+    {
+        filename = g_strconcat (DATADIR, "/", FLAGSRELDIR, "/", group_name, ".svg", NULL);
+    }
 
     return filename;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list