summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-01-10 08:39:24 +0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-10 09:25:57 -0700
commite700920e8efd23e2101194145d00c9f282a41e6c (patch)
tree63a4afc01af48a429472b6d8bc3472563303706e /mobile-widgets/qmlmanager.cpp
parent57b96490b2c5b81023439046dea225b8caf09946 (diff)
downloadsubsurface-e700920e8efd23e2101194145d00c9f282a41e6c.tar.gz
mobile: remove updateSelectedDive logic
Selection is now be handled by the core. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 0ccf6f42c..92dbfc4ff 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -149,7 +149,6 @@ void QMLManager::btRescan()
QMLManager::QMLManager() : m_locationServiceEnabled(false),
m_verboseEnabled(false),
- m_updateSelectedDive(-1),
m_selectedDiveTimestamp(0),
alreadySaving(false),
m_pluggedInDeviceName(""),
@@ -492,7 +491,7 @@ void QMLManager::finishSetup()
set_filename(NULL);
} else {
// successfully opened the local file, now add thigs to the dive list
- consumeFinishedLoad(0);
+ consumeFinishedLoad();
appendTextToLog(QString("working in no-cloud mode, finished loading %1 dives from %2").arg(dive_table.nr).arg(existing_filename));
}
} else {
@@ -748,7 +747,6 @@ void QMLManager::retrieveUserid()
void QMLManager::loadDivesWithValidCredentials()
{
QString url;
- timestamp_t currentDiveTimestamp = m_selectedDiveTimestamp;
if (getCloudURL(url)) {
setStartPageText(RED_FONT + tr("Cloud storage error: %1").arg(consumeError()) + END_FONT);
revertToNoCloudIfNeeded();
@@ -788,7 +786,7 @@ void QMLManager::loadDivesWithValidCredentials()
set_filename(NULL);
return;
}
- consumeFinishedLoad(currentDiveTimestamp);
+ consumeFinishedLoad();
successful_exit:
alreadySaving = false;
@@ -847,7 +845,7 @@ void QMLManager::revertToNoCloudIfNeeded()
alreadySaving = false;
}
-void QMLManager::consumeFinishedLoad(timestamp_t currentDiveTimestamp)
+void QMLManager::consumeFinishedLoad()
{
prefs.unit_system = git_prefs.unit_system;
if (git_prefs.unit_system == IMPERIAL)
@@ -862,8 +860,6 @@ void QMLManager::consumeFinishedLoad(timestamp_t currentDiveTimestamp)
prefs.pp_graphs.po2 = git_prefs.pp_graphs.po2;
process_loaded_dives();
MobileModels::instance()->reset();
- if (currentDiveTimestamp)
- setUpdateSelectedDive(DiveListSortModel::instance()->getIdxForId(get_dive_id_closest_to(currentDiveTimestamp)));
appendTextToLog(QStringLiteral("%1 dives loaded").arg(dive_table.nr));
if (dive_table.nr == 0)
setStartPageText(tr("Cloud storage open successfully. No dives in dive list."));
@@ -1715,12 +1711,6 @@ void QMLManager::setNotificationText(QString text)
emit notificationTextChanged();
}
-void QMLManager::setUpdateSelectedDive(int idx)
-{
- m_updateSelectedDive = idx;
- emit updateSelectedDiveChanged();
-}
-
void QMLManager::setSelectedDiveTimestamp(int when)
{
m_selectedDiveTimestamp = when;