gui: handle search exception (again after refactoring)
This commit is contained in:
parent
500fc13070
commit
09804a83cc
@ -15,6 +15,7 @@
|
|||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "clicklabel.h"
|
#include "clicklabel.h"
|
||||||
#include "../shared/sqlitesearch.h"
|
#include "../shared/sqlitesearch.h"
|
||||||
|
#include "../shared/qssgeneralexception.h"
|
||||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@ -45,8 +46,15 @@ void MainWindow::connectSignals()
|
|||||||
connect(&searchWatcher, &QFutureWatcher<SearchResult>::finished, this,
|
connect(&searchWatcher, &QFutureWatcher<SearchResult>::finished, this,
|
||||||
[&]
|
[&]
|
||||||
{
|
{
|
||||||
auto results = searchWatcher.future().result();
|
try
|
||||||
handleSearchResults(results);
|
{
|
||||||
|
auto results = searchWatcher.future().result();
|
||||||
|
handleSearchResults(results);
|
||||||
|
}
|
||||||
|
catch(QSSGeneralException &e)
|
||||||
|
{
|
||||||
|
handleSearchError(e.message);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(&pdfWorkerWatcher, &QFutureWatcher<PdfPreview>::resultReadyAt, this,
|
connect(&pdfWorkerWatcher, &QFutureWatcher<PdfPreview>::resultReadyAt, this,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user