summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-search-directory.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-10-02 12:27:50 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-10-02 13:06:49 -0400
commitc62a412853703b41a703cf9684b666cd83694b3d (patch)
treed2a1b92dacef72eb962478e2ad076780afbd9b5c /libnautilus-private/nautilus-search-directory.c
parent3fc01f4c8f75645973758f66c61c510537796115 (diff)
downloadnautilus-c62a412853703b41a703cf9684b666cd83694b3d.tar.gz
directory: make the location GFile a construct property
Since nautilus_search_directory_new_from_saved_search() expects the location field to be already populated after g_object_new() is called (and it's a reasonable expectation), make it a construct only property. This will also allow further cleanups in the directory code later. https://bugzilla.gnome.org/show_bug.cgi?id=685155
Diffstat (limited to 'libnautilus-private/nautilus-search-directory.c')
-rw-r--r--libnautilus-private/nautilus-search-directory.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libnautilus-private/nautilus-search-directory.c b/libnautilus-private/nautilus-search-directory.c
index c58560558..7a024f477 100644
--- a/libnautilus-private/nautilus-search-directory.c
+++ b/libnautilus-private/nautilus-search-directory.c
@@ -931,12 +931,15 @@ nautilus_search_directory_new_from_saved_search (const char *uri)
NautilusSearchDirectory *search;
NautilusQuery *query;
char *file;
-
- search = NAUTILUS_SEARCH_DIRECTORY (g_object_new (NAUTILUS_TYPE_SEARCH_DIRECTORY, NULL));
+ GFile *location;
+
+ location = g_file_new_for_uri (uri);
+ search = NAUTILUS_SEARCH_DIRECTORY (g_object_new (NAUTILUS_TYPE_SEARCH_DIRECTORY, "location", location, NULL));
search->details->saved_search_uri = g_strdup (uri);
-
- file = g_filename_from_uri (uri, NULL, NULL);
+ file = g_file_get_path (location);
+ g_object_unref (location);
+
if (file != NULL) {
query = nautilus_query_load (file);
if (query != NULL) {