[rhythmbox] in normal builds, try loading plugin builder files from resources



commit e3861d7d41add564be03371675a8c871f81feb52
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Jul 19 22:07:16 2016 +1000

    in normal builds, try loading plugin builder files from resources

 lib/rb-builder-helpers.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/lib/rb-builder-helpers.c b/lib/rb-builder-helpers.c
index ff7be34..730df59 100644
--- a/lib/rb-builder-helpers.c
+++ b/lib/rb-builder-helpers.c
@@ -116,12 +116,26 @@ rb_builder_load (const char *file, gpointer user_data)
 GtkBuilder *
 rb_builder_load_plugin_file (GObject *plugin, const char *file, gpointer user_data)
 {
-       char *path;
+       char *path = NULL;
        GtkBuilder *builder;
 
-       path = rb_find_plugin_data_file (plugin, file);
+#if !defined(USE_UNINSTALLED_DIRS)
+       GBytes *bytes;
+
+       path = rb_find_plugin_resource (plugin, file);
+       bytes = g_resources_lookup_data (path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
+       if (bytes != NULL) {
+               g_bytes_unref (bytes);
+       } else {
+               g_free (path);
+               path = NULL;
+       }
+#endif
        if (path == NULL) {
-               return NULL;
+               path = rb_find_plugin_data_file (plugin, file);
+               if (path == NULL) {
+                       return NULL;
+               }
        }
 
        builder = rb_builder_load (path, user_data);


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