diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 752e1b9..b5f5ef0 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -489,6 +489,11 @@ void MainWindow::handleSearchResults(const QVector &results) bool exists = pathInfo.exists(); if(exists) { + if(!result.wasContentSearch) + { + continue; + } + if(!pathInfo.suffix().contains("htm")) // hack until we can preview them properly... { if(PreviewGenerator::get(pathInfo) != nullptr) diff --git a/shared/searchresult.h b/shared/searchresult.h index 3a40975..0961faf 100644 --- a/shared/searchresult.h +++ b/shared/searchresult.h @@ -7,6 +7,7 @@ class SearchResult public: FileData fileData; QVector pages; + bool wasContentSearch = false; }; #endif // SEARCHRESULT_H diff --git a/shared/sqlitesearch.cpp b/shared/sqlitesearch.cpp index 2c2003d..bcfe8a0 100644 --- a/shared/sqlitesearch.cpp +++ b/shared/sqlitesearch.cpp @@ -213,6 +213,7 @@ QVector SqliteSearch::search(const LooqsQuery &query) throw LooqsGeneralException("SQL Error: " + dbQuery.lastError().text()); } + bool contentSearch = query.hasContentSearch(); while(dbQuery.next()) { SearchResult result; @@ -229,6 +230,7 @@ QVector SqliteSearch::search(const LooqsQuery &query) result.pages.append(page.toUInt()); } } + result.wasContentSearch = contentSearch; results.append(result); } return results;