summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-23 17:49:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-27 12:36:20 -0700
commitf175890632d5845d57066b0669c347b4c0992ff9 (patch)
treeefe856eb90e077c64f990b5ec5681c95eed7c866 /core/subsurface-qt
parente0f1817fdc3b0024c5e97cfa0db048384aae6d78 (diff)
downloadsubsurface-f175890632d5845d57066b0669c347b4c0992ff9.tar.gz
core: activate qPrefFacebook
remove Facebook from SettingsObjectWrapper and reference qPrefFacebook update files using SettingsObjectWrapper/Facebook to use qPrefFacebook this activated qPrefFacebook and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp68
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.h31
2 files changed, 3 insertions, 96 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 9e0e8992c..3085216c7 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -662,72 +662,6 @@ void TechnicalDetailsSettings::setShowIcd(bool value)
emit showIcdChanged(value);
}
-FacebookSettings::FacebookSettings(QObject *parent) :
- QObject(parent),
- group(QStringLiteral("WebApps")),
- subgroup(QStringLiteral("Facebook"))
-{
-}
-
-QString FacebookSettings::accessToken() const
-{
- return QString(prefs.facebook.access_token);
-}
-
-QString FacebookSettings::userId() const
-{
- return QString(prefs.facebook.user_id);
-}
-
-QString FacebookSettings::albumId() const
-{
- return QString(prefs.facebook.album_id);
-}
-
-void FacebookSettings::setAccessToken (const QString& value)
-{
-#if SAVE_FB_CREDENTIALS
- QSettings s;
- s.beginGroup(group);
- s.beginGroup(subgroup);
- s.setValue("ConnectToken", value);
-#endif
- free((void *)prefs.facebook.access_token);
- prefs.facebook.access_token = copy_qstring(value);
- emit accessTokenChanged(value);
-}
-
-void FacebookSettings::setUserId(const QString& value)
-{
- if (value == prefs.facebook.user_id)
- return;
-#if SAVE_FB_CREDENTIALS
- QSettings s;
- s.beginGroup(group);
- s.beginGroup(subgroup);
- s.setValue("UserId", value);
-#endif
- free((void *)prefs.facebook.user_id);
- prefs.facebook.user_id = copy_qstring(value);
- emit userIdChanged(value);
-}
-
-void FacebookSettings::setAlbumId(const QString& value)
-{
- if (value == prefs.facebook.album_id)
- return;
-#if SAVE_FB_CREDENTIALS
- QSettings s;
- s.beginGroup(group);
- s.beginGroup(subgroup);
- s.setValue("AlbumId", value);
-#endif
- free((void *)prefs.facebook.album_id);
- prefs.facebook.album_id = copy_qstring(value);
- emit albumIdChanged(value);
-}
-
-
GeocodingPreferences::GeocodingPreferences(QObject *parent) :
QObject(parent)
{
@@ -1829,7 +1763,7 @@ SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent):
QObject(parent),
techDetails(new TechnicalDetailsSettings(this)),
pp_gas(new PartialPressureGasSettings(this)),
- facebook(new FacebookSettings(this)),
+ facebook(new qPrefFacebook(this)),
geocoding(new GeocodingPreferences(this)),
proxy(new ProxySettings(this)),
cloud_storage(new qPrefCloudStorage(this)),
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index 9cb707044..cd30cb1ac 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -204,33 +204,6 @@ private:
const QString group = QStringLiteral("TecDetails");
};
-/* Control the state of the Facebook preferences */
-class FacebookSettings : public QObject {
- Q_OBJECT
- Q_PROPERTY(QString accessToken READ accessToken WRITE setAccessToken NOTIFY accessTokenChanged)
- Q_PROPERTY(QString userId READ userId WRITE setUserId NOTIFY userIdChanged)
- Q_PROPERTY(QString albumId READ albumId WRITE setAlbumId NOTIFY albumIdChanged)
-
-public:
- FacebookSettings(QObject *parent);
- QString accessToken() const;
- QString userId() const;
- QString albumId() const;
-
-public slots:
- void setAccessToken (const QString& value);
- void setUserId(const QString& value);
- void setAlbumId(const QString& value);
-
-signals:
- void accessTokenChanged(const QString& value);
- void userIdChanged(const QString& value);
- void albumIdChanged(const QString& value);
-private:
- QString group;
- QString subgroup;
-};
-
/* Control the state of the Geocoding preferences */
class GeocodingPreferences : public QObject {
Q_OBJECT
@@ -573,7 +546,7 @@ class SettingsObjectWrapper : public QObject {
Q_PROPERTY(TechnicalDetailsSettings* techical_details MEMBER techDetails CONSTANT)
Q_PROPERTY(PartialPressureGasSettings* pp_gas MEMBER pp_gas CONSTANT)
- Q_PROPERTY(FacebookSettings* facebook MEMBER facebook CONSTANT)
+ Q_PROPERTY(qPrefFacebook* facebook MEMBER facebook CONSTANT)
Q_PROPERTY(GeocodingPreferences* geocoding MEMBER geocoding CONSTANT)
Q_PROPERTY(ProxySettings* proxy MEMBER proxy CONSTANT)
Q_PROPERTY(qPrefCloudStorage* cloud_storage MEMBER cloud_storage CONSTANT)
@@ -593,7 +566,7 @@ public:
TechnicalDetailsSettings *techDetails;
PartialPressureGasSettings *pp_gas;
- FacebookSettings *facebook;
+ qPrefFacebook *facebook;
GeocodingPreferences *geocoding;
ProxySettings *proxy;
qPrefCloudStorage *cloud_storage;