]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/search/dolphinsearchbox.cpp
Fix build if Baloo is not installed
[dolphin.git] / src / search / dolphinsearchbox.cpp
index e6377639bd4bc687423f190098af3e3894f658f7..c178c43c7c673971fb40c0b86be6fdde8fe6bd04 100644 (file)
@@ -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");