[rhythmbox] allow loading of builder files from full resource paths



commit 98f4920b9ed11e4780c1aaa49dab76a2ea0fc915
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Jul 19 22:05:46 2016 +1000

    allow loading of builder files from full resource paths

 lib/rb-builder-helpers.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/lib/rb-builder-helpers.c b/lib/rb-builder-helpers.c
index 81fbea7..ff7be34 100644
--- a/lib/rb-builder-helpers.c
+++ b/lib/rb-builder-helpers.c
@@ -49,9 +49,10 @@
  * Locates and reads a GtkBuilder file, automatically connecting
  * signal handlers where possible.
  *
- * The caller can specify an absolute path to the file, or just filename,
- * in which case the file will be loaded from GResources (in normal builds)
- * or the source data/ui directory (in uninstalled builds).
+ * The caller can specify an absolute path to the file, a resource path
+ * starting with /org/gnome/Rhythmbox/ or just a filename, in which case
+ * the file will be loaded from GResources (in normal builds) or the source
+ * data/ui directory (in uninstalled builds).
  *
  * Return value: (transfer full): #GtkBuilder object built from the file
  */
@@ -65,7 +66,10 @@ rb_builder_load (const char *file, gpointer user_data)
 
        g_return_val_if_fail (file != NULL, NULL);
 
-       if (g_path_is_absolute (file)) {
+       if (g_str_has_prefix (file, "/org/gnome/Rhythmbox/")) {
+               resource = g_strdup (file);
+               name = NULL;
+       } else if (g_path_is_absolute (file)) {
                name = file;
                resource = NULL;
        } else {


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