┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search/dolphinsearchbox.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-02-02 19:36:08 +0100
committerPeter Penz <[email protected]>2011-02-02 19:36:08 +0100
commit7045a25e3abaedab0d128f03702eaf48ffe6e0b7 (patch)
tree66a3deaa0c15c353895f5d42301bd27b2241f7b5 /src/search/dolphinsearchbox.cpp
parent28f00f36d74572510aee58111f1a9f884e148f6b (diff)
Fix visibility- and enabled-issues for the filter-panel
The filter-panel should be disabled if the current folder is not indexed at all. Also when triggering a "Find" the filter-panel should stay invisible per default when the current folder is not indexed. CCBUG: 264969
Diffstat (limited to 'src/search/dolphinsearchbox.cpp')
-rw-r--r--src/search/dolphinsearchbox.cpp39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp
index 039c16ded..f9a7a0cf2 100644
--- a/src/search/dolphinsearchbox.cpp
+++ b/src/search/dolphinsearchbox.cpp
@@ -20,6 +20,7 @@
#include "dolphinsearchbox.h"
#include "dolphin_searchsettings.h"
+#include "dolphinsearchinformation.h"
#include <kicon.h>
#include <klineedit.h>
@@ -111,7 +112,8 @@ KUrl DolphinSearchBox::searchPath() const
KUrl DolphinSearchBox::urlForSearching() const
{
KUrl url;
- if (m_nepomukActivated && isSearchPathIndexed()) {
+ const DolphinSearchInformation& searchInfo = DolphinSearchInformation::instance();
+ if (searchInfo.isIndexingEnabled() && searchInfo.isPathIndexed(url)) {
url = nepomukUrlForSearching();
} else {
url.setProtocol("filenamesearch");
@@ -328,41 +330,6 @@ void DolphinSearchBox::init()
connect(m_startSearchTimer, SIGNAL(timeout()), this, SLOT(emitSearchSignal()));
}
-bool DolphinSearchBox::isSearchPathIndexed() const
-{
-#ifdef HAVE_NEPOMUK
- const QString path = m_searchPath.path();
-
- const KConfig strigiConfig("nepomukstrigirc");
- const QStringList indexedFolders = strigiConfig.group("General").readPathEntry("folders", QStringList());
-
- // Check whether the current search path is part of an indexed folder
- bool isIndexed = false;
- foreach (const QString& indexedFolder, indexedFolders) {
- if (path.startsWith(indexedFolder)) {
- isIndexed = true;
- break;
- }
- }
-
- if (isIndexed) {
- // The current search path is part of an indexed folder. Check whether no
- // excluded folder is part of the search path.
- const QStringList excludedFolders = strigiConfig.group("General").readPathEntry("exclude folders", QStringList());
- foreach (const QString& excludedFolder, excludedFolders) {
- if (path.startsWith(excludedFolder)) {
- isIndexed = false;
- break;
- }
- }
- }
-
- return isIndexed;
-#else
- return false;
-#endif
-}
-
KUrl DolphinSearchBox::nepomukUrlForSearching() const
{
#ifdef HAVE_NEPOMUK