summaryrefslogtreecommitdiff
path: root/gtk/gtkprintoperation.c
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-08-24 16:10:38 +0200
committerJavier Jardón <jjardon@gnome.org>2010-08-24 16:16:42 +0200
commitc05f344c0a5c7bd1096dd7bd10c99a0e585826d2 (patch)
treeeaded4d0360099f7c2882cd346d0d2f848136c84 /gtk/gtkprintoperation.c
parent891694d9ffae1c8e949cfb3fb39d726ad30ca4f4 (diff)
downloadgtk+-c05f344c0a5c7bd1096dd7bd10c99a0e585826d2.tar.gz
Use gtk_window_has_group() to know if the window has an explicit window group.
gtk_window_get_group() never returns NULL; if the window isn't in a group, a default window group is returned instead. Use gtk_window_has_group() instead. This fixes some previous commits to use accessors to access GtkWindow. Reported by Philip Withnall in bug https://bugzilla.gnome.org/show_bug.cgi?id=627828
Diffstat (limited to 'gtk/gtkprintoperation.c')
-rw-r--r--gtk/gtkprintoperation.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index 69c542c7f5..d043e4fece 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -2924,7 +2924,6 @@ print_pages (GtkPrintOperation *op,
if (!handled)
{
GtkWidget *error_dialog;
- GtkWindowGroup *group;
error_dialog = gtk_message_dialog_new (parent,
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -2935,12 +2934,9 @@ print_pages (GtkPrintOperation *op,
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (error_dialog),
_("The most probable reason is that a temporary file could not be created."));
- if (parent)
- {
- group = gtk_window_get_group (parent);
- if (group)
- gtk_window_group_add_window (group, GTK_WINDOW (error_dialog));
- }
+ if (parent && gtk_window_has_group (parent))
+ gtk_window_group_add_window (gtk_window_get_group (parent),
+ GTK_WINDOW (error_dialog));
g_signal_connect (error_dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);