diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 9d5533d6d7..8017e9c825 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -30,6 +30,7 @@ #include "mainwindowadaptor.h" #ifdef HAVE_NEPOMUK #include "panels/filter/filterpanel.h" + #include #endif #include "panels/folders/folderspanel.h" #include "panels/places/placespanel.h" @@ -1218,7 +1219,7 @@ void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable) void DolphinMainWindow::slotSearchModeChanged(bool enabled) { QDockWidget* filterDock = findChild("filterDock"); - if (filterDock == 0) { + if ((filterDock == 0) || !filterDock->isEnabled()) { return; } @@ -1629,9 +1630,11 @@ void DolphinMainWindow::setupDockWidgets() // setup "Filter" #ifdef HAVE_NEPOMUK + const bool nepomukActivated = (Nepomuk::ResourceManager::instance()->init() == 0); QDockWidget* filterDock = new QDockWidget(i18nc("@title:window", "Filter")); filterDock->setObjectName("filterDock"); filterDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + filterDock->setEnabled(nepomukActivated); Panel* filterPanel = new FilterPanel(filterDock); connect(filterPanel, SIGNAL(urlActivated(KUrl)), this, SLOT(handleUrl(KUrl))); filterDock->setWidget(filterPanel); @@ -1639,9 +1642,10 @@ void DolphinMainWindow::setupDockWidgets() QAction* filterAction = filterDock->toggleViewAction(); filterAction->setShortcut(Qt::Key_F12); filterAction->setIcon(KIcon("view-filter")); + filterAction->setEnabled(nepomukActivated); addDockWidget(Qt::RightDockWidgetArea, filterDock); connect(this, SIGNAL(urlChanged(KUrl)), - filterPanel, SLOT(setUrl(KUrl))); + filterPanel, SLOT(setUrl(KUrl))); #endif const bool firstRun = DolphinSettings::instance().generalSettings()->firstRun(); diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 2e4b58d9f6..6fb22fb17a 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -80,7 +80,7 @@ QString DolphinSearchBox::text() const void DolphinSearchBox::setSearchPath(const KUrl& url) { m_searchPath = url; - m_filterButton->setVisible(isSearchPathIndexed()); + m_filterButton->setVisible(m_nepomukActivated && isSearchPathIndexed()); } KUrl DolphinSearchBox::searchPath() const @@ -91,7 +91,7 @@ KUrl DolphinSearchBox::searchPath() const KUrl DolphinSearchBox::urlForSearching() const { KUrl url; - if (isSearchPathIndexed()) { + if (m_nepomukActivated && isSearchPathIndexed()) { url = nepomukUrlForSearching(); } else { url = m_searchPath;