summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-06 07:10:03 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-08 20:50:05 +0100
commitc75915733183144c033358aa7583bdeb922e4313 (patch)
tree3462f5287b8477f922f425c77f73a68f237a7c20 /mobile-widgets/qmlmanager.cpp
parent6095a5f04f204e786136eb203630f728a3df2983 (diff)
downloadsubsurface-c75915733183144c033358aa7583bdeb922e4313.tar.gz
Mobile: setup CollapsedDiveListSortModel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index ac1bf82d6..81da8c67c 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -277,6 +277,7 @@ void QMLManager::applicationStateChanged(Qt::ApplicationState state)
void QMLManager::openLocalThenRemote(QString url)
{
+ CollapsedDiveListSortModel::instance()->setSourceModel(nullptr);
DiveListModel::instance()->clear();
setNotificationText(tr("Open local dive data file"));
QByteArray fileNamePrt = QFile::encodeName(url);
@@ -318,6 +319,8 @@ void QMLManager::openLocalThenRemote(QString url)
qPrefPartialPressureGas::set_po2(git_prefs.pp_graphs.po2);
process_loaded_dives();
DiveListModel::instance()->reload();
+ CollapsedDiveListSortModel::instance()->setSourceModel(DiveListModel::instance());
+ CollapsedDiveListSortModel::instance()->updateFilterState();
appendTextToLog(QStringLiteral("%1 dives loaded from cache").arg(dive_table.nr));
setNotificationText(tr("%1 dives loaded from local dive data file").arg(dive_table.nr));
}
@@ -1397,6 +1400,8 @@ void QMLManager::selectDive(int id)
}
if (amount_selected == 0)
qWarning("QManager::selectDive() called with unknown id");
+ else
+ CollapsedDiveListSortModel::instance()->updateSelectionState();
}
void QMLManager::deleteDive(int id)