mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: setup CollapsedDiveListSortModel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6095a5f04f
commit
c759157331
2 changed files with 6 additions and 0 deletions
|
@ -277,6 +277,7 @@ void QMLManager::applicationStateChanged(Qt::ApplicationState state)
|
||||||
|
|
||||||
void QMLManager::openLocalThenRemote(QString url)
|
void QMLManager::openLocalThenRemote(QString url)
|
||||||
{
|
{
|
||||||
|
CollapsedDiveListSortModel::instance()->setSourceModel(nullptr);
|
||||||
DiveListModel::instance()->clear();
|
DiveListModel::instance()->clear();
|
||||||
setNotificationText(tr("Open local dive data file"));
|
setNotificationText(tr("Open local dive data file"));
|
||||||
QByteArray fileNamePrt = QFile::encodeName(url);
|
QByteArray fileNamePrt = QFile::encodeName(url);
|
||||||
|
@ -318,6 +319,8 @@ void QMLManager::openLocalThenRemote(QString url)
|
||||||
qPrefPartialPressureGas::set_po2(git_prefs.pp_graphs.po2);
|
qPrefPartialPressureGas::set_po2(git_prefs.pp_graphs.po2);
|
||||||
process_loaded_dives();
|
process_loaded_dives();
|
||||||
DiveListModel::instance()->reload();
|
DiveListModel::instance()->reload();
|
||||||
|
CollapsedDiveListSortModel::instance()->setSourceModel(DiveListModel::instance());
|
||||||
|
CollapsedDiveListSortModel::instance()->updateFilterState();
|
||||||
appendTextToLog(QStringLiteral("%1 dives loaded from cache").arg(dive_table.nr));
|
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));
|
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)
|
if (amount_selected == 0)
|
||||||
qWarning("QManager::selectDive() called with unknown id");
|
qWarning("QManager::selectDive() called with unknown id");
|
||||||
|
else
|
||||||
|
CollapsedDiveListSortModel::instance()->updateSelectionState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMLManager::deleteDive(int id)
|
void QMLManager::deleteDive(int id)
|
||||||
|
|
|
@ -102,6 +102,7 @@ void run_ui()
|
||||||
gpsSortModel->sort(0, Qt::DescendingOrder);
|
gpsSortModel->sort(0, Qt::DescendingOrder);
|
||||||
QQmlContext *ctxt = engine.rootContext();
|
QQmlContext *ctxt = engine.rootContext();
|
||||||
ctxt->setContextProperty("diveModel", DiveListSortModel::instance());
|
ctxt->setContextProperty("diveModel", DiveListSortModel::instance());
|
||||||
|
ctxt->setContextProperty("diveTripModel", CollapsedDiveListSortModel::instance());
|
||||||
ctxt->setContextProperty("gpsModel", gpsSortModel);
|
ctxt->setContextProperty("gpsModel", gpsSortModel);
|
||||||
ctxt->setContextProperty("vendorList", vendorList);
|
ctxt->setContextProperty("vendorList", vendorList);
|
||||||
set_non_bt_addresses();
|
set_non_bt_addresses();
|
||||||
|
|
Loading…
Add table
Reference in a new issue