Skip to content

Commit

Permalink
in normal builds, try loading plugin builder files from resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Matthew committed Aug 10, 2016
1 parent 7cfbc97 commit e3861d7
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions lib/rb-builder-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e3861d7

Please sign in to comment.