Commit e8cdaea3 authored by Felipe Borges's avatar Felipe Borges 👣

printers: Decouple PpSamba and the PpNewPrinterDialog

PpSamba no longer needs to hold a reference to the dialog window.

https://bugzilla.gnome.org/show_bug.cgi?id=760783
parent ebe21b68
......@@ -460,7 +460,7 @@ authenticate_samba_server (GtkButton *button,
{
g_clear_object (&priv->samba_host);
priv->samba_host = pp_samba_new (GTK_WINDOW (priv->dialog), server_name);
priv->samba_host = pp_samba_new (server_name);
g_signal_connect_object (priv->samba_host,
"authentication-required",
G_CALLBACK (on_authentication_required),
......@@ -1562,8 +1562,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);
......@@ -2060,7 +2059,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);
}
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment