searchworker: emit searchError on exception
这个提交包含在:
父节点
c338bb20bd
当前提交
098cd96dd2
@ -5,6 +5,7 @@
|
||||
#include <QStack>
|
||||
#include "searchworker.h"
|
||||
#include "../shared/sqlitesearch.h"
|
||||
#include "qssgeneralexception.h"
|
||||
SearchWorker::SearchWorker()
|
||||
{
|
||||
}
|
||||
@ -21,5 +22,13 @@ SearchWorker::SearchWorker(const QString &dbpath)
|
||||
void SearchWorker::search(const QString &query)
|
||||
{
|
||||
SqliteSearch searcher(db);
|
||||
emit searchResultsReady(searcher.search(query));
|
||||
try
|
||||
{
|
||||
auto result = searcher.search(query);
|
||||
emit searchResultsReady(searcher.search(query));
|
||||
}
|
||||
catch(QSSGeneralException &e)
|
||||
{
|
||||
emit searchError(e.message);
|
||||
}
|
||||
}
|
||||
|
正在加载...
在新工单中引用
屏蔽一个用户