diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-09-28 20:57:32 -0400 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-10-17 09:56:38 -0400 |
commit | 60e32220dca59f4f5f79a25e4d5f04f00e494ae4 (patch) | |
tree | 2c8fc457ceeb749d12a006b577cdb2a8c0a86708 | |
parent | ca02343107025a4de6392e61ca5b32163b19d2f4 (diff) | |
download | nautilus-60e32220dca59f4f5f79a25e4d5f04f00e494ae4.tar.gz |
application: avoid useless checks when removing a mount
nautilus_window_slot_should_close_with_mount() has the same checks and
more.
-rw-r--r-- | src/nautilus-application.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/nautilus-application.c b/src/nautilus-application.c index 9de115eec..506de19cb 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -616,15 +616,6 @@ get_first_navigation_slot (GList *slot_list) return NULL; } -/* We redirect some slots and close others */ -static gboolean -should_close_slot_with_mount (NautilusWindow *window, - NautilusWindowSlot *slot, - GMount *mount) -{ - return nautilus_window_slot_should_close_with_mount (slot, mount); -} - /* Called whenever a mount is unmounted. Check and see if there are * any windows open displaying contents on the mount. If there are, * close them. It would also be cool to save open window and position @@ -662,24 +653,15 @@ mount_removed_callback (GVolumeMonitor *monitor, if (window != NULL && window_can_be_closed (window)) { GList *l; GList *lp; - GFile *location; for (lp = window->details->panes; lp != NULL; lp = lp->next) { NautilusWindowPane *pane; pane = (NautilusWindowPane*) lp->data; for (l = pane->slots; l != NULL; l = l->next) { slot = l->data; - location = slot->location; - if (location == NULL || - g_file_has_prefix (location, root) || - g_file_equal (location, root)) { - close_list = g_list_prepend (close_list, slot); - - if (!should_close_slot_with_mount (window, slot, mount)) { - /* We'll be redirecting this, not closing */ - unclosed_slot = TRUE; - } - } else { + close_list = g_list_prepend (close_list, slot); + if (!nautilus_window_slot_should_close_with_mount (slot, mount)) { + /* We'll be redirecting this, not closing */ unclosed_slot = TRUE; } } /* for all slots */ @@ -698,7 +680,7 @@ mount_removed_callback (GVolumeMonitor *monitor, slot = node->data; window = slot->pane->window; - if (should_close_slot_with_mount (window, slot, mount) && + if (nautilus_window_slot_should_close_with_mount (slot, mount) && slot != force_no_close_slot) { nautilus_window_pane_slot_close (slot->pane, slot); } else { |