mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core/settings: extend qPrefCloudStorage with divelogsde user info
Add divelogsde_userid and divelogsde_password to qPrefCloudStorage to be used in Export.qml 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:
parent
5aba24248f
commit
42939ab7f8
2 changed files with 29 additions and 1 deletions
|
@ -78,7 +78,6 @@ HANDLE_PREFERENCE_INT(CloudStorage, "cloud_verification_status", cloud_verificat
|
|||
|
||||
HANDLE_PREFERENCE_BOOL(CloudStorage, "save_password_local", save_password_local);
|
||||
|
||||
|
||||
QString qPrefCloudStorage::diveshare_uid()
|
||||
{
|
||||
return qPrefPrivate::propValue(keyFromGroupAndName("", "diveshareExport/uid"), "").toString();
|
||||
|
@ -98,3 +97,24 @@ void qPrefCloudStorage::set_diveshare_private(bool value)
|
|||
qPrefPrivate::propSetValue(keyFromGroupAndName("", "diveshareExport/private"), value, false);
|
||||
emit instance()->diveshare_privateChanged(value);
|
||||
}
|
||||
|
||||
QString qPrefCloudStorage::divelogde_user()
|
||||
{
|
||||
return qPrefPrivate::propValue(keyFromGroupAndName("", "divelogde_user"), "").toString();
|
||||
}
|
||||
void qPrefCloudStorage::set_divelogde_user(const QString &value)
|
||||
{
|
||||
qPrefPrivate::propSetValue(keyFromGroupAndName("", "divelogde_user"), value, "");
|
||||
emit instance()->divelogde_userChanged(value);
|
||||
}
|
||||
|
||||
|
||||
QString qPrefCloudStorage::divelogde_pass()
|
||||
{
|
||||
return qPrefPrivate::propValue(keyFromGroupAndName("", "divelogde_pass"), "").toString();
|
||||
}
|
||||
void qPrefCloudStorage::set_divelogde_pass(const QString &value)
|
||||
{
|
||||
qPrefPrivate::propSetValue(keyFromGroupAndName("", "divelogde_pass"), value, "");
|
||||
emit instance()->divelogde_passChanged(value);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ class qPrefCloudStorage : public QObject {
|
|||
Q_PROPERTY(bool save_password_local READ save_password_local WRITE set_save_password_local NOTIFY save_password_localChanged)
|
||||
Q_PROPERTY(QString diveshare_userid READ diveshare_uid WRITE set_diveshare_uid NOTIFY diveshare_uidChanged);
|
||||
Q_PROPERTY(bool diveshare_private READ diveshare_private WRITE set_diveshare_private NOTIFY diveshare_privateChanged);
|
||||
Q_PROPERTY(QString divelogde_user READ divelogde_user WRITE set_divelogde_user NOTIFY divelogde_userChanged);
|
||||
Q_PROPERTY(QString divelogde_pass READ divelogde_pass WRITE set_divelogde_pass NOTIFY divelogde_passChanged);
|
||||
|
||||
public:
|
||||
static qPrefCloudStorage *instance();
|
||||
|
@ -50,6 +52,8 @@ public:
|
|||
static bool save_password_local() { return prefs.save_password_local; }
|
||||
static QString diveshare_uid();
|
||||
static bool diveshare_private();
|
||||
static QString divelogde_user();
|
||||
static QString divelogde_pass();
|
||||
|
||||
public slots:
|
||||
static void set_cloud_auto_sync(bool value);
|
||||
|
@ -63,6 +67,8 @@ public slots:
|
|||
static void set_save_password_local(bool value);
|
||||
static void set_diveshare_uid(const QString &value);
|
||||
static void set_diveshare_private(bool value);
|
||||
static void set_divelogde_user(const QString &value);
|
||||
static void set_divelogde_pass(const QString &value);
|
||||
|
||||
signals:
|
||||
void cloud_auto_syncChanged(bool value);
|
||||
|
@ -76,6 +82,8 @@ signals:
|
|||
void save_password_localChanged(bool value);
|
||||
void diveshare_uidChanged(const QString &value);
|
||||
void diveshare_privateChanged(bool value);
|
||||
void divelogde_userChanged(const QString &value);
|
||||
void divelogde_passChanged(const QString &value);
|
||||
|
||||
private:
|
||||
qPrefCloudStorage() {}
|
||||
|
|
Loading…
Add table
Reference in a new issue