Skip to content

Commit

Permalink
allow loading of builder files from full resource paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Matthew committed Aug 10, 2016
1 parent 48c6c3c commit 98f4920
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/rb-builder-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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 {
Expand Down

0 comments on commit 98f4920

Please sign in to comment.