diff options
-rw-r--r-- | mobile-widgets/qml/main.qml | 8 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index cd8635b63..17ae7ad7b 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -68,11 +68,19 @@ Kirigami.ApplicationWindow { function showBusy() { busy.running = true + } + + function showBusyAndDisconnectModel() { // this is used by QMLManager when operating the filter + busy.running = true diveList.diveListModel = null } function hideBusy() { busy.running = false + } + + function hideBusyAndConnectModel() { // this is used by QMLManager when done filtering + busy.running = false diveList.diveListModel = diveModel } diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index b69783e95..cefeee365 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -2077,11 +2077,11 @@ void QMLManager::showDownloadPage(QString deviceString) void QMLManager::setFilter(const QString filterText) { // show that we are doing something, then do something in another thread in order not to block the UI - QMetaObject::invokeMethod(qmlWindow, "showBusy"); + QMetaObject::invokeMethod(qmlWindow, "showBusyAndDisconnectModel"); QtConcurrent::run(QThreadPool::globalInstance(), [=]{ DiveListSortModel::instance()->setFilter(filterText); - QMetaObject::invokeMethod(qmlWindow, "hideBusy"); + QMetaObject::invokeMethod(qmlWindow, "hideBusyAndConnectModel"); }); } |