--- orig/nautilus-2.27.92/libnautilus-private/nautilus-query.c 2009-04-20 12:57:19.000000000 +0200 +++ nautilus-2.27.92/libnautilus-private/nautilus-query.c 2009-09-20 00:33:49.000000000 +0200 @@ -32,7 +32,7 @@ struct NautilusQueryDetails { char *text; - char *location_uri; + GList *location_uris; GList *mime_types; }; @@ -95,17 +95,24 @@ query->details->text = g_strdup (text); } -char * -nautilus_query_get_location (NautilusQuery *query) +GList * +nautilus_query_get_locations (NautilusQuery *query) { - return g_strdup (query->details->location_uri); + return eel_g_str_list_copy (query->details->location_uris); } - + +void +nautilus_query_add_location (NautilusQuery *query, const char *uri) +{ + query->details->location_uris = g_list_append (query->details->location_uris, + g_strdup (uri)); +} + void -nautilus_query_set_location (NautilusQuery *query, const char *uri) +nautilus_query_set_locations (NautilusQuery *query, GList *uris) { - g_free (query->details->location_uri); - query->details->location_uri = g_strdup (uri); + eel_g_list_free_deep (query->details->location_uris); + query->details->location_uris = eel_g_str_list_copy (uris); } GList * @@ -247,8 +254,9 @@ if (info->in_text) { nautilus_query_set_text (info->query, t); } else if (info->in_location) { + /* Not checking for in_locations because of backward compability */ uri = decode_home_uri (t); - nautilus_query_set_location (info->query, uri); + nautilus_query_add_location (info->query, uri); g_free (uri); } else if (info->in_mimetypes && info->in_mimetype) { nautilus_query_add_mime_type (info->query, t); @@ -331,10 +339,14 @@ g_string_append_printf (xml, " %s\n", text); g_free (text); - if (query->details->location_uri) { - uri = encode_home_uri (query->details->location_uri); - g_string_append_printf (xml, " %s\n", uri); - g_free (uri); + if (query->details->location_uris) { + g_string_append (xml, " \n"); + for (l = query->details->location_uris; l != NULL; l = l->next) { + uri = encode_home_uri (l->data); + g_string_append_printf (xml, " %s\n", uri); + g_free (uri); + } + g_string_append (xml, " \n"); } if (query->details->mime_types) { --- orig/nautilus-2.27.92/libnautilus-private/nautilus-query.h 2009-04-20 12:57:19.000000000 +0200 +++ nautilus-2.27.92/libnautilus-private/nautilus-query.h 2009-09-19 22:55:32.000000000 +0200 @@ -52,8 +52,9 @@ char * nautilus_query_get_text (NautilusQuery *query); void nautilus_query_set_text (NautilusQuery *query, const char *text); -char * nautilus_query_get_location (NautilusQuery *query); -void nautilus_query_set_location (NautilusQuery *query, const char *uri); +GList * nautilus_query_get_locations (NautilusQuery *query); +void nautilus_query_set_locations (NautilusQuery *query, GList *uris); +void nautilus_query_add_location (NautilusQuery *query, const char *uri); GList * nautilus_query_get_mime_types (NautilusQuery *query); void nautilus_query_set_mime_types (NautilusQuery *query, GList *mime_types); --- orig/nautilus-2.27.92/libnautilus-private/nautilus-search-engine-simple.c 2009-04-20 12:57:19.000000000 +0200 +++ nautilus-2.27.92/libnautilus-private/nautilus-search-engine-simple.c 2009-09-20 00:38:33.000000000 +0200 @@ -91,23 +91,28 @@ SearchThreadData *data; char *text, *lower, *normalized, *uri; GFile *location; + GList *uris, *l; data = g_new0 (SearchThreadData, 1); data->engine = engine; data->directories = g_queue_new (); data->visited = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); - uri = nautilus_query_get_location (query); - location = NULL; - if (uri != NULL) { - location = g_file_new_for_uri (uri); - g_free (uri); - } - if (location == NULL) { - location = g_file_new_for_path ("/"); + uris = nautilus_query_get_locations (query); + + for (l = uris; l != NULL; l = l->next) { + uri = l->data; + location = NULL; + if (uri != NULL) { + location = g_file_new_for_uri (uri); + } + if (location == NULL) { + location = g_file_new_for_path ("/"); + } + g_queue_push_tail (data->directories, location); } - g_queue_push_tail (data->directories, location); - + eel_g_list_free_deep (uris); + text = nautilus_query_get_text (query); normalized = g_utf8_normalize (text, -1, G_NORMALIZE_NFD); lower = g_utf8_strdown (normalized, -1); --- orig/nautilus-2.27.92/src/nautilus-navigation-window.c 2009-08-17 15:24:11.000000000 +0200 +++ nautilus-2.27.92/src/nautilus-navigation-window.c 2009-09-19 23:01:22.000000000 +0200 @@ -1489,7 +1489,7 @@ NautilusWindowSlot *slot = window->details->active_slot; if (!nautilus_search_directory_is_indexed (search_directory)) { current_uri = nautilus_window_slot_get_location_uri (slot); - nautilus_query_set_location (query, current_uri); + nautilus_query_add_location (query, current_uri); g_free (current_uri); } nautilus_search_directory_set_query (search_directory, query); --- orig/nautilus-2.27.92/src/nautilus-query-editor.c 2009-04-20 12:57:20.000000000 +0200 +++ nautilus-2.27.92/src/nautilus-query-editor.c 2009-09-20 00:33:03.000000000 +0200 @@ -293,7 +293,7 @@ uri = g_filename_to_uri (folder, NULL, NULL); g_free (folder); - nautilus_query_set_location (query, uri); + nautilus_query_add_location (query, uri); g_free (uri); } @@ -308,24 +308,30 @@ { NautilusQueryEditorRow *row; char *uri, *folder; + GList *uris; + GList *l; - uri = nautilus_query_get_location (query); + uris = nautilus_query_get_locations (query); - if (uri == NULL) { - return; - } - folder = g_filename_from_uri (uri, NULL, NULL); - g_free (uri); - if (folder == NULL) { + if (uris == NULL) { return; } + + for (l = uris; l != NULL; l = l->next) { + uri = l->data; + + folder = g_filename_from_uri (uri, NULL, NULL); + + if (folder != NULL) { + row = nautilus_query_editor_add_row (editor, + NAUTILUS_QUERY_EDITOR_ROW_LOCATION); + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (row->type_widget), + folder); - row = nautilus_query_editor_add_row (editor, - NAUTILUS_QUERY_EDITOR_ROW_LOCATION); - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (row->type_widget), - folder); - - g_free (folder); + g_free (folder); + } + } + eel_g_list_free_deep (uris); }