searchworker: emit searchError on exception
This commit is contained in:
parent
b8c0fc0ae3
commit
ea8f701e8f
@ -5,6 +5,7 @@
|
|||||||
#include <QStack>
|
#include <QStack>
|
||||||
#include "searchworker.h"
|
#include "searchworker.h"
|
||||||
#include "../shared/sqlitesearch.h"
|
#include "../shared/sqlitesearch.h"
|
||||||
|
#include "qssgeneralexception.h"
|
||||||
SearchWorker::SearchWorker()
|
SearchWorker::SearchWorker()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -22,6 +23,15 @@ SearchWorker::SearchWorker(const QString &dbpath)
|
|||||||
void SearchWorker::search(const QString &query)
|
void SearchWorker::search(const QString &query)
|
||||||
{
|
{
|
||||||
SqliteSearch searcher(db);
|
SqliteSearch searcher(db);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
auto result = searcher.search(query);
|
||||||
emit searchResultsReady(searcher.search(query));
|
emit searchResultsReady(searcher.search(query));
|
||||||
|
}
|
||||||
|
catch(QSSGeneralException &e)
|
||||||
|
{
|
||||||
|
emit searchError(e.message);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user