mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add helper function for the consumption of loaded dive data
This allows us to call that part of the process from multiple places in the future. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7c156f3ba1
commit
4b1edceca0
2 changed files with 7 additions and 1 deletions
|
@ -412,6 +412,12 @@ void QMLManager::loadDivesWithValidCredentials()
|
||||||
alreadySaving = false;
|
alreadySaving = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
consumeFinishedLoad(currentDiveTimestamp);
|
||||||
|
setLoadFromCloud(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMLManager::consumeFinishedLoad(timestamp_t currentDiveTimestamp)
|
||||||
|
{
|
||||||
prefs.unit_system = informational_prefs.unit_system;
|
prefs.unit_system = informational_prefs.unit_system;
|
||||||
if (informational_prefs.unit_system == IMPERIAL)
|
if (informational_prefs.unit_system == IMPERIAL)
|
||||||
informational_prefs.units = IMPERIAL_units;
|
informational_prefs.units = IMPERIAL_units;
|
||||||
|
@ -426,7 +432,6 @@ void QMLManager::loadDivesWithValidCredentials()
|
||||||
appendTextToLog(QStringLiteral("%1 dives loaded").arg(dive_table.nr));
|
appendTextToLog(QStringLiteral("%1 dives loaded").arg(dive_table.nr));
|
||||||
if (dive_table.nr == 0)
|
if (dive_table.nr == 0)
|
||||||
setStartPageText(tr("Cloud storage open successfully. No dives in dive list."));
|
setStartPageText(tr("Cloud storage open successfully. No dives in dive list."));
|
||||||
setLoadFromCloud(true);
|
|
||||||
alreadySaving = false;
|
alreadySaving = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,6 +133,7 @@ public slots:
|
||||||
QString getCurrentPosition();
|
QString getCurrentPosition();
|
||||||
QString getVersion() const;
|
QString getVersion() const;
|
||||||
void deleteGpsFix(quint64 when);
|
void deleteGpsFix(quint64 when);
|
||||||
|
void consumeFinishedLoad(timestamp_t currentDiveTimestamp);
|
||||||
void refreshDiveList();
|
void refreshDiveList();
|
||||||
void screenChanged(QScreen *screen);
|
void screenChanged(QScreen *screen);
|
||||||
qreal lastDevicePixelRatio();
|
qreal lastDevicePixelRatio();
|
||||||
|
|
Loading…
Add table
Reference in a new issue