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

Thomas Martitz notifications at xxxxx
Tue Jan 23 23:16:08 UTC 2018


kugel- requested changes on this pull request.



> @@ -98,6 +98,26 @@ G_BEGIN_DECLS
 #endif
 
 
+#if !GTK_CHECK_VERSION(3, 4, 0)
+static inline guint gtkcompat_builder_add_from_resource(GtkBuilder *builder,
+	const gchar *resource_path, GError **error)
+{
+	GBytes *bytes = g_resources_lookup_data(resource_path,
+		G_RESOURCE_LOOKUP_FLAGS_NONE, error);
+	if (bytes == NULL)

This is worth a a g_error(), as it means Geany wasn't compiled correctly.

> +		--target=$@ \
+		--sourcedir=$(srcdir) \
+		--generate-source \
+		--c-name="geany" \
+		--manual-register \
+		--internal \
+			$(srcdir)/geany.gresource.xml
+resources.h: $(resource_dependencies)
+	$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) \
+		--target=$@ \
+		--sourcedir=$(srcdir) \
+		--generate-header \
+		--c-name="geany" \
+		--manual-register \
+		--internal \
+			$(srcdir)/geany.gresource.xml

This runs glib-compile-resources twice. It's usually better to a construct pattern rule, where (GNU) make recognizes that one rule produces multiple output files. That's assuming it's even possible with, I haven't checked.

```
%.gresource.c %.gresource.h: %.gresource.xml $(top_srcdir)/data/geany.glade
[…]
```

-- 
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-90385252
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20180123/552f3623/attachment.html>


More information about the Github-comments mailing list