diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-09-09 13:15:14 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-09-29 08:13:25 -0700 |
commit | 2e91de9d950aa77b9bd181d422a0d5c3ed014079 (patch) | |
tree | df46a1b169e15e7d8dd32bbefeae26f0cd3f1a13 /mobile-widgets | |
parent | e903c6bd1ae0eb8dd07c4ea2ab7e6c4170d0b385 (diff) | |
download | subsurface-2e91de9d950aa77b9bd181d422a0d5c3ed014079.tar.gz |
mobile: initialize credential data in one place
It appears that the onCompleted of the StartPage item is triggered
before the onCompleted of the rootItem. This is logical as the
Startpage is a child of the rootItem. And, yes, this does matter.
As the divelist also contains the logic for initial cloud
registration (and is the default page shown in a state where
the cloud credentials are valid (CS_VERIFIED state)), we need to
know the correct credential state at start of the app.
The move of this one line of code makes sure of that, in addition
to setting the credential state from the preferences. Now, the
setupActions function can reference correct credential data.
This is further preparation for a better cloud creation
process from mobile.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 1 | ||||
-rw-r--r-- | mobile-widgets/qml/main.qml | 1 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 1 |
3 files changed, 2 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index be659e6b9..9442bf9b7 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -291,6 +291,7 @@ Kirigami.ScrollablePage { } Component.onCompleted: { + manager.finishSetup(); setupActions(); } } diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 1cf1ea35d..72e475a32 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -470,7 +470,6 @@ if you have network connectivity and want to sync your data to cloud storage."), } Component.onCompleted: { - manager.finishSetup(); rootItem.visible = true diveList.opacity = 1 rootItem.opacity = 1 diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 7a132a13e..94e58900b 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -221,6 +221,7 @@ void QMLManager::finishSetup() setCloudUserName(prefs.cloud_storage_email); setCloudPassword(prefs.cloud_storage_password); setSyncToCloud(!prefs.git_local_only); + setCredentialStatus((cloud_status_qml) prefs.cloud_verification_status); // if the cloud credentials are valid, we should get the GPS Webservice ID as well QString url; if (!cloudUserName().isEmpty() && |