summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnautilus-private/nautilus-monitor.c')
-rw-r--r--libnautilus-private/nautilus-monitor.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libnautilus-private/nautilus-monitor.c b/libnautilus-private/nautilus-monitor.c
index 5b21c2438..484c75b20 100644
--- a/libnautilus-private/nautilus-monitor.c
+++ b/libnautilus-private/nautilus-monitor.c
@@ -32,7 +32,6 @@
struct NautilusMonitor {
GFileMonitor *monitor;
GVolumeMonitor *volume_monitor;
- GMount *mount;
GFile *location;
};
@@ -85,11 +84,16 @@ mount_removed (GVolumeMonitor *volume_monitor,
gpointer user_data)
{
NautilusMonitor *monitor = user_data;
+ GFile *mount_location;
- if (mount == monitor->mount) {
+ mount_location = g_mount_get_root (mount);
+
+ if (g_file_has_prefix (monitor->location, mount_location)) {
nautilus_file_changes_queue_file_removed (monitor->location);
schedule_call_consume_changes ();
}
+
+ g_object_unref (mount_location);
}
static void
@@ -143,7 +147,6 @@ nautilus_monitor_directory (GFile *location)
if (dir_monitor != NULL) {
ret->monitor = dir_monitor;
} else if (!g_file_is_native (location)) {
- ret->mount = nautilus_get_mounted_mount_for_root (location);
ret->location = g_object_ref (location);
ret->volume_monitor = g_volume_monitor_get ();
}
@@ -177,6 +180,5 @@ nautilus_monitor_cancel (NautilusMonitor *monitor)
}
g_clear_object (&monitor->location);
- g_clear_object (&monitor->mount);
g_slice_free (NautilusMonitor, monitor);
}