diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2012-10-02 15:46:14 -0400 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2012-10-15 09:38:14 -0400 |
commit | bba36c99a58c61a61b9af3d3832ca25c7635103b (patch) | |
tree | 1ce577f82393bd6e4265aa535c21c20672e0c4ea | |
parent | bbcd352e9f8a137156650be0ebd8c39f0c113e47 (diff) | |
download | nautilus-bba36c99a58c61a61b9af3d3832ca25c7635103b.tar.gz |
slot: use the pending location when creating a query editor in loading
Or we'll segfault calling nautilus_directory_get() on a NULL location.
https://bugzilla.gnome.org/show_bug.cgi?id=685293
-rw-r--r-- | src/nautilus-window-slot.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c index aaa567a6c..87bc777b7 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -190,8 +190,21 @@ update_query_editor (NautilusWindowSlot *slot) { NautilusDirectory *directory; NautilusSearchDirectory *search_directory; + GFile *location; - directory = nautilus_directory_get (slot->location); + /* This might be called while we're still loading the location. + * In such a case, just set slot->load_with_search to TRUE, to stop + * nautilus_window_sync_search_widgets() from hiding it again when + * loading has completed. + */ + if (slot->location) { + location = slot->location; + } else { + location = slot->pending_location; + slot->load_with_search = TRUE; + } + + directory = nautilus_directory_get (location); if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) { NautilusQuery *query; @@ -203,7 +216,7 @@ update_query_editor (NautilusWindowSlot *slot) g_object_unref (query); } } else { - nautilus_query_editor_set_location (slot->query_editor, slot->location); + nautilus_query_editor_set_location (slot->query_editor, location); } nautilus_directory_unref (directory); |