From d8fecb53187d768927e4daf3382a8982925b705f Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Fri, 7 Feb 2014 10:14:29 +0100 Subject: [PATCH] Fix build if Baloo is not installed --- dolphin/src/search/dolphinsearchbox.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dolphin/src/search/dolphinsearchbox.cpp b/dolphin/src/search/dolphinsearchbox.cpp index e6377639bd..c178c43c7c 100644 --- a/dolphin/src/search/dolphinsearchbox.cpp +++ b/dolphin/src/search/dolphinsearchbox.cpp @@ -107,8 +107,11 @@ void DolphinSearchBox::setSearchPath(const KUrl& url) m_fromHereButton->setVisible(showSearchFromButtons); m_everywhereButton->setVisible(showSearchFromButtons); + bool hasFacetsSupport = false; +#ifdef HAVE_BALOO const Baloo::IndexerConfig searchInfo; - const bool hasFacetsSupport = searchInfo.fileIndexingEnabled() && searchInfo.shouldBeIndexed(m_searchPath.toLocalFile()); + hasFacetsSupport = searchInfo.fileIndexingEnabled() && searchInfo.shouldBeIndexed(m_searchPath.toLocalFile()); +#endif m_facetsWidget->setEnabled(hasFacetsSupport); } @@ -120,8 +123,12 @@ KUrl DolphinSearchBox::searchPath() const KUrl DolphinSearchBox::urlForSearching() const { KUrl url; + bool useBalooSearch = false; +#ifdef HAVE_BALOO const Baloo::IndexerConfig searchInfo; - if (searchInfo.fileIndexingEnabled() && searchInfo.shouldBeIndexed(m_searchPath.toLocalFile())) { + useBalooSearch = searchInfo.fileIndexingEnabled() && searchInfo.shouldBeIndexed(m_searchPath.toLocalFile()); +#endif + if (useBalooSearch) { url = balooUrlForSearching(); } else { url.setProtocol("filenamesearch");