[nautilus] search-directory: only set base model when it matches query location
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] search-directory: only set base model when it matches query location
- Date: Thu, 27 Sep 2012 01:12:10 +0000 (UTC)
commit f216028365d48384b37b225a3fe22ca2440baca0
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Sep 26 21:08:02 2012 -0400
search-directory: only set base model when it matches query location
Otherwise we'll return results from the wrong base directory for
searches that are saved, or from the back/forward history.
https://bugzilla.gnome.org/show_bug.cgi?id=684769
libnautilus-private/nautilus-search-directory.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-search-directory.c b/libnautilus-private/nautilus-search-directory.c
index 4318d2e..c1c3ca0 100644
--- a/libnautilus-private/nautilus-search-directory.c
+++ b/libnautilus-private/nautilus-search-directory.c
@@ -846,6 +846,26 @@ nautilus_search_directory_set_base_model (NautilusSearchDirectory *search,
return;
}
+ if (search->details->query != NULL) {
+ gchar *uri;
+ GFile *query_location, *model_location;
+ gboolean is_equal;
+
+ uri = nautilus_query_get_location (search->details->query);
+ query_location = g_file_new_for_uri (uri);
+ model_location = nautilus_directory_get_location (base_model);
+
+ is_equal = g_file_equal (model_location, query_location);
+
+ g_object_unref (model_location);
+ g_object_unref (query_location);
+ g_free (uri);
+
+ if (!is_equal) {
+ return;
+ }
+ }
+
clear_base_model (search);
search->details->base_model = nautilus_directory_ref (base_model);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]