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 582502 - Use GtkBuilder instead of libglade
Use GtkBuilder instead of libglade
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
2.27.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks: 572883
 
 
Reported: 2009-05-13 17:37 UTC by André Klapper
Modified: 2009-07-18 13:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove libglade from media-keys plugin (8.07 KB, patch)
2009-07-07 20:48 UTC, Felix Riemann
committed Details | Review
Remove libglade from a11y-keyboard plugin (8.07 KB, patch)
2009-07-07 20:48 UTC, Felix Riemann
none Details | Review
Remove libglade from a11y-keyboard plugin (31.56 KB, patch)
2009-07-07 20:50 UTC, Felix Riemann
none Details | Review
Remove libglade from a11y-keyboard plugin (31.57 KB, patch)
2009-07-07 20:54 UTC, Felix Riemann
needs-work Details | Review
137998: Remove libglade from a11y-keyboard plugin (33.32 KB, patch)
2009-07-10 17:20 UTC, Felix Riemann
none Details | Review
Remove libglade dependency from keyboard plugin (35.31 KB, patch)
2009-07-10 21:49 UTC, Felix Riemann
committed Details | Review
Remove libglade from a11y-keyboard plugin (more reduced error) (32.50 KB, patch)
2009-07-18 12:52 UTC, Felix Riemann
committed Details | Review

Description André Klapper 2009-05-13 17:37:49 UTC
According to http://www.gnome.org/~fpeters/299.html
this module depends on libglade.

In GNOME 2.27, libglade has been deprecated in favor of GtkBuilder. See
http://library.gnome.org/devel/gtk/stable/gtk-migrating-GtkBuilder.html for
migration instructions. Also see
http://live.gnome.org/GnomeGoals/RemoveLibGladeUseGtkBuilder
Comment 1 Felix Riemann 2009-07-07 20:48:04 UTC
Created attachment 137994 [details] [review]
Remove libglade from media-keys plugin
Comment 2 Felix Riemann 2009-07-07 20:48:49 UTC
Created attachment 137995 [details] [review]
Remove libglade from a11y-keyboard plugin
Comment 3 Felix Riemann 2009-07-07 20:49:35 UTC
Can't do the keyboard plugin right now due to xklavier-4.0 dependency
Comment 4 Felix Riemann 2009-07-07 20:50:54 UTC
Created attachment 137996 [details] [review]
Remove libglade from a11y-keyboard plugin

Sorry, attached the same patch twice.
Comment 5 Felix Riemann 2009-07-07 20:54:14 UTC
Created attachment 137998 [details] [review]
Remove libglade from a11y-keyboard plugin

*sigh* another try, this time the version after whitespace correction

Sorry, for the spam.
Comment 6 Jens Granseuer 2009-07-08 18:09:56 UTC
 gsd_a11y_preferences_dialog_init (GsdA11yPreferencesDialog *dialog)
 {
         GtkWidget *widget;
-        GladeXML  *xml;
+	static const gchar *ui_file_path = GTKBUILDERDIR "/" GTKBUILDER_UI_FILE;

Wrong indentation here.

+        g_assert (gtk_builder_add_objects_from_file (builder, ui_file_path,
+                                                     objects, NULL) != 0);

Please don't do that. The assert in the old code shouldn't have been there, either. Not finding the UI description is not a programmer error.
Comment 7 Felix Riemann 2009-07-09 15:17:17 UTC
(In reply to comment #6)
>  gsd_a11y_preferences_dialog_init (GsdA11yPreferencesDialog *dialog)
>  {
>          GtkWidget *widget;
> -        GladeXML  *xml;
> +       static const gchar *ui_file_path = GTKBUILDERDIR "/"
> GTKBUILDER_UI_FILE;
> 
> Wrong indentation here.

Slipped through again. :-)

> 
> +        g_assert (gtk_builder_add_objects_from_file (builder, ui_file_path,
> +                                                     objects, NULL) != 0);
> 
> Please don't do that. The assert in the old code shouldn't have been there,
> either. Not finding the UI description is not a programmer error.
> 

Yes, makes sense in a plugin. What would you like instead? g_warning, g_critical (each with the error message) or nothing?
Comment 8 Jens Granseuer 2009-07-09 17:15:03 UTC
g_warning would be ok but you also need to make sure that the plugin gracefully handles the missing UI and doesn't just crash instead.
Comment 9 Felix Riemann 2009-07-10 17:20:05 UTC
Created attachment 138209 [details] [review]
137998: Remove libglade from a11y-keyboard plugin

This lets the dialog show some error message instead, if the UI file couldn't be loaded.
Comment 10 Jens Granseuer 2009-07-10 17:37:18 UTC
I'd say that's a little overkill...
Comment 11 Felix Riemann 2009-07-10 21:49:08 UTC
Created attachment 138221 [details] [review]
Remove libglade dependency from keyboard plugin

(In reply to comment #10)
> I'd say that's a little overkill...

Well, alternatively one could do pretty much nothing and have it just display the "Close" button. How about that?
Comment 12 Jens Granseuer 2009-07-11 09:08:57 UTC
Considering that this error should never occur when the package is properly installed, just printing the warning and getting out is sufficient IMO. I especially dislike adding translatable strings for errors like this. Ideally, we could also flag the a11y plugin as not started but that's a little difficult with the asynchronous setup we have here.
Comment 13 Felix Riemann 2009-07-11 09:42:01 UTC
Hmm, not sure if that's entirely possible as it's happening in the dialog's _init function.
Comment 14 Thomas Wood 2009-07-12 15:51:42 UTC
Just a note to say the appearance capplet has been converted to GtkBuilder now too. I also have the mouse capplet almost finished.
Comment 15 Felix Riemann 2009-07-18 12:52:58 UTC
Created attachment 138665 [details] [review]
Remove libglade from a11y-keyboard plugin (more reduced error)

This one shows the dialog without the parts from the UI file if it can't be loaded (the Close button is all that's left). Completely skipping the dialog would require bigger changes, as you are not allowed to return NULL from g_object_new.
Comment 16 Jens Granseuer 2009-07-18 13:05:14 UTC
Ok, will do for now. Thanks.
Comment 17 Felix Riemann 2009-07-18 13:18:03 UTC
(In reply to comment #16)
> Ok, will do for now. Thanks.
> 

Ok, paired it with the following commit:

commit d9b2dc9a8ec99fec4f95b4502f73ea58bc3b01d7
Author: Felix Riemann <>
Date:   Sat Jul 18 15:14:22 2009 +0200

    Remove libglade dependency from configure.ac
    
    This concludes bug #582502. G-S-D should be libglade-free now.

 configure.ac |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

gnome-settings-daemon should have no libglade dependency anymore now. :-)