core/settings: extend qPrefCloudStorage with diveshare uid/private

Add diveshare/uid and diveshare/private to qPrefCloudStorage
to be used in Export.qml as well as diveshareexportdialog

Extending qPrefCloudStorage is more logical than adding QSettings
(and securing the same behaviour) outside qPref.

Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2019-12-08 13:27:03 +01:00 committed by Dirk Hohndel
parent 2949ea0fd9
commit 0a01072deb
2 changed files with 29 additions and 0 deletions

View file

@ -77,3 +77,24 @@ HANDLE_PREFERENCE_INT(CloudStorage, "timeout", cloud_timeout);
HANDLE_PREFERENCE_INT(CloudStorage, "cloud_verification_status", cloud_verification_status);
HANDLE_PREFERENCE_BOOL(CloudStorage, "save_password_local", save_password_local);
QString qPrefCloudStorage::diveshare_uid()
{
return qPrefPrivate::propValue(keyFromGroupAndName("", "diveshareExport/uid"), "").toString();
}
void qPrefCloudStorage::set_diveshare_uid(const QString &value)
{
qPrefPrivate::propSetValue(keyFromGroupAndName("", "diveshareExport/uid"), value, "");
emit instance()->diveshare_uidChanged(value);
}
bool qPrefCloudStorage::diveshare_private()
{
return qPrefPrivate::propValue(keyFromGroupAndName("", "diveshareExport/private"), "").toBool();
}
void qPrefCloudStorage::set_diveshare_private(bool value)
{
qPrefPrivate::propSetValue(keyFromGroupAndName("", "diveshareExport/private"), value, false);
emit instance()->diveshare_privateChanged(value);
}