diff -Nru nemo-2.8.4/configure.ac nemo-2.8.5/configure.ac --- nemo-2.8.4/configure.ac 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/configure.ac 2015-11-20 17:28:32.000000000 +0000 @@ -18,7 +18,7 @@ m4_define(nemo_extension_current, 5) m4_define(nemo_extension_revision, 0) -AC_INIT(nemo, 2.8.4, https://github.com/linuxmint/nemo) +AC_INIT(nemo, 2.8.5, https://github.com/linuxmint/nemo) dnl =========================================================================== diff -Nru nemo-2.8.4/debian/changelog nemo-2.8.5/debian/changelog --- nemo-2.8.4/debian/changelog 2015-11-12 10:05:31.000000000 +0000 +++ nemo-2.8.5/debian/changelog 2015-11-24 10:21:34.000000000 +0000 @@ -1,4 +1,10 @@ -nemo (2.8.4-1~webupd8~wily01) wily; urgency=high +nemo (2.8.5-1~webupd8~wily01) wily; urgency=high + + * New upstream bugfix release + + -- Alin Andrei Tue, 24 Nov 2015 12:18:14 +0200 + +nemo (2.8.4-1~webupd8~trusty01) trusty; urgency=high * New upstream bugfix release diff -Nru nemo-2.8.4/libnemo-private/nemo-bookmark.c nemo-2.8.5/libnemo-private/nemo-bookmark.c --- nemo-2.8.4/libnemo-private/nemo-bookmark.c 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/libnemo-private/nemo-bookmark.c 2015-11-20 17:28:32.000000000 +0000 @@ -42,6 +42,7 @@ enum { CONTENTS_CHANGED, + LOCATION_MOUNTED, LAST_SIGNAL }; @@ -65,7 +66,6 @@ GFile *location; GIcon *icon; NemoFile *file; - gboolean visited; char *scroll_file; }; @@ -95,7 +95,7 @@ return; } - if (!nemo_file_is_local (bookmark->details->file) && !bookmark->details->visited) { + if (!nemo_file_is_local (bookmark->details->file)) { /* never update icons for remote bookmarks */ return; } @@ -127,9 +127,9 @@ display_name = nemo_file_get_display_name (self->details->file); if (nemo_file_is_home (self->details->file)) { - nemo_bookmark_set_name_internal (self, _("Home")); + nemo_bookmark_set_custom_name (self, _("Home")); } else if (g_strcmp0 (self->details->name, display_name) != 0) { - nemo_bookmark_set_name_internal (self, display_name); + nemo_bookmark_set_custom_name (self, display_name); DEBUG ("%s: name changed to %s", nemo_bookmark_get_name (self), display_name); } @@ -222,7 +222,6 @@ DEBUG ("%s: trashed", nemo_bookmark_get_name (bookmark)); nemo_bookmark_disconnect_file (bookmark); nemo_bookmark_set_icon_to_default (bookmark); - bookmark->details->visited = FALSE; } else { nemo_bookmark_update_icon (bookmark); bookmark_set_name_from_ready_file (bookmark, file); @@ -236,9 +235,10 @@ DEBUG ("%s: disconnecting file", nemo_bookmark_get_name (bookmark)); - g_signal_handlers_disconnect_by_func (bookmark->details->file, - G_CALLBACK (bookmark_file_changed_callback), - bookmark); + g_signal_handlers_disconnect_by_func (bookmark->details->file, + G_CALLBACK (bookmark_file_changed_callback), + bookmark); + g_clear_object (&bookmark->details->file); } } @@ -252,7 +252,7 @@ return; } - if (nemo_bookmark_uri_get_exists (bookmark) || bookmark->details->visited) { + if (nemo_bookmark_uri_get_exists (bookmark)) { DEBUG ("%s: creating file", nemo_bookmark_get_name (bookmark)); bookmark->details->file = nemo_file_get (bookmark->details->location); @@ -260,7 +260,8 @@ g_assert (!nemo_file_is_gone (bookmark->details->file)); g_signal_connect_object (bookmark->details->file, "changed", - G_CALLBACK (bookmark_file_changed_callback), bookmark, 0); + G_CALLBACK (bookmark_file_changed_callback), + bookmark, 0); } /* Set icon based on available information. */ @@ -364,14 +365,6 @@ } static void -nemo_bookmark_constructed (GObject *obj) -{ - NemoBookmark *self = NEMO_BOOKMARK (obj); - - nemo_bookmark_connect_file (self); -} - -static void nemo_bookmark_class_init (NemoBookmarkClass *class) { GObjectClass *oclass = G_OBJECT_CLASS (class); @@ -379,7 +372,6 @@ oclass->finalize = nemo_bookmark_finalize; oclass->get_property = nemo_bookmark_get_property; oclass->set_property = nemo_bookmark_set_property; - oclass->constructed = nemo_bookmark_constructed; signals[CONTENTS_CHANGED] = g_signal_new ("contents-changed", @@ -390,6 +382,16 @@ g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + signals[LOCATION_MOUNTED] = + g_signal_new ("location-mounted", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NemoBookmarkClass, location_mounted), + NULL, NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, 1, + G_TYPE_FILE); + properties[PROP_NAME] = g_param_spec_string ("name", "Bookmark's name", @@ -428,8 +430,6 @@ { bookmark->details = G_TYPE_INSTANCE_GET_PRIVATE (bookmark, NEMO_TYPE_BOOKMARK, NemoBookmarkDetails); - - bookmark->details->visited = FALSE; } const gchar * @@ -585,16 +585,6 @@ return uri; } -void -nemo_bookmark_set_visited (NemoBookmark *bookmark, gboolean visited) -{ - g_return_if_fail (NEMO_IS_BOOKMARK (bookmark)); - - bookmark->details->visited = visited; - - nemo_bookmark_connect_file (bookmark); -} - NemoBookmark * nemo_bookmark_new (GFile *location, const gchar *custom_name, @@ -668,16 +658,16 @@ nemo_bookmark_uri_get_exists (NemoBookmark *bookmark) { char *path_name; - gboolean exists; + gboolean exists = FALSE; - /* Convert to a path, returning FALSE if not local. */ - if (!g_file_is_native (bookmark->details->location)) { - return FALSE; - } - path_name = g_file_get_path (bookmark->details->location); + path_name = g_file_get_path (bookmark->details->location); + + if (g_file_is_native (bookmark->details->location) && g_file_test (path_name, G_FILE_TEST_EXISTS)) { + exists = TRUE; + } else { + g_signal_emit_by_name (bookmark, "location-mounted", bookmark->details->location, &exists); + } - /* Now check if the file exists (sync. call OK because it is local). */ - exists = g_file_test (path_name, G_FILE_TEST_EXISTS); g_free (path_name); return exists; @@ -696,3 +686,9 @@ { return g_strdup (bookmark->details->scroll_file); } + +void +nemo_bookmark_connect (NemoBookmark *bookmark) +{ + nemo_bookmark_connect_file (bookmark); +} \ No newline at end of file diff -Nru nemo-2.8.4/libnemo-private/nemo-bookmark.h nemo-2.8.5/libnemo-private/nemo-bookmark.h --- nemo-2.8.4/libnemo-private/nemo-bookmark.h 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/libnemo-private/nemo-bookmark.h 2015-11-20 17:28:32.000000000 +0000 @@ -59,6 +59,8 @@ * (custom name or URI) changed. */ void (* contents_changed) (NemoBookmark *bookmark); + + gboolean (* location_mounted) (GFile *location); }; typedef struct NemoBookmarkClass NemoBookmarkClass; @@ -76,8 +78,6 @@ void nemo_bookmark_set_custom_name (NemoBookmark *bookmark, const char *new_name); gboolean nemo_bookmark_uri_get_exists (NemoBookmark *bookmark); -void nemo_bookmark_set_visited (NemoBookmark *bookmark, - gboolean visited); int nemo_bookmark_compare_with (gconstpointer a, gconstpointer b); int nemo_bookmark_compare_uris (gconstpointer a, @@ -91,4 +91,6 @@ /* Helper functions for displaying bookmarks */ GtkWidget * nemo_bookmark_menu_item_new (NemoBookmark *bookmark); +void nemo_bookmark_connect (NemoBookmark *bookmark); + #endif /* NEMO_BOOKMARK_H */ diff -Nru nemo-2.8.4/libnemo-private/nemo-icon-container.c nemo-2.8.5/libnemo-private/nemo-icon-container.c --- nemo-2.8.4/libnemo-private/nemo-icon-container.c 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/libnemo-private/nemo-icon-container.c 2015-11-20 17:28:32.000000000 +0000 @@ -206,6 +206,10 @@ static void store_layout_timestamps_now (NemoIconContainer *container); static void remove_search_entry_timeout (NemoIconContainer *container); +static gboolean handle_icon_slow_two_click (NemoIconContainer *container, + NemoIcon *icon, + GdkEventButton *event); + static gpointer accessible_parent_class; static GQuark accessible_private_data_quark = 0; @@ -4427,7 +4431,7 @@ signals[SELECTION_CHANGED], 0); } } - } + } if (details->drag_icon != NULL && (details->single_click_mode || @@ -4470,6 +4474,12 @@ } } } + + if (details->drag_icon != NULL && + handle_icon_slow_two_click (container, details->drag_icon, event)) { + if (!details->skip_rename_on_release) + nemo_icon_container_start_renaming_selected_item (container, FALSE); + } } static gboolean @@ -5579,7 +5589,7 @@ /* We pass the event to the search_entry. If its text changes, then we * start the typeahead find capabilities. * Copied from NemoIconContainer */ - if (!handled && + if (!handled && !nemo_icon_container_get_is_desktop (container) && event->keyval != GDK_KEY_asciitilde && event->keyval != GDK_KEY_KP_Divide && event->keyval != GDK_KEY_slash /* don't steal slash key events, used for "go to" */ && @@ -6296,6 +6306,8 @@ tooltip_prefs_changed_callback (container); + details->skip_rename_on_release = FALSE; + if (!setup_prefs) { g_signal_connect_swapped (nemo_icon_view_preferences, "changed::" NEMO_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT, @@ -6381,7 +6393,6 @@ details->double_click_icon[0] == details->double_click_icon[1] && details->double_click_button[0] == details->double_click_button[1]) { if (!button_event_modifies_selection (event)) { - nemo_icon_container_start_renaming_selected_item (container, FALSE); return TRUE; } } @@ -6409,6 +6420,8 @@ details = container->details; + details->skip_rename_on_release = FALSE; + if (event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS) { return TRUE; } @@ -6429,8 +6442,7 @@ details->double_click_button[0] = event->button; } - if (handle_icon_double_click (container, icon, event) || - handle_icon_slow_two_click (container, icon, event)) { + if (handle_icon_double_click (container, icon, event)) { /* Double clicking does not trigger a D&D action. */ details->drag_button = 0; details->drag_icon = NULL; @@ -6460,7 +6472,11 @@ * the same way for contextual menu as it would be without. */ details->icon_selected_on_button_down = icon->is_selected; - + + GList *sel = nemo_icon_container_get_selected_icons (container); + details->skip_rename_on_release = g_list_length (sel) > 1; + g_list_free (sel); + if ((event->button == DRAG_BUTTON || event->button == MIDDLE_BUTTON) && (event->state & GDK_SHIFT_MASK) != 0) { NemoIcon *start_icon; diff -Nru nemo-2.8.4/libnemo-private/nemo-icon-private.h nemo-2.8.5/libnemo-private/nemo-icon-private.h --- nemo-2.8.4/libnemo-private/nemo-icon-private.h 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/libnemo-private/nemo-icon-private.h 2015-11-20 17:28:32.000000000 +0000 @@ -175,6 +175,8 @@ NemoIcon *double_click_icon[2]; /* Both clicks in a double click need to be on the same icon */ guint double_click_button[2]; + gboolean skip_rename_on_release; + NemoIcon *range_selection_base_icon; /* Renaming Details */ diff -Nru nemo-2.8.4/src/nemo-bookmark-list.c nemo-2.8.5/src/nemo-bookmark-list.c --- nemo-2.8.4/src/nemo-bookmark-list.c 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/src/nemo-bookmark-list.c 2015-11-20 17:28:32.000000000 +0000 @@ -133,6 +133,41 @@ g_signal_emit (bookmarks, signals[CHANGED], 0); } +static gboolean +bookmark_location_mounted_callback (NemoBookmark *bookmark, + GFile *location, + NemoBookmarkList *bookmarks) +{ + gboolean ret = FALSE; + + GList *volumes = g_volume_monitor_get_mounts (bookmarks->volume_monitor); + GList *iter = volumes; + + while (iter != NULL) { + GMount *mount = G_MOUNT (iter->data); + GFile *mount_location = g_mount_get_root (mount); + + gchar *mount_root_uri = g_file_get_uri (mount_location); + gchar *location_uri = g_file_get_uri (location); + + ret = g_str_has_prefix (location_uri, mount_root_uri); + + g_free (mount_root_uri); + g_free (location_uri); + + g_object_unref (mount_location); + + if (ret == TRUE) + break; + + iter = iter->next; + } + + g_list_free_full (volumes, (GDestroyNotify) g_object_unref); + + return ret; +} + static void stop_monitoring_bookmark (NemoBookmarkList *bookmarks, NemoBookmark *bookmark) @@ -140,6 +175,9 @@ g_signal_handlers_disconnect_by_func (bookmark, bookmark_in_list_changed_callback, bookmarks); + g_signal_handlers_disconnect_by_func (bookmark, + bookmark_location_mounted_callback, + bookmarks); } static void @@ -172,6 +210,8 @@ clear_bookmarks (NEMO_BOOKMARK_LIST (object)); + g_object_unref (NEMO_BOOKMARK_LIST (object)->volume_monitor); + G_OBJECT_CLASS (nemo_bookmark_list_parent_class)->finalize (object); } @@ -230,6 +270,14 @@ } static void +volume_monitor_activity_cb (GVolumeMonitor *monitor, GMount *mount, gpointer user_data) +{ + NemoBookmarkList *bookmarks = NEMO_BOOKMARK_LIST (user_data); + + nemo_bookmark_list_load_file (bookmarks); +} + +static void nemo_bookmark_list_init (NemoBookmarkList *bookmarks) { GFile *file; @@ -246,6 +294,15 @@ G_CALLBACK (bookmark_monitor_changed_cb), bookmarks); g_object_unref (file); + + bookmarks->volume_monitor = g_volume_monitor_get (); + + g_signal_connect (bookmarks->volume_monitor, "mount-added", + G_CALLBACK (volume_monitor_activity_cb), bookmarks); + g_signal_connect (bookmarks->volume_monitor, "mount-removed", + G_CALLBACK (volume_monitor_activity_cb), bookmarks); + g_signal_connect (bookmarks->volume_monitor, "mount-changed", + G_CALLBACK (volume_monitor_activity_cb), bookmarks); } static void @@ -255,12 +312,16 @@ { bookmarks->list = g_list_insert (bookmarks->list, bookmark, index); + g_signal_connect_object (bookmark, "location-mounted", + G_CALLBACK (bookmark_location_mounted_callback), bookmarks, 0); g_signal_connect_object (bookmark, "contents-changed", G_CALLBACK (bookmark_in_list_changed_callback), bookmarks, 0); g_signal_connect_object (bookmark, "notify::icon", G_CALLBACK (bookmark_in_list_notify), bookmarks, 0); g_signal_connect_object (bookmark, "notify::name", G_CALLBACK (bookmark_in_list_notify), bookmarks, 0); + + nemo_bookmark_connect (bookmark); } /** diff -Nru nemo-2.8.4/src/nemo-bookmark-list.h nemo-2.8.5/src/nemo-bookmark-list.h --- nemo-2.8.4/src/nemo-bookmark-list.h 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/src/nemo-bookmark-list.h 2015-11-20 17:28:32.000000000 +0000 @@ -52,6 +52,7 @@ GList *list; GFileMonitor *monitor; GQueue *pending_ops; + GVolumeMonitor *volume_monitor; }; struct NemoBookmarkListClass { diff -Nru nemo-2.8.4/src/nemo-list-view.c nemo-2.8.5/src/nemo-list-view.c --- nemo-2.8.4/src/nemo-list-view.c 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/src/nemo-list-view.c 2015-11-20 17:28:32.000000000 +0000 @@ -91,6 +91,7 @@ int drag_x; int drag_y; + gboolean rename_on_release; gboolean drag_started; gboolean ignore_button_release; gboolean row_selected_on_button_down; @@ -398,9 +399,17 @@ activate_selected_items_alternate (view, NULL, TRUE); } } + + if (view->details->rename_on_release) { + NemoFile *file = nemo_list_model_file_for_path (view->details->model, path); + nemo_list_view_start_renaming_file (NEMO_VIEW (view), file, FALSE); + nemo_file_unref (file); + view->details->rename_on_release = FALSE; + } + gtk_tree_path_free (path); } - + } static void @@ -867,7 +876,7 @@ return FALSE; /* Only allow second click on text to trigger this */ - if (slow_click_count == 1 && + if (slow_click_count == 1 && view->details->double_click_path[1] && gtk_tree_path_compare (view->details->double_click_path[0], view->details->double_click_path[1]) == 0 && clicked_on_text_in_name_cell (view, path, event)) { slow_click_count = 0; @@ -923,6 +932,7 @@ { NemoListViewDetails *details; NemoFile *file; + gboolean can_rename; details = view->details; @@ -930,16 +940,14 @@ return FALSE; file = nemo_list_model_file_for_path (view->details->model, path); + can_rename = nemo_file_can_rename (file); + nemo_file_unref (file); - if (!nemo_file_can_rename (file)) + if (!can_rename) return FALSE; - if (clicked_within_slow_click_interval_on_text (view, path, event) && view->details->double_click_path[1] && - gtk_tree_path_compare (view->details->double_click_path[0], view->details->double_click_path[1]) == 0) { - if (!button_event_modifies_selection (event)) { - nemo_list_view_start_renaming_file (NEMO_VIEW (view), file, FALSE); - return TRUE; - } + if (clicked_within_slow_click_interval_on_text (view, path, event) && !button_event_modifies_selection (event)) { + return TRUE; } return FALSE; @@ -1016,13 +1024,16 @@ view->details->double_click_path[0] = gtk_tree_path_copy (path); } - if (handle_icon_double_click (view, path, event, on_expander) || - handle_icon_slow_two_click (view, path, event)) { + if (handle_icon_double_click (view, path, event, on_expander)) { /* Double clicking does not trigger a D&D action. */ view->details->drag_button = 0; } else { - + /* queue up renaming if we've clicked within the slow-click timeframe. Don't actually + do it, however, until there's a button release (this allows dragging to occur on + single items, without triggering rename) */ + view->details->rename_on_release = handle_icon_slow_two_click (view, path, event); + /* We're going to filter out some situations where * we can't let the default code run because all * but one row would be would be deselected. We don't diff -Nru nemo-2.8.4/src/nemo-places-sidebar.c nemo-2.8.5/src/nemo-places-sidebar.c --- nemo-2.8.4/src/nemo-places-sidebar.c 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/src/nemo-places-sidebar.c 2015-11-20 17:28:32.000000000 +0000 @@ -144,6 +144,8 @@ guint popup_menu_action_index; + guint update_places_on_idle_id; + } NemoPlacesSidebar; typedef struct { @@ -229,6 +231,8 @@ static void update_places (NemoPlacesSidebar *sidebar); +static void update_places_on_idle (NemoPlacesSidebar *sidebar); + /* Identifiers for target types */ enum { GTK_TREE_MODEL_ROW, @@ -711,7 +715,6 @@ char *tooltip; gchar *tooltip_info; GList *network_mounts, *network_volumes; - NemoFile *file; gint full; DEBUG ("Updating places sidebar"); @@ -781,20 +784,21 @@ /* add bookmarks */ bookmark_count = nemo_bookmark_list_length (sidebar->bookmarks); /* in certain situations (i.e. removed a bookmark), the breakpoint is smaller than - * the number of bookmarks - make sure to fix this before iterating through a list of them + * the number of bookmarks - make sure to fix this before iterating through a list of them. + * We don't overwrite the stored breakpoint because the bookmark list could simply be reloading, + * and we want the original number still when we update places again. */ - if (sidebar->bookmark_breakpoint < 0 || - sidebar->bookmark_breakpoint > bookmark_count) { - sidebar->bookmark_breakpoint = bookmark_count; + gint temp_breakpoint = sidebar->bookmark_breakpoint; + + if (temp_breakpoint < 0 || + temp_breakpoint > bookmark_count) { + temp_breakpoint = bookmark_count; } - for (bookmark_index = 0; bookmark_index < sidebar->bookmark_breakpoint; ++bookmark_index) { + for (bookmark_index = 0; bookmark_index < temp_breakpoint; ++bookmark_index) { bookmark = nemo_bookmark_list_item_at (sidebar->bookmarks, bookmark_index); root = nemo_bookmark_get_location (bookmark); - file = nemo_file_get (root); - - nemo_file_unref (file); bookmark_name = nemo_bookmark_get_name (bookmark); icon = nemo_bookmark_get_icon (bookmark); @@ -862,9 +866,6 @@ bookmark = nemo_bookmark_list_item_at (sidebar->bookmarks, bookmark_index); root = nemo_bookmark_get_location (bookmark); - file = nemo_file_get (root); - - nemo_file_unref (file); bookmark_name = nemo_bookmark_get_name (bookmark); icon = nemo_bookmark_get_icon (bookmark); @@ -1184,7 +1185,7 @@ GMount *mount, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static void @@ -1192,7 +1193,7 @@ GMount *mount, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static void @@ -1200,7 +1201,7 @@ GMount *mount, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static void @@ -1208,7 +1209,7 @@ GVolume *volume, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static void @@ -1216,7 +1217,7 @@ GVolume *volume, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static void @@ -1224,7 +1225,7 @@ GVolume *volume, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static void @@ -1232,7 +1233,7 @@ GDrive *drive, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static void @@ -1240,7 +1241,7 @@ GDrive *drive, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static void @@ -1248,7 +1249,7 @@ GDrive *drive, NemoPlacesSidebar *sidebar) { - update_places (sidebar); + update_places_on_idle (sidebar); } static gboolean @@ -3979,6 +3980,8 @@ sidebar->volume_monitor = g_volume_monitor_get (); + sidebar->update_places_on_idle_id = 0; + sidebar->my_computer_expanded = g_settings_get_boolean (nemo_window_state, NEMO_WINDOW_STATE_MY_COMPUTER_EXPANDED); sidebar->bookmarks_expanded = g_settings_get_boolean (nemo_window_state, @@ -4242,6 +4245,11 @@ sidebar->bookmarks_changed_id = 0; } + if (sidebar->update_places_on_idle_id != 0) { + g_source_remove (sidebar->update_places_on_idle_id); + sidebar->update_places_on_idle_id = 0; + } + g_clear_object (&sidebar->store); g_clear_object (&sidebar->action_manager); @@ -4310,6 +4318,29 @@ widget_class->focus = nemo_places_sidebar_focus; } +static gboolean +update_places_on_idle_callback (NemoPlacesSidebar *sidebar) +{ + sidebar->update_places_on_idle_id = 0; + + update_places (sidebar); + + return FALSE; +} + +static void +update_places_on_idle (NemoPlacesSidebar *sidebar) +{ + if (sidebar->update_places_on_idle_id != 0) { + g_source_remove (sidebar->update_places_on_idle_id); + sidebar->update_places_on_idle_id = 0; + } + + sidebar->update_places_on_idle_id = g_idle_add_full (G_PRIORITY_LOW, + (GSourceFunc) update_places_on_idle_callback, + sidebar, NULL); +} + static void nemo_places_sidebar_set_parent_window (NemoPlacesSidebar *sidebar, NemoWindow *window) @@ -4337,7 +4368,7 @@ sidebar->bookmarks_changed_id = g_signal_connect_swapped (sidebar->bookmarks, "changed", - G_CALLBACK (update_places), + G_CALLBACK (update_places_on_idle), sidebar); g_signal_connect_object (window, "loading_uri", diff -Nru nemo-2.8.4/src/nemo-view.c nemo-2.8.5/src/nemo-view.c --- nemo-2.8.4/src/nemo-view.c 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/src/nemo-view.c 2015-11-20 17:28:32.000000000 +0000 @@ -5148,6 +5148,9 @@ for (index = 0; index < bookmark_count; ++index) { bookmark = nemo_bookmark_list_item_at (view->details->bookmarks, index); + /* Unlike the sidebar or the bookmarks menu, we are using bookmarks as + file operation targets, not locations to open. As such, we should + never show unmounted/invalid locations in the move-to/copy-to menu */ if (!nemo_bookmark_uri_get_exists (bookmark)) { continue; } diff -Nru nemo-2.8.4/src/nemo-window-bookmarks.c nemo-2.8.5/src/nemo-window-bookmarks.c --- nemo-2.8.4/src/nemo-window-bookmarks.c 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/src/nemo-window-bookmarks.c 2015-11-20 17:28:32.000000000 +0000 @@ -263,21 +263,16 @@ static void activate_bookmark_in_menu_item (GtkAction *action, gpointer user_data) { - NemoWindowSlot *slot; - BookmarkHolder *holder; - GFile *location; - - holder = (BookmarkHolder *)user_data; - - if (!nemo_bookmark_uri_get_exists (holder->bookmark)) { - holder->failed_callback (holder->window, holder->bookmark); - } else { - location = nemo_bookmark_get_location (holder->bookmark); - slot = nemo_window_get_active_slot (holder->window); - nemo_window_slot_open_location (slot, location, - nemo_event_get_window_open_flags ()); - g_object_unref (location); - } + NemoWindowSlot *slot; + BookmarkHolder *holder; + GFile *location; + + holder = (BookmarkHolder *)user_data; + + location = nemo_bookmark_get_location (holder->bookmark); + slot = nemo_window_get_active_slot (holder->window); + nemo_window_slot_open_location (slot, location, nemo_event_get_window_open_flags ()); + g_object_unref (location); } void @@ -382,10 +377,6 @@ for (index = 0; index < bookmark_count; ++index) { bookmark = nemo_bookmark_list_item_at (bookmarks, index); - if (!nemo_bookmark_uri_get_exists (bookmark)) { - continue; - } - nemo_menus_append_bookmark_to_menu (NEMO_WINDOW (window), bookmark, diff -Nru nemo-2.8.4/src/nemo-window-manage-views.c nemo-2.8.5/src/nemo-window-manage-views.c --- nemo-2.8.4/src/nemo-window-manage-views.c 2015-11-12 09:38:44.000000000 +0000 +++ nemo-2.8.5/src/nemo-window-manage-views.c 2015-11-20 17:28:32.000000000 +0000 @@ -125,9 +125,6 @@ slot->last_location_bookmark = slot->current_location_bookmark; slot->current_location_bookmark = (location == NULL) ? NULL : nemo_bookmark_new (location, NULL, NULL); - if (slot->current_location_bookmark != NULL) { - nemo_bookmark_set_visited (slot->current_location_bookmark, TRUE); - } } } @@ -1394,12 +1391,6 @@ g_free (data); } -static void -set_visited (NemoBookmark *bookmark) -{ - nemo_bookmark_set_visited (bookmark, TRUE); -} - /* Handle the changes for the NemoWindow itself. */ static void update_for_new_location (NemoWindowSlot *slot) @@ -1410,8 +1401,6 @@ NemoDirectory *directory; gboolean location_really_changed; FindMountData *data; - NemoBookmarkList *bm_list = nemo_bookmark_list_get_default (); - GList *matching_bookmarks; window = nemo_window_slot_get_window (slot); new_location = slot->pending_location; @@ -1419,13 +1408,6 @@ set_displayed_location (slot, new_location); - gchar *uri = g_file_get_uri (new_location); - matching_bookmarks = nemo_bookmark_list_get_for_uri (bm_list, uri); - g_free (uri); - - g_list_foreach (matching_bookmarks, (GFunc) set_visited, NULL); - g_list_free (matching_bookmarks); - update_history (slot, slot->location_change_type, new_location); location_really_changed =