┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/search/searchpanel.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-04-25 02:16:35 +0200
committerPeter Penz <[email protected]>2012-04-25 02:20:25 +0200
commit67f58d5082cbab3a1a4a83926e77ade299ec07ea (patch)
tree4cb2171bb8ccf0cab7a4d4361836def5fb82ee44 /src/panels/search/searchpanel.h
parentd9de39172033c28b8f9a7c1573130cf2124b4f7a (diff)
Fix search-UI issues in combination with the new places entries
The places-entries for searching revealed some serious issues in combination with the search-panel. Move the filtering away from QDockWidget and bring it back below the search-bar.
Diffstat (limited to 'src/panels/search/searchpanel.h')
-rw-r--r--src/panels/search/searchpanel.h107
1 files changed, 0 insertions, 107 deletions
diff --git a/src/panels/search/searchpanel.h b/src/panels/search/searchpanel.h
deleted file mode 100644
index 4ea7e121e..000000000
--- a/src/panels/search/searchpanel.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2010 by Sebastian Trueg <[email protected]> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
- ***************************************************************************/
-
-#ifndef SEARCHPANEL_H
-#define SEARCHPANEL_H
-
-#include <Nepomuk/Query/Query>
-#include <panels/panel.h>
-
-namespace KIO
-{
- class Job;
-};
-
-namespace Nepomuk
-{
- namespace Utils
- {
- class FacetWidget;
- }
-}
-
-/**
- * @brief Allows to search for files by enabling generic search patterns (= facets).
- *
- * For example it is possible to search for images, documents or specific tags.
- * The search panel can be adjusted to search only from the current folder or everywhere.
- */
-class SearchPanel : public Panel
-{
- Q_OBJECT
-
-public:
- enum SearchLocation
- {
- Everywhere,
- FromCurrentDir
- };
-
- SearchPanel(QWidget* parent = 0);
- virtual ~SearchPanel();
-
- /**
- * Specifies whether a searching is done in all folders (= Everywhere)
- * or from the current directory (= FromCurrentDir). The current directory
- * is automatically determined when setUrl() has been called.
- */
- void setSearchLocation(SearchLocation location);
- SearchLocation searchLocation() const;
-
-signals:
- void urlActivated(const KUrl& url);
-
-protected:
- /** @see Panel::urlChanged() */
- virtual bool urlChanged();
-
- /** @see QWidget::showEvent() */
- virtual void showEvent(QShowEvent* event);
-
- /** @see QWidget::contextMenuEvent() */
- virtual void contextMenuEvent(QContextMenuEvent* event);
-
-private slots:
- void slotSetUrlStatFinished(KJob*);
- void slotQueryTermChanged(const Nepomuk::Query::Term& term);
-
-private:
- void setQuery(const Nepomuk::Query::Query& query);
-
- /**
- * @return True if the facets can be applied to the given URL
- * and hence a filtering of the content is possible.
- * False is returned if the search-mode is set to
- * SearchLocation::FromCurrentDir and this directory is
- * not indexed at all. Also if indexing is disabled
- * false will be returned.
- */
- bool isFilteringPossible() const;
-
-private:
- bool m_initialized;
- SearchLocation m_searchLocation;
- KIO::Job* m_lastSetUrlStatJob;
-
- KUrl m_startedFromDir;
- Nepomuk::Utils::FacetWidget* m_facetWidget;
- Nepomuk::Query::Query m_unfacetedRestQuery;
-};
-
-#endif // SEARCHPANEL_H