[gnome-builder] plugins: Fix the PeasEngine search path



commit fd0b6601a6f071cb9b7948638f1ec77b194221ce
Author: Matthew Leeds <mleeds redhat com>
Date:   Mon Jan 30 16:08:53 2017 -0600

    plugins: Fix the PeasEngine search path
    
    This commit reverts part of commit 632f98e9 so the "datadir" variable is
    set correctly for plugins. Otherwise for example autotools-templates
    tries to find resources in
    ".../plugins/autotools_templates/resources/..." rather than in
    ".../plugins/autotools-templates/autotools_templates/resources/..." and
    of course fails.

 libide/application/ide-application-plugins.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/libide/application/ide-application-plugins.c b/libide/application/ide-application-plugins.c
index dfcb7fe..df52059 100644
--- a/libide/application/ide-application-plugins.c
+++ b/libide/application/ide-application-plugins.c
@@ -87,6 +87,8 @@ ide_application_discover_plugins (IdeApplication *self)
 
   if (g_getenv ("GB_IN_TREE_PLUGINS") != NULL)
     {
+      GDir *dir;
+
       g_irepository_prepend_search_path (BUILDDIR"/contrib/egg");
       g_irepository_prepend_search_path (BUILDDIR"/contrib/gstyle");
       g_irepository_prepend_search_path (BUILDDIR"/contrib/jsonrpc-glib");
@@ -94,7 +96,19 @@ ide_application_discover_plugins (IdeApplication *self)
       g_irepository_prepend_search_path (BUILDDIR"/contrib/tmpl");
       g_irepository_prepend_search_path (BUILDDIR"/libide");
 
-      peas_engine_prepend_search_path (engine, BUILDDIR"/plugins", NULL);
+      if ((dir = g_dir_open (BUILDDIR"/plugins", 0, NULL)))
+        {
+          const gchar *name;
+
+          while ((name = g_dir_read_name (dir)))
+            {
+              path = g_build_filename (BUILDDIR, "plugins", name, NULL);
+              peas_engine_prepend_search_path (engine, path, path);
+              g_free (path);
+            }
+
+          g_dir_close (dir);
+        }
     }
   else
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]