mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
core: qPrefCloudStorage save userid to new location
userid was saved outside all groups, even though it belongs to cloudStorage Add code to save in new location and read from new/old location Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
daf8921d6f
commit
19871a6ab2
1 changed files with 11 additions and 5 deletions
|
@ -108,10 +108,16 @@ HANDLE_PREFERENCE_BOOL(CloudStorage, "/save_userid_local", save_userid_local);
|
||||||
SET_PREFERENCE_TXT(CloudStorage, userid);
|
SET_PREFERENCE_TXT(CloudStorage, userid);
|
||||||
void qPrefCloudStorage::disk_userid(bool doSync)
|
void qPrefCloudStorage::disk_userid(bool doSync)
|
||||||
{
|
{
|
||||||
//WARNING: UserId is stored outside of any group, but it belongs to Cloud Storage.
|
if (doSync) {
|
||||||
const QString group = QStringLiteral("");
|
// always save in new position (part of cloud storage group)
|
||||||
if (doSync)
|
|
||||||
qPrefPrivate::instance()->setting.setValue(group + "subsurface_webservice_uid", prefs.userid);
|
qPrefPrivate::instance()->setting.setValue(group + "subsurface_webservice_uid", prefs.userid);
|
||||||
else
|
} else {
|
||||||
prefs.userid = copy_qstring(qPrefPrivate::instance()->setting.value(group + "subsurface_webservice_uid", default_prefs.userid).toString());
|
//WARNING: UserId was stored outside of any group.
|
||||||
|
// try to read from new location, if it fails read from old location
|
||||||
|
prefs.userid = copy_qstring(qPrefPrivate::instance()->setting.value(group + "subsurface_webservice_uid", "NoUserIdHere").toString());
|
||||||
|
if (QString(prefs.userid) == "NoUserIdHere") {
|
||||||
|
const QString group = QStringLiteral("");
|
||||||
|
prefs.userid = copy_qstring(qPrefPrivate::instance()->setting.value(group + "subsurface_webservice_uid", default_prefs.userid).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue