static void
real_update_query_editor (NautilusWindowSlot *slot)
{
	GtkWidget *query_editor;
	NautilusQuery *query;
	NautilusDirectory *directory;
	NautilusSearchDirectory *search_directory;

	directory = nautilus_directory_get (slot->location);

	if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
		search_directory = NAUTILUS_SEARCH_DIRECTORY (directory);

		query_editor = nautilus_query_editor_new (nautilus_search_directory_is_saved_search (search_directory),
							  nautilus_search_directory_is_indexed (search_directory));

		slot->query_editor = NAUTILUS_QUERY_EDITOR (query_editor);

		nautilus_window_slot_add_extra_location_widget (slot, query_editor);
		gtk_widget_show (query_editor);
		g_signal_connect_object (query_editor, "changed",
					 G_CALLBACK (query_editor_changed_callback), slot, 0);
		
		query = nautilus_search_directory_get_query (search_directory);
		if (query != NULL) {
			nautilus_query_editor_set_query (NAUTILUS_QUERY_EDITOR (query_editor),
							 query);
			g_object_unref (query);
		} else {
			nautilus_query_editor_set_default_query (NAUTILUS_QUERY_EDITOR (query_editor));
		}
	} 

	nautilus_directory_unref (directory);
}
static void
real_update_query_editor (NautilusWindowSlot *slot)
{
    NautilusDirectory *directory;
    NautilusSearchDirectory *search_directory;
    NautilusQuery *query;
    GtkWidget *query_editor;

    g_assert (slot->pane->window != NULL);

    query_editor = NULL;

    directory = nautilus_directory_get (slot->location);
    if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
        search_directory = NAUTILUS_SEARCH_DIRECTORY (directory);

        if (nautilus_search_directory_is_saved_search (search_directory)) {
            query_editor = nautilus_query_editor_new (TRUE,
                           nautilus_search_directory_is_indexed (search_directory));
        } else {
            query_editor = nautilus_query_editor_new_with_bar (FALSE,
                           nautilus_search_directory_is_indexed (search_directory),
                           slot->pane->window->details->active_pane->active_slot == slot,
                           NAUTILUS_SEARCH_BAR (slot->pane->search_bar),
                           slot);
        }
    }

    slot->query_editor = NAUTILUS_QUERY_EDITOR (query_editor);

    if (query_editor != NULL) {
        g_signal_connect_object (query_editor, "changed",
                                 G_CALLBACK (query_editor_changed_callback), slot, 0);

        query = nautilus_search_directory_get_query (search_directory);
        if (query != NULL) {
            nautilus_query_editor_set_query (NAUTILUS_QUERY_EDITOR (query_editor),
                                             query);
            g_object_unref (query);
        } else {
            nautilus_query_editor_set_default_query (NAUTILUS_QUERY_EDITOR (query_editor));
        }

        nautilus_window_slot_add_extra_location_widget (slot, query_editor);
        gtk_widget_show (query_editor);
        nautilus_query_editor_grab_focus (NAUTILUS_QUERY_EDITOR (query_editor));
    }

    nautilus_directory_unref (directory);
}
static void
nautilus_window_slot_constructed (GObject *object)
{
	NautilusWindowSlot *slot = NAUTILUS_WINDOW_SLOT (object);
	GtkWidget *extras_vbox;

	G_OBJECT_CLASS (nautilus_window_slot_parent_class)->constructed (object);

	gtk_orientable_set_orientation (GTK_ORIENTABLE (slot),
					GTK_ORIENTATION_VERTICAL);
	gtk_widget_show (GTK_WIDGET (slot));

	extras_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	slot->extra_location_widgets = extras_vbox;
	gtk_box_pack_start (GTK_BOX (slot), extras_vbox, FALSE, FALSE, 0);
	gtk_widget_show (extras_vbox);

	slot->query_editor = NAUTILUS_QUERY_EDITOR (nautilus_query_editor_new ());
	nautilus_window_slot_add_extra_location_widget (slot, GTK_WIDGET (slot->query_editor));
	g_object_add_weak_pointer (G_OBJECT (slot->query_editor),
				   (gpointer *) &slot->query_editor);

	slot->view_overlay = gtk_overlay_new ();
	gtk_widget_add_events (slot->view_overlay,
			       GDK_ENTER_NOTIFY_MASK |
			       GDK_LEAVE_NOTIFY_MASK);
	gtk_box_pack_start (GTK_BOX (slot), slot->view_overlay, TRUE, TRUE, 0);
	gtk_widget_show (slot->view_overlay);

	slot->floating_bar = nautilus_floating_bar_new (NULL, NULL, FALSE);
	gtk_widget_set_halign (slot->floating_bar, GTK_ALIGN_END);
	gtk_widget_set_valign (slot->floating_bar, GTK_ALIGN_END);
	gtk_overlay_add_overlay (GTK_OVERLAY (slot->view_overlay),
				 slot->floating_bar);

	g_signal_connect (slot->floating_bar, "action",
			  G_CALLBACK (floating_bar_action_cb), slot);

	slot->title = g_strdup (_("Loading..."));
}