Skip to content

Commit deef9d1

Browse files
committed
nemo-main-application.c: Clear a window's saved secondary pane
location if an unmount invalidates it. Ref: 2b70af1 Fixes #3688.
1 parent 1f06897 commit deef9d1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/nemo-main-application.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ mount_removed_callback (GVolumeMonitor *monitor,
286286

287287
root = g_mount_get_root (mount);
288288
uri = g_file_get_uri (root);
289-
g_object_unref (root);
290289

291290
DEBUG ("Removed mount at uri %s", uri);
292291
g_free (uri);
@@ -297,6 +296,14 @@ mount_removed_callback (GVolumeMonitor *monitor,
297296
if (window != NULL) {
298297
GList *l;
299298
GList *lp;
299+
GFile *saved_location;
300+
301+
/* Clear the stored secondary pane location if it was on the removed mount */
302+
saved_location = window->details->secondary_pane_last_location;
303+
if (saved_location != NULL &&
304+
(g_file_has_prefix (saved_location, root) || g_file_equal (saved_location, root))) {
305+
nemo_window_clear_secondary_pane_location (window);
306+
}
300307

301308
for (lp = window->details->panes; lp != NULL; lp = lp->next) {
302309
NemoWindowPane *pane;
@@ -312,6 +319,8 @@ mount_removed_callback (GVolumeMonitor *monitor,
312319
}
313320
}
314321

322+
g_object_unref (root);
323+
315324
/* Handle the windows in the close list. */
316325
for (node = close_list; node != NULL; node = node->next) {
317326
slot = node->data;

0 commit comments

Comments
 (0)