[nautilus/gnome-3-6] bookmark: don't try to connect to a vanished NautilusFile
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-3-6] bookmark: don't try to connect to a vanished NautilusFile
- Date: Tue, 6 Nov 2012 01:30:17 +0000 (UTC)
commit b619a463398123def5bd9ed8ea15f93a74e82d6e
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Nov 5 20:24:36 2012 -0500
bookmark: don't try to connect to a vanished NautilusFile
When the file watched by the bookmark is trashed or deleted, record the
fact in the object state; later, when checking whether the URI exists,
use that information to avoid connecting to a vanished NautilusFile.
Currently, we will hit an assertion later for unmounted remote volumes;
this bug wasn't present in master and the cherry-pick for commit
231f0b074da973f2c0b69513b743548810d4e716 introduced this regression.
https://bugzilla.gnome.org/show_bug.cgi?id=687518
libnautilus-private/nautilus-bookmark.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-bookmark.c b/libnautilus-private/nautilus-bookmark.c
index f5995c4..afdfede 100644
--- a/libnautilus-private/nautilus-bookmark.c
+++ b/libnautilus-private/nautilus-bookmark.c
@@ -64,6 +64,7 @@ struct NautilusBookmarkDetails
char *name;
gboolean has_custom_name;
GFile *location;
+ gboolean location_gone;
GIcon *icon;
GIcon *symbolic_icon;
NautilusFile *file;
@@ -150,8 +151,10 @@ bookmark_file_changed_callback (NautilusFile *file,
* bookmark just because its not there anymore.
*/
DEBUG ("%s: trashed", nautilus_bookmark_get_name (bookmark));
+ bookmark->details->location_gone = TRUE;
nautilus_bookmark_disconnect_file (bookmark);
} else {
+ bookmark->details->location_gone = FALSE;
bookmark_set_name_from_ready_file (bookmark, file);
}
}
@@ -714,6 +717,10 @@ nautilus_bookmark_uri_known_not_to_exist (NautilusBookmark *bookmark)
char *path_name;
gboolean exists;
+ if (bookmark->details->location_gone) {
+ return TRUE;
+ }
+
/* Convert to a path, returning FALSE if not local. */
if (!g_file_is_native (bookmark->details->location)) {
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]