[gnome-control-center/gnome-41] Simplify callback logic in ppd_selection_cb.



commit badd326299e55ca751a7a24e6e314a2f069f3262
Author: Brandon Nielsen <nielsenb jetfuse net>
Date:   Mon Jan 31 14:45:43 2022 -0600

    Simplify callback logic in ppd_selection_cb.
    
    This ensures user_callback does not get called twice when cancelling out
    of the ppd selection dialog. Fixes #1599, introduced with 179bda1b / MR: 1011.

 panels/printers/pp-new-printer-dialog.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index 9ab17211f..aa1274ada 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -1671,9 +1671,6 @@ ppd_selection_cb (GtkDialog *_dialog,
       ppd_name = pp_ppd_selection_dialog_get_ppd_name (self->ppd_selection_dialog);
       ppd_display_name = pp_ppd_selection_dialog_get_ppd_display_name (self->ppd_selection_dialog);
   }
-  else {
-      self->user_callback (GTK_DIALOG (self), GTK_RESPONSE_CANCEL, self->user_data);
-  }
 
   if (ppd_name)
     {
@@ -1712,7 +1709,7 @@ ppd_selection_cb (GtkDialog *_dialog,
         }
     }
 
-  self->user_callback (GTK_DIALOG (self), GTK_RESPONSE_OK, self->user_data);
+  self->user_callback (GTK_DIALOG (self), response_id, self->user_data);
 }
 
 static void


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