[gnome-control-center/wip/feborges/new-addprinter-dialog: 5/7] printers: Decouple PpSamba and the PpNewPrinterDialog



commit 96d060bff08dfff512183fff6d881b893214d3ad
Author: Felipe Borges <felipeborges gnome org>
Date:   Sat Nov 12 15:55:47 2016 +0100

    printers: Decouple PpSamba and the PpNewPrinterDialog
    
    PpSamba no longer needs to hold a reference to the dialog window.

 panels/printers/pp-new-printer-dialog.c |    8 +++-----
 panels/printers/pp-samba.c              |    3 +--
 panels/printers/pp-samba.h              |    3 +--
 3 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index de35a62..1aae7ab 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -455,8 +455,7 @@ authenticate_samba_server (GtkButton *button,
 
       if (server_name != NULL)
         {
-          samba_host = pp_samba_new (GTK_WINDOW (priv->dialog),
-                                     server_name);
+          samba_host = pp_samba_new (server_name);
           g_signal_connect (samba_host,
                             "authentication-required",
                             G_CALLBACK (on_authentication_required),
@@ -1558,8 +1557,7 @@ search_for_remote_printers (THostSearchData *data)
         g_object_set (priv->lpd_host, "port", data->host_port, NULL);
     }
 
-  priv->samba_host = pp_samba_new (GTK_WINDOW (priv->dialog),
-                                   data->host_name);
+  priv->samba_host = pp_samba_new (data->host_name);
 
   update_dialog_state (data->dialog);
 
@@ -2056,7 +2054,7 @@ populate_devices_list (PpNewPrinterDialog *dialog)
   priv->samba_searching = TRUE;
   update_dialog_state (dialog);
 
-  samba = pp_samba_new (GTK_WINDOW (priv->dialog), NULL);
+  samba = pp_samba_new (NULL);
   pp_samba_get_devices_async (samba, FALSE, priv->cancellable, get_samba_devices_cb, dialog);
 }
 
diff --git a/panels/printers/pp-samba.c b/panels/printers/pp-samba.c
index fb56e9d..57f374f 100644
--- a/panels/printers/pp-samba.c
+++ b/panels/printers/pp-samba.c
@@ -76,8 +76,7 @@ pp_samba_init (PpSamba *samba)
 }
 
 PpSamba *
-pp_samba_new (GtkWindow   *parent,
-              const gchar *hostname)
+pp_samba_new (const gchar *hostname)
 {
   return g_object_new (PP_TYPE_SAMBA,
                        "hostname", hostname,
diff --git a/panels/printers/pp-samba.h b/panels/printers/pp-samba.h
index 03c8e5d..6505448 100644
--- a/panels/printers/pp-samba.h
+++ b/panels/printers/pp-samba.h
@@ -50,8 +50,7 @@ struct _PpSambaClass
 
 GType          pp_samba_get_type           (void) G_GNUC_CONST;
 
-PpSamba       *pp_samba_new                (GtkWindow           *parent,
-                                            const gchar         *hostname);
+PpSamba       *pp_samba_new                (const gchar         *hostname);
 
 void           pp_samba_get_devices_async  (PpSamba             *samba,
                                             gboolean             auth_if_needed,


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