[geany/geany-plugins] c51dd4: git-changebar: Fix locating the prefs UI file on Windows

Colomban Wendling git-noreply at xxxxx
Sat Mar 12 23:38:31 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 12 Mar 2016 23:38:31 UTC
Commit:      c51dd4e94334c6daa5fc35dc48e8c7fcc89c42d0
             https://github.com/geany/geany-plugins/commit/c51dd4e94334c6daa5fc35dc48e8c7fcc89c42d0

Log Message:
-----------
git-changebar: Fix locating the prefs UI file on Windows


Modified Paths:
--------------
    git-changebar/src/gcb-plugin.c

Modified: git-changebar/src/gcb-plugin.c
12 lines changed, 10 insertions(+), 2 deletions(-)
===================================================================
@@ -1353,10 +1353,16 @@ plugin_configure (GtkDialog *dialog)
   GError     *error   = NULL;
   GtkWidget  *base    = NULL;
   GtkBuilder *builder = gtk_builder_new ();
+#ifdef G_OS_WIN32
+  gchar      *prefix  = g_win32_get_package_installation_directory_of_module (NULL);
+#else
+  gchar      *prefix  = NULL;
+#endif
+  gchar      *path    = g_build_filename (prefix ? prefix : "", PLUGINDATADIR,
+                                          "prefs.ui", NULL);
   
   gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
-  if (! gtk_builder_add_from_file (builder, PKGDATADIR"/"PLUGIN"/prefs.ui",
-                                   &error)) {
+  if (! gtk_builder_add_from_file (builder, path, &error)) {
     g_critical (_("Failed to load UI definition, please check your "
                   "installation. The error was: %s"), error->message);
     g_error_free (error);
@@ -1398,6 +1404,8 @@ plugin_configure (GtkDialog *dialog)
                            cw, (GClosureNotify) configure_widgets_free, 0);
   }
   
+  g_free (path);
+  g_free (prefix);
   g_object_unref (builder);
   
   return base;



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list