After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 673618 - Use glib resource framework for UI files
Use glib resource framework for UI files
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: starter
git master
Other Linux
: Normal normal
: ---
Assigned To: Ignacio Casal Quinteiro (nacho)
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-06 02:01 UTC by Kalev Lember
Modified: 2013-07-07 10:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
starter: Use glib resource framework for UI files (4.39 KB, patch)
2012-04-06 02:05 UTC, Kalev Lember
needs-work Details | Review
starter: Remove unused starter_logo.png (11.24 KB, patch)
2012-04-06 02:05 UTC, Kalev Lember
committed Details | Review
starter: Use glib resource framework for UI files (4.51 KB, patch)
2012-04-06 12:58 UTC, Kalev Lember
none Details | Review
starter: Use glib resource framework for UI files (4.44 KB, patch)
2012-04-06 15:19 UTC, Kalev Lember
committed Details | Review

Description Kalev Lember 2012-04-06 02:01:34 UTC
GLib 2.32 includes support for bundling files as resource data in shared objects. I'd like to convert various UI files that are currently installed in /usr/share to resource data. This has the advantage of faster loading and cleaner installation.

Attaching a patch for the starter plugin; if this looks fine, I'll convert the rest of the UI files in a similar manner.
Comment 1 Kalev Lember 2012-04-06 02:05:34 UTC
Created attachment 211443 [details] [review]
starter: Use glib resource framework for UI files
Comment 2 Kalev Lember 2012-04-06 02:05:54 UTC
Created attachment 211444 [details] [review]
starter: Remove unused starter_logo.png
Comment 3 Ignacio Casal Quinteiro (nacho) 2012-04-06 08:47:49 UTC
Review of attachment 211443 [details] [review]:

Some comments inline.

::: plugins/starter/Makefile.am
@@ +12,3 @@
 plugin_LTLIBRARIES = libanjuta-starter.la
 
+starter-resources.c: starter.gresource.xml starter.ui

Just one minor nitpick, let's use something like this here:
$(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/starter.gresource.xml

@@ +40,3 @@
 	$(starter_pixmaps_DATA) \
+	starter.gresource.xml \
+	starter-resources.c \

this is wrong, it is a generated file, $(BUILT_SOURCES) should be in CLEANFILES
Comment 4 Johannes Schmid 2012-04-06 09:08:34 UTC
First thanks a lot for starting on this.

Some comments:

* We need to depend on glib 2.32 in configure.ac - fine but I'd like to wait until the major distros (fedora, ubuntu, opensuse) have released a stable version with the library - shouldn't block the work though.

* I would like to keep the pngs in the source tree and generate the resource files at build time.
Comment 5 Kalev Lember 2012-04-06 12:15:56 UTC
(In reply to comment #4)
> * We need to depend on glib 2.32 in configure.ac - fine but I'd like to wait
> until the major distros (fedora, ubuntu, opensuse) have released a stable
> version with the library - shouldn't block the work though.

Fair enough, I'll revisit this topic in 4 months or so when they are all
released. Looks like openSUSE 12.2 is the last of these three to be released
and is scheduled for July.

By the way, Anjuta already depends on one module from GNOME 3.4 release: gladui
3.11, but I suppose it is different from glib as it's an optional dep.


> * I would like to keep the pngs in the source tree and generate the resource
> files at build time.

Yes, agreed, that was my plan as well.

Regarding the patch that removes starter_logo.png, it is just an unused file
removed. Not really related to the resource framework at all, just an unrelated
cleanup I noticed while poking at the resource stuff. Sorry, should have 
explained better what this commit does.
Comment 6 Kalev Lember 2012-04-06 12:58:07 UTC
Created attachment 211467 [details] [review]
starter: Use glib resource framework for UI files

Thanks nacho, replaced 'starter.ui' with the magical autogenerated dep list and removed generated starter-resources.c from disted files.
Comment 7 Kalev Lember 2012-04-06 15:19:39 UTC
Created attachment 211485 [details] [review]
starter: Use glib resource framework for UI files

One more revision, this time moved BUILT_SOURCES from libanjuta_starter_la_SOURCES to nodist_libanjuta_starter_la_SOURCES to make sure the generated files won't get disted.
Comment 8 Johannes Schmid 2012-04-06 19:57:08 UTC
Hi!

> Fair enough, I'll revisit this topic in 4 months or so when they are all
> released. Looks like openSUSE 12.2 is the last of these three to be released
> and is scheduled for July.
> 
> By the way, Anjuta already depends on one module from GNOME 3.4 release: gladui
> 3.11, but I suppose it is different from glib as it's an optional dep.

Well, lets ditch opensuse for now - but I don't want to merge it before fedora/ubuntu are released because I once messed up my system too much by updating glib. (yeah, I could use jhbuild but well...).

But that doesn't mean you have to stop creating the patches, they are fairly non-intrusive so I should be hard to merge them later an.

Thanks for the hint with the unused file - didn't notice that.
Comment 9 Arnel Borja 2012-05-01 13:42:11 UTC
Can't this be added as an option in the Project Wizard instead of being used always? I think it should be disabled by default though until 2.32 becomes 'common'. Then after a year or shorter, make the option as enabled by default.
Comment 10 Johannes Schmid 2012-05-01 18:12:01 UTC
This will go in anjuta 3.6 which will be a whole cycle after glib 2.32 and as such I don't see that as a general problem.
Comment 11 Johannes Schmid 2012-07-26 14:52:13 UTC
Review of attachment 211485 [details] [review]:

Thanks!
Comment 12 Johannes Schmid 2012-07-26 14:53:03 UTC
Review of attachment 211444 [details] [review]:

Thanks!