[Github-comments] [geany/geany] Use GResource to load GtkBuilder XML UI file (#1703)

Colomban Wendling notifications at xxxxx
Sun Dec 3 02:06:49 UTC 2017


@codebrainz I prefer my implementation for the compat function, but either is fine.  Maybe your checks for emptiness are nice though (as `add_from_string()` doesn't accept it for some reason, although `from_resource()` does), although it really shouldn't ever happen.

Otherwise, I think the changes in `ui_utils.c` are slightly better in mine, and closer to master (less unnecessary changes):
```diff
diff --git a/src/ui_utils.c b/src/ui_utils.c
index a0093174a..5b544bff4 100644
--- a/src/ui_utils.c
+++ b/src/ui_utils.c
@@ -42,7 +42,6 @@
 #include "msgwindow.h"
 #include "prefs.h"
 #include "project.h"
-#include "resources.h"
 #include "sciwrappers.h"
 #include "sidebar.h"
 #include "stash.h"
@@ -2427,7 +2426,6 @@ static GtkWidget *ui_get_top_parent(GtkWidget *widget)
 void ui_init_builder(void)
 {
     const gchar *name;
-    GBytes *ui_data;
     GError *error;
     GSList *iter, *all_objects;
     GtkWidget *widget, *toplevel;
@@ -2445,7 +2443,7 @@ void ui_init_builder(void)
     {
         dialogs_show_msgbox_with_secondary(GTK_MESSAGE_ERROR,
             _("Geany cannot start!"), error->message);
-        g_error(_("Cannot load user-interface: %s"), error->message);
+        g_error("Cannot create user-interface: %s", error->message);
         g_error_free(error);
         g_object_unref(builder);
         return;
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1703#issuecomment-348734678
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20171202/835a4c68/attachment.html>


More information about the Github-comments mailing list