[gnome-control-center] sharing: Add more debug for duplicate folders



commit ec60137db5859274af2fa9d4ac5639a59c95b4ca
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Nov 14 09:16:34 2013 +0100

    sharing: Add more debug for duplicate folders

 panels/sharing/cc-sharing-panel.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index a246654..a5d4235 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -433,6 +433,10 @@ cc_sharing_panel_add_folder (GtkWidget      *button,
                                                    "shared-folders-liststore");
 
   folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog));
+  if (!folder || g_str_equal (folder, ""))
+    goto bail;
+
+  g_debug ("Trying to add %s", folder);
 
   for (valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
        valid;
@@ -445,14 +449,17 @@ cc_sharing_panel_add_folder (GtkWidget      *button,
       g_free (string);
 
       if (matching)
-        break;
+        {
+          g_debug ("Found a duplicate for %s", folder);
+          break;
+        }
     }
 
-  if (!matching && folder && !g_str_equal (folder, ""))
+  if (!matching)
     gtk_list_store_insert_with_values (store, NULL, -1, 0, folder, -1);
 
+bail:
   g_free (folder);
-
   gtk_widget_destroy (dialog);
 }
 


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