diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-02-19 21:43:37 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-01 10:21:44 -0800 |
commit | eed4e2746d5a81975f3cabf440e241a38a4aec7c (patch) | |
tree | c63925db5abd4e2d43f12d4764eae88a0ad4e9ee | |
parent | b5a427c8804bc75f5a2007ece03f9d8b34cd963f (diff) | |
download | subsurface-eed4e2746d5a81975f3cabf440e241a38a4aec7c.tar.gz |
filter: don't search in background on mobile
I experienced weird crashes that seemed timing-related when
using the filter. Therefore, remove the multi-threading thing.
So far no more crashes, but keep a close eye on that.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r-- | mobile-widgets/qml/main.qml | 10 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 11 |
2 files changed, 3 insertions, 18 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 0b7870b97..ed56f8ec6 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -60,21 +60,11 @@ Kirigami.ApplicationWindow { 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 showPassiveNotification("", 10) // this hides a notification messssage that's still shown } - function hideBusyAndConnectModel() { // this is used by QMLManager when done filtering - busy.running = false - diveList.diveListModel = diveTripModel - } - function returnTopPage() { for (var i=pageStack.depth; i>1; i--) { pageStack.pop() diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 5896428b8..49556646b 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -2097,20 +2097,15 @@ void QMLManager::showDownloadPage(QString deviceString) void QMLManager::setFilter(const QString filterText, int index) { FilterData::Mode mode; + // This is ugly - the indexes of the mode are hardcoded! switch(index) { default: case 0: mode = FilterData::Mode::FULLTEXT; break; case 1: mode = FilterData::Mode::PEOPLE; break; case 2: mode = FilterData::Mode::TAGS; break; } - // show that we are doing something, then do something in another thread in order not to block the UI - QMetaObject::invokeMethod(qmlWindow, "showBusyAndDisconnectModel"); - QtConcurrent::run(QThreadPool::globalInstance(), - [this,filterText,mode]{ - DiveListSortModel::instance()->setFilter(filterText, mode); - CollapsedDiveListSortModel::instance()->updateFilterState(); - QMetaObject::invokeMethod(qmlWindow, "hideBusyAndConnectModel"); - }); + DiveListSortModel::instance()->setFilter(filterText, mode); + CollapsedDiveListSortModel::instance()->updateFilterState(); } void QMLManager::setShowNonDiveComputers(bool show) |