mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: don't load dives before the UI has been instantiated
This should deal with a big part of the delay when starting the app. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2f2e9da2cd
commit
f6ae8bf3ea
2 changed files with 8 additions and 3 deletions
|
@ -272,5 +272,6 @@ MobileComponents.ApplicationWindow {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
print("MobileComponents.Units.gridUnit is: " + MobileComponents.Units.gridUnit);
|
print("MobileComponents.Units.gridUnit is: " + MobileComponents.Units.gridUnit);
|
||||||
|
manager.loadDives();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,6 @@ QMLManager::QMLManager() :
|
||||||
|
|
||||||
setDistanceThreshold(prefs.distance_threshold);
|
setDistanceThreshold(prefs.distance_threshold);
|
||||||
setTimeThreshold(prefs.time_threshold / 60);
|
setTimeThreshold(prefs.time_threshold / 60);
|
||||||
if (!same_string(prefs.cloud_storage_email, "") && !same_string(prefs.cloud_storage_password, ""))
|
|
||||||
loadDives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QMLManager::~QMLManager()
|
QMLManager::~QMLManager()
|
||||||
|
@ -90,6 +88,12 @@ void QMLManager::savePreferences()
|
||||||
|
|
||||||
void QMLManager::loadDives()
|
void QMLManager::loadDives()
|
||||||
{
|
{
|
||||||
|
if (same_string(prefs.cloud_storage_email, "") || same_string(prefs.cloud_storage_password, "")) {
|
||||||
|
qmlUiShowMessage("Please set up cloud storage credentials");
|
||||||
|
appendTextToLog("Unable to load dives; cloud storage credentials missing");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qmlUiShowMessage("Loading dives...");
|
qmlUiShowMessage("Loading dives...");
|
||||||
appendTextToLog("Loading dives...");
|
appendTextToLog("Loading dives...");
|
||||||
QString url;
|
QString url;
|
||||||
|
|
Loading…
Add table
Reference in a new issue