[goffice] GUI: Make it clear that a file chooser hack can go post gtk+ 3.4



commit 7579d99cd517dd4cd61f01ff3ed33b8b24c23029
Author: Morten Welinder <terra gnome org>
Date:   Tue Apr 16 20:54:46 2013 -0400

    GUI: Make it clear that a file chooser hack can go post gtk+ 3.4

 ChangeLog                 |  5 +++++
 goffice/gtk/goffice-gtk.c | 20 ++++++++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 344c566..8a4720c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-16  Morten Welinder  <terra gnome org>
+
+       * goffice/gtk/goffice-gtk.c (go_gtk_file_sel_dialog): Don't use
+       hack post gtk+ 3.4.
+
 2013-04-16  Jean Brefort  <jean brefort normalesup org>
 
        * goffice/utils/go-editor.c (go_editor_add_page): add a reference to the
diff --git a/goffice/gtk/goffice-gtk.c b/goffice/gtk/goffice-gtk.c
index 355c3af..aa546a1 100644
--- a/goffice/gtk/goffice-gtk.c
+++ b/goffice/gtk/goffice-gtk.c
@@ -718,6 +718,7 @@ gu_delete_handler (GtkDialog *dialog,
        return TRUE; /* Do not destroy */
 }
 
+#if !GTK_CHECK_VERSION(3,4,0)
 static void
 recent_func_log_func (G_GNUC_UNUSED const gchar   *log_domain,
                      G_GNUC_UNUSED GLogLevelFlags log_level,
@@ -727,6 +728,7 @@ recent_func_log_func (G_GNUC_UNUSED const gchar   *log_domain,
        /* We just want to suppress the warnings */
        /* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
 }
+#endif
 
 /**
  * go_gtk_file_sel_dialog:
@@ -742,8 +744,6 @@ go_gtk_file_sel_dialog (GtkWindow *toplevel, GtkWidget *w)
 {
        gboolean result = FALSE;
        gulong delete_handler;
-       guint log_handler;
-       const char *domain = "Gtk";
 
        g_return_val_if_fail (GTK_IS_WINDOW (toplevel), FALSE);
        g_return_val_if_fail (GTK_IS_FILE_CHOOSER (w), FALSE);
@@ -758,13 +758,21 @@ go_gtk_file_sel_dialog (GtkWindow *toplevel, GtkWidget *w)
        gtk_widget_show (w);
        gtk_grab_add (w);
 
+#if GTK_CHECK_VERSION(3,4,0)
+       gtk_main ();
+#else
        /* Hack: the gtk file dialog warns when it can't access a new file, so shut it up.  */
        /* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
        /* This hack should be unneccessary in GTK 3.3.5 and later  */
-       log_handler = g_log_set_handler (domain, G_LOG_LEVEL_WARNING,
-                                        recent_func_log_func, NULL);
-       gtk_main ();
-       g_log_remove_handler (domain, log_handler);
+       {
+               const char *domain = "Gtk";
+               guint log_handler =
+                       g_log_set_handler (domain, G_LOG_LEVEL_WARNING,
+                                          recent_func_log_func, NULL);
+               gtk_main ();
+               g_log_remove_handler (domain, log_handler);
+       }
+#endif
 
        g_signal_handler_disconnect (w, delete_handler);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]