From b0b43d149471e3463fedaa0ba80e0c315c810ce0 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 14 Nov 2013 08:22:05 +0000 Subject: sharing: Fix Bluetooth label always being off https://bugzilla.gnome.org/show_bug.cgi?id=712252 --- diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c index 586085d..a246654 100644 --- a/panels/sharing/cc-sharing-panel.c +++ b/panels/sharing/cc-sharing-panel.c @@ -384,6 +384,10 @@ cc_sharing_panel_setup_bluetooth_sharing_dialog (CcSharingPanel *self) g_signal_connect_swapped (priv->bluetooth_killswitch, "state-changed", G_CALLBACK (bluetooth_state_changed), self); + cc_sharing_panel_bind_switch_to_label (self, + WID ("save-received-files-to-downloads-switch"), + WID ("bluetooth-sharing-status-label")); + cc_sharing_panel_bind_switch_to_widgets (WID ("save-received-files-to-downloads-switch"), WID ("receive-files-grid"), NULL); -- cgit v0.9.2 From db7f29b67579e02a7c8c49c135da994f409928b1 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 14 Nov 2013 08:16:34 +0000 Subject: sharing: Add more debug for duplicate folders --- 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); } -- cgit v0.9.2 From 40d672cce3b700f08baa36da7f2c7f00f322e30f Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 14 Nov 2013 08:25:30 +0000 Subject: sharing: Make it possible to add new folders The media panel wouldn't let you add more folder because the test for equality was reversed. https://bugzilla.gnome.org/show_bug.cgi?id=710580 --- diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c index a5d4235..1782180 100644 --- a/panels/sharing/cc-sharing-panel.c +++ b/panels/sharing/cc-sharing-panel.c @@ -445,7 +445,7 @@ cc_sharing_panel_add_folder (GtkWidget *button, gchar *string; gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, 0, &string, -1); - matching = (g_strcmp0 (string, folder) != 0); + matching = (g_strcmp0 (string, folder) == 0); g_free (string); if (matching) -- cgit v0.9.2 From f5ec0cd8d6e41628d8a6663f448988aeec2885a2 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 14 Nov 2013 22:46:00 +0000 Subject: sharing: Fix crash when turning off Sharing Another fallout from: 05a4f6d3d9620782fa5d1a279ef84c11701247d1 https://bugzilla.gnome.org/show_bug.cgi?id=712338 --- diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c index 1782180..8947e80 100644 --- a/panels/sharing/cc-sharing-panel.c +++ b/panels/sharing/cc-sharing-panel.c @@ -100,7 +100,7 @@ cc_sharing_panel_master_switch_notify (GtkSwitch *gtkswitch, gtk_switch_set_active (GTK_SWITCH (WID ("share-public-folder-on-network-switch")), FALSE); gtk_switch_set_active (GTK_SWITCH (WID ("share-media-switch")), FALSE); - gtk_switch_set_active (GTK_SWITCH (WID ("share-public-folder-switch")), + gtk_switch_set_active (GTK_SWITCH (WID ("save-received-files-to-downloads-switch")), FALSE); } -- cgit v0.9.2 From f730abd6a3ee86cf90eef79609a0f8e1538827b8 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 14 Nov 2013 22:55:04 +0000 Subject: sharing: Fix compile time warning Another warning in cc_sharing_panel_add_folder() --- diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c index 8947e80..db0089b 100644 --- a/panels/sharing/cc-sharing-panel.c +++ b/panels/sharing/cc-sharing-panel.c @@ -417,7 +417,7 @@ cc_sharing_panel_add_folder (GtkWidget *button, gchar *folder; GtkTreeIter iter; gboolean valid; - gboolean matching; + gboolean matching = FALSE; dialog = gtk_file_chooser_dialog_new (_("Choose a Folder"), GTK_WINDOW (gtk_widget_get_toplevel (button)), -- cgit v0.9.2