[nautilus] file: don't check nautilus_file_is_in_search() when getting relevance
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] file: don't check nautilus_file_is_in_search() when getting relevance
- Date: Mon, 15 Oct 2012 14:03:28 +0000 (UTC)
commit 9c695bcaa887dc7dcba0b688d608462222a584d1
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Oct 12 19:32:54 2012 -0400
file: don't check nautilus_file_is_in_search() when getting relevance
This checks the URI, so it will always return FALSE, since files in
NautilusSearchDirectory have the real URI of the location.
libnautilus-private/nautilus-file.c | 24 +++++-------------------
1 files changed, 5 insertions(+), 19 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 225165c..4f5b2af 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3003,12 +3003,10 @@ static Knowledge
get_search_relevance (NautilusFile *file,
gdouble *relevance_out)
{
- if (!nautilus_file_is_in_search (file)) {
- return UNKNOWABLE;
- }
-
+ /* we're only called in search directories, and in that
+ * case, the relevance is always known (or zero).
+ */
*relevance_out = file->details->search_relevance;
-
return KNOWN;
}
@@ -3016,21 +3014,9 @@ static int
compare_by_search_relevance (NautilusFile *file_1, NautilusFile *file_2)
{
gdouble r_1, r_2;
- Knowledge known_1, known_2;
-
- known_1 = get_search_relevance (file_1, &r_1);
- known_2 = get_search_relevance (file_2, &r_2);
- if (known_1 > known_2) {
- return -1;
- }
- if (known_1 < known_2) {
- return +1;
- }
-
- if (known_1 == UNKNOWABLE || known_1 == UNKNOWN) {
- return 0;
- }
+ get_search_relevance (file_1, &r_1);
+ get_search_relevance (file_2, &r_2);
if (r_1 < r_2) {
return -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]