[gnome-control-center/wip/feborges/new-addprinter-dialog: 40/44] printers: Do not remove devices from "Add Printer" list



commit 85fc73d8ecb990b78ba65923528ce65b5bcf1e39
Author: Felipe Borges <felipeborges gnome org>
Date:   Sun Dec 11 13:53:02 2016 +0100

    printers: Do not remove devices from "Add Printer" list
    
    Since now the users can dismiss the authentication form and return
    to the printers list in the "Add Printer" dialog, therefore the
    list should be kept as it was before moving into the authentication
    page.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760783

 panels/printers/pp-new-printer-dialog.c |   36 -------------------------------
 1 files changed, 0 insertions(+), 36 deletions(-)
---
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index bc44858..e94d9a3 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -75,8 +75,6 @@ static void     new_printer_dialog_response_cb (GtkDialog *_dialog,
 static void     update_dialog_state (PpNewPrinterDialog *dialog);
 static void     add_devices_to_list (PpNewPrinterDialog  *dialog,
                                      GList               *devices);
-static void     remove_device_from_list (PpNewPrinterDialog *dialog,
-                                         const gchar        *device_name);
 
 enum
 {
@@ -291,9 +289,6 @@ get_authenticated_samba_devices_cb (GObject      *source_object,
 
       if (!cancelled)
         {
-          remove_device_from_list (dialog,
-                                   data->server_name);
-
           if (result->devices != NULL)
             {
               add_devices_to_list (dialog, result->devices);
@@ -636,37 +631,6 @@ device_selection_changed_cb (GtkTreeSelection *selection,
     }
 }
 
-static void
-remove_device_from_list (PpNewPrinterDialog *dialog,
-                         const gchar        *device_name)
-{
-  PpNewPrinterDialogPrivate *priv = dialog->priv;
-  PpPrintDevice             *device;
-  GtkTreeIter                iter;
-  gboolean                   cont;
-
-  cont = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store), &iter);
-  while (cont)
-    {
-      gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter,
-                          DEVICE_COLUMN, &device,
-                          -1);
-
-      if (g_strcmp0 (pp_print_device_get_device_name (device), device_name) == 0)
-        {
-          gtk_list_store_remove (priv->store, &iter);
-          g_object_unref (device);
-          break;
-        }
-
-      g_object_unref (device);
-
-      cont = gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store), &iter);
-    }
-
-  update_dialog_state (dialog);
-}
-
 static gboolean
 prepend_original_name (GtkTreeModel *model,
                        GtkTreePath  *path,


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