[gnome-control-center] Code cleanup based on feedback.



commit c3c58aae3874cfa7ba30f3b8358c726fec43b177
Author: Brandon Nielsen <nielsenb jetfuse net>
Date:   Wed Jul 21 14:51:44 2021 -0500

    Code cleanup based on feedback.

 panels/printers/cc-printers-panel.c     | 21 +++++++++++----------
 panels/printers/pp-details-dialog.c     |  2 +-
 panels/printers/pp-new-printer-dialog.c |  4 ++--
 3 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 939c7e521..880d5a4a0 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -944,17 +944,18 @@ new_printer_dialog_response_cb (GtkDialog *_dialog,
   PpNewPrinterDialog      *pp_new_printer_dialog =  PP_NEW_PRINTER_DIALOG (_dialog);
   g_autoptr(PpNewPrinter)  new_printer = NULL;
 
-  if (response_id == GTK_RESPONSE_OK) {
-    new_printer = pp_new_printer_dialog_get_new_printer (pp_new_printer_dialog);
-    g_object_get(G_OBJECT (new_printer), "name", &self->new_printer_name, NULL);
+  if (response_id == GTK_RESPONSE_OK)
+    {
+      new_printer = pp_new_printer_dialog_get_new_printer (pp_new_printer_dialog);
+      g_object_get(G_OBJECT (new_printer), "name", &self->new_printer_name, NULL);
 
-    actualize_printers_list (self);
+      actualize_printers_list (self);
 
-    pp_new_printer_add_async (new_printer,
-                              cc_panel_get_cancellable (CC_PANEL (self)),
-                              printer_add_async_cb,
-                              self);
-  }
+      pp_new_printer_add_async (new_printer,
+                                cc_panel_get_cancellable (CC_PANEL (self)),
+                                printer_add_async_cb,
+                                self);
+    }
 
   gtk_widget_destroy (GTK_WIDGET (pp_new_printer_dialog));
   self->pp_new_printer_dialog = NULL;
@@ -973,7 +974,7 @@ printer_add_cb (CcPrintersPanel *self)
   gtk_window_set_transient_for (GTK_WINDOW (self->pp_new_printer_dialog),
                                             GTK_WINDOW (toplevel));
 
-  gtk_widget_show (self->pp_new_printer_dialog);
+  gtk_widget_show (GTK_WIDGET (self->pp_new_printer_dialog));
 }
 
 static void
diff --git a/panels/printers/pp-details-dialog.c b/panels/printers/pp-details-dialog.c
index 3d198fa48..65589a7c8 100644
--- a/panels/printers/pp-details-dialog.c
+++ b/panels/printers/pp-details-dialog.c
@@ -219,7 +219,7 @@ select_ppd_in_dialog (PpDetailsDialog *self)
         gtk_window_set_transient_for (GTK_WINDOW (self->pp_ppd_selection_dialog),
                                       GTK_WINDOW (self));
 
-        gtk_widget_show (self->pp_ppd_selection_dialog);
+        gtk_widget_show (GTK_WIDGET (self->pp_ppd_selection_dialog));
     }
 }
 
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index ae6959ee4..9ab17211f 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -390,7 +390,7 @@ device_selection_changed_cb (PpNewPrinterDialog *self)
       gtk_widget_set_sensitive (GTK_WIDGET (self->unlock_button), authentication_needed);
 
       if (authentication_needed)
-        gtk_stack_set_visible_child_name (self->headerbar_topright_buttons, "unlock-button");
+        gtk_stack_set_visible_child_name (self->headerbar_topright_buttons, "unlock_button");
       else
         gtk_stack_set_visible_child_name (self->headerbar_topright_buttons, ADDPRINTER_PAGE);
     }
@@ -1755,7 +1755,7 @@ new_printer_dialog_response_cb (PpNewPrinterDialog *self,
                                             GTK_WINDOW (self));
 
               /* New device will be set at return from ppd selection */
-              gtk_widget_show (self->ppd_selection_dialog);
+              gtk_widget_show (GTK_WIDGET (self->ppd_selection_dialog));
             }
           else
             {


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