[Github-comments] [geany/geany] Use GResource to load GtkBuilder XML UI file (#1703)
Colomban Wendling
notifications at xxxxx
Sun Dec 3 01:32:47 UTC 2017
b4n commented on this pull request.
> - if (! gtk_builder_add_from_file(builder, interface_file, &error))
+ ui_data = g_resource_lookup_data(geany_get_resource(),
+ "/org/geany/Geany/geany.glade", G_RESOURCE_LOOKUP_FLAGS_NONE, &error);
+ if (ui_data == NULL)
+ {
+ dialogs_show_msgbox_with_secondary(GTK_MESSAGE_ERROR,
+ _("Geany cannot start!"), error->message);
+ g_error("Cannot load user-interface: %s", error->message);
+ g_error_free(error);
+ g_object_unref(builder);
+ return;
+ }
+
+ error = NULL;
+ if (gtk_builder_add_from_string(builder, g_bytes_get_data(ui_data, NULL),
+ g_bytes_get_size(ui_data), &error) == 0)
You could keep the boolean style condition (`if (gtk_builder_...())`) instead of checking for `0`; it's the working the same yet is a little more straightforward in a boolean-filled world, and the use of `guint` really seem like an API glitch in the GTK side, as it's just documented to return "A positive value on success, 0 if an error occurred".
--
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#pullrequestreview-80689730
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20171203/3ac22a0c/attachment.html>
More information about the Github-comments
mailing list