Compare commits
3 Commits
0d2e518000
...
8ba4ee5847
Author | SHA1 | Date | |
---|---|---|---|
8ba4ee5847 | |||
451c79088a | |||
1a39118470 |
@ -249,6 +249,7 @@ void MainWindow::startIndexing()
|
|||||||
|
|
||||||
ui->previewsTab->setEnabled(false);
|
ui->previewsTab->setEnabled(false);
|
||||||
ui->resultsTab->setEnabled(false);
|
ui->resultsTab->setEnabled(false);
|
||||||
|
ui->settingsTab->setEnabled(false);
|
||||||
ui->txtPathScanAdd->setEnabled(false);
|
ui->txtPathScanAdd->setEnabled(false);
|
||||||
ui->txtSearch->setEnabled(false);
|
ui->txtSearch->setEnabled(false);
|
||||||
ui->previewProcessBar->setValue(0);
|
ui->previewProcessBar->setValue(0);
|
||||||
@ -285,6 +286,7 @@ void MainWindow::finishIndexing()
|
|||||||
ui->btnStartIndexing->setText("Start indexing");
|
ui->btnStartIndexing->setText("Start indexing");
|
||||||
ui->previewsTab->setEnabled(true);
|
ui->previewsTab->setEnabled(true);
|
||||||
ui->resultsTab->setEnabled(true);
|
ui->resultsTab->setEnabled(true);
|
||||||
|
ui->settingsTab->setEnabled(true);
|
||||||
ui->txtPathScanAdd->setEnabled(true);
|
ui->txtPathScanAdd->setEnabled(true);
|
||||||
ui->txtSearch->setEnabled(true);
|
ui->txtSearch->setEnabled(true);
|
||||||
}
|
}
|
||||||
@ -489,6 +491,11 @@ void MainWindow::handleSearchResults(const QVector<SearchResult> &results)
|
|||||||
bool exists = pathInfo.exists();
|
bool exists = pathInfo.exists();
|
||||||
if(exists)
|
if(exists)
|
||||||
{
|
{
|
||||||
|
if(!result.wasContentSearch)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(!pathInfo.suffix().contains("htm")) // hack until we can preview them properly...
|
if(!pathInfo.suffix().contains("htm")) // hack until we can preview them properly...
|
||||||
{
|
{
|
||||||
if(PreviewGenerator::get(pathInfo) != nullptr)
|
if(PreviewGenerator::get(pathInfo) != nullptr)
|
||||||
|
@ -23,12 +23,12 @@ QueryType LooqsQuery::getQueryType()
|
|||||||
return static_cast<QueryType>(tokensMask & COMBINED);
|
return static_cast<QueryType>(tokensMask & COMBINED);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LooqsQuery::hasContentSearch()
|
bool LooqsQuery::hasContentSearch() const
|
||||||
{
|
{
|
||||||
return (this->getTokensMask() & FILTER_CONTENT) == FILTER_CONTENT;
|
return (this->getTokensMask() & FILTER_CONTENT) == FILTER_CONTENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LooqsQuery::hasPathSearch()
|
bool LooqsQuery::hasPathSearch() const
|
||||||
{
|
{
|
||||||
return (this->getTokensMask() & FILTER_PATH) == FILTER_PATH;
|
return (this->getTokensMask() & FILTER_PATH) == FILTER_PATH;
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,8 @@ class LooqsQuery
|
|||||||
{
|
{
|
||||||
this->limit = limit;
|
this->limit = limit;
|
||||||
}
|
}
|
||||||
bool hasContentSearch();
|
bool hasContentSearch() const;
|
||||||
bool hasPathSearch();
|
bool hasPathSearch() const;
|
||||||
|
|
||||||
void addSortCondition(SortCondition sc);
|
void addSortCondition(SortCondition sc);
|
||||||
static bool checkParanthesis(QString query);
|
static bool checkParanthesis(QString query);
|
||||||
|
@ -7,6 +7,7 @@ class SearchResult
|
|||||||
public:
|
public:
|
||||||
FileData fileData;
|
FileData fileData;
|
||||||
QVector<unsigned int> pages;
|
QVector<unsigned int> pages;
|
||||||
|
bool wasContentSearch = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SEARCHRESULT_H
|
#endif // SEARCHRESULT_H
|
||||||
|
@ -213,6 +213,7 @@ QVector<SearchResult> SqliteSearch::search(const LooqsQuery &query)
|
|||||||
throw LooqsGeneralException("SQL Error: " + dbQuery.lastError().text());
|
throw LooqsGeneralException("SQL Error: " + dbQuery.lastError().text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool contentSearch = query.hasContentSearch();
|
||||||
while(dbQuery.next())
|
while(dbQuery.next())
|
||||||
{
|
{
|
||||||
SearchResult result;
|
SearchResult result;
|
||||||
@ -229,6 +230,7 @@ QVector<SearchResult> SqliteSearch::search(const LooqsQuery &query)
|
|||||||
result.pages.append(page.toUInt());
|
result.pages.append(page.toUInt());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
result.wasContentSearch = contentSearch;
|
||||||
results.append(result);
|
results.append(result);
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
Loading…
Reference in New Issue
Block a user