[geany/geany-plugins] 5d7ae0: geniuspaste: Add Windows-specific logic for locating system data files

Colomban Wendling git-noreply at xxxxx
Sat Mar 12 23:48:42 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:48:42 UTC
Commit:      5d7ae057bf572c695e7d7590aa2568421d06bf7a
             https://github.com/geany/geany-plugins/commit/5d7ae057bf572c695e7d7590aa2568421d06bf7a

Log Message:
-----------
geniuspaste: Add Windows-specific logic for locating system data files

This fixes locating pastebin configuration files shipped with the
plugin under Windows (those installed in the plugin's data directory
rather than in the user's configuration directory).


Modified Paths:
--------------
    geniuspaste/src/geniuspaste.c

Modified: geniuspaste/src/geniuspaste.c
9 lines changed, 8 insertions(+), 1 deletions(-)
===================================================================
@@ -239,10 +239,15 @@ static void load_pastebins_in_dir(const gchar *path)
 
 static void load_all_pastebins(void)
 {
+#ifdef G_OS_WIN32
+    gchar *prefix = g_win32_get_package_installation_directory_of_module(NULL);
+#else
+    gchar *prefix = NULL;
+#endif
     gchar *paths[] = {
         g_build_filename(geany->app->configdir, "plugins", "geniuspaste",
                          "pastebins", NULL),
-        g_build_filename(PLUGINDATADIR, "pastebins", NULL)
+        g_build_filename(prefix ? prefix : "", PLUGINDATADIR, "pastebins", NULL)
     };
     guint i;
 
@@ -252,6 +257,8 @@ static void load_all_pastebins(void)
         g_free(paths[i]);
     }
     pastebins = g_slist_sort(pastebins, sort_pastebins);
+
+    g_free(prefix);
 }
 
 static void free_all_pastebins(void)



--------------
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