summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2019-02-01 04:11:25 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-02-01 17:16:43 -0800
commita1ffe115cfb27bd0dd57bf5266c7d37d9ce64dab (patch)
tree6589e06ecce1d0c461900fd2537bf5125afadf9d /core
parent0c07b02974a65608d7d71ef150d322678ec1170b (diff)
downloadsubsurface-a1ffe115cfb27bd0dd57bf5266c7d37d9ce64dab.tar.gz
facebook: remove the featute from the code base
Remove from: - unit tests - desktop widgets - preferences - core intergration - cmakefiles - build scripts - icons - docs Also remove the plugins and social network integration. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/CMakeLists.txt3
-rw-r--r--core/isocialnetworkintegration.cpp7
-rw-r--r--core/isocialnetworkintegration.h74
-rw-r--r--core/pluginmanager.cpp54
-rw-r--r--core/pluginmanager.h19
-rw-r--r--core/pref.h9
-rw-r--r--core/settings/qPref.cpp3
-rw-r--r--core/settings/qPrefFacebook.cpp44
-rw-r--r--core/settings/qPrefFacebook.h45
-rw-r--r--core/subsurfacestartup.c8
10 files changed, 0 insertions, 266 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 46cf43251..a242b0047 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -63,7 +63,6 @@ set(SUBSURFACE_CORE_LIB_SRCS
git-access.c
gpslocation.cpp
imagedownloader.cpp
- isocialnetworkintegration.cpp
libdivecomputer.c
liquivision.c
load-git.c
@@ -81,7 +80,6 @@ set(SUBSURFACE_CORE_LIB_SRCS
import-csv.c
planner.c
plannernotes.c
- pluginmanager.cpp
profile.c
qthelper.cpp
qt-init.cpp
@@ -108,7 +106,6 @@ set(SUBSURFACE_CORE_LIB_SRCS
settings/qPrefDisplay.cpp
settings/qPrefDiveComputer.cpp
settings/qPrefDivePlanner.cpp
- settings/qPrefFacebook.cpp
settings/qPrefGeneral.cpp
settings/qPrefGeocoding.cpp
settings/qPrefLanguage.cpp
diff --git a/core/isocialnetworkintegration.cpp b/core/isocialnetworkintegration.cpp
deleted file mode 100644
index 1786254f3..000000000
--- a/core/isocialnetworkintegration.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include "isocialnetworkintegration.h"
-
-//Hack for moc.
-ISocialNetworkIntegration::ISocialNetworkIntegration(QObject* parent) : QObject(parent)
-{
-}
diff --git a/core/isocialnetworkintegration.h b/core/isocialnetworkintegration.h
deleted file mode 100644
index 74abfeac3..000000000
--- a/core/isocialnetworkintegration.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#ifndef ISOCIALNETWORKINTEGRATION_H
-#define ISOCIALNETWORKINTEGRATION_H
-
-#include <QtPlugin>
-
-/* This Interface represents a Plugin for Social Network integration,
- * with it you may be able to create plugins for facebook, instagram,
- * twitpic, google plus and any other thing you may imagine.
- *
- * We bundle facebook integration as an example.
- */
-
-class ISocialNetworkIntegration : public QObject {
- Q_OBJECT
-public:
- ISocialNetworkIntegration(QObject* parent = 0);
-
- /*!
- * @name socialNetworkName
- * @brief The name of this social network
- * @return The name of this social network
- *
- * The name of this social network will be used to populate the Menu to toggle states
- * between connected/disconnected, and also submit stuff to it.
- */
- virtual QString socialNetworkName() const = 0;
-
- /*!
- * @name socialNetworkIcon
- * @brief The icon of this social network
- * @return The icon of this social network
- *
- * The icon of this social network will be used to populate the menu, and can also be
- * used on a toolbar if requested.
- */
- virtual QString socialNetworkIcon() const = 0;
-
- /*!
- * @name isConnected
- * @brief returns true if connected to this social network, false otherwise
- * @return true if connected to this social network, false otherwise
- */
- virtual bool isConnected() = 0;
-
- /*!
- * @name requestLogin
- * @brief try to login on this social network.
- *
- * Try to login on this social network. All widget implementation that
- * manages login should be done inside this function.
- */
- virtual void requestLogin() = 0;
-
- /*!
- * @name requestLogoff
- * @brief tries to logoff from this social network
- *
- * Try to logoff from this social network.
- */
- virtual void requestLogoff() = 0;
-
- /*!
- * @name uploadCurrentDive
- * @brief send the current dive info to the Social Network
- *
- * Should format all the options and pixmaps from the current dive
- * to update to the social network. All widget stuff related to sendint
- * dive information should be executed inside this function.
- */
- virtual void requestUpload() = 0;
-};
-
-#endif
diff --git a/core/pluginmanager.cpp b/core/pluginmanager.cpp
deleted file mode 100644
index 7a871f9b6..000000000
--- a/core/pluginmanager.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include "pluginmanager.h"
-
-#include <QApplication>
-#include <QDir>
-#include <QPluginLoader>
-#include <QDebug>
-
-static QList<ISocialNetworkIntegration*> _socialNetworks;
-
-// no point in including dive.h for this
-extern int verbose;
-
-PluginManager& PluginManager::instance()
-{
- static PluginManager self;
- return self;
-}
-
-PluginManager::PluginManager()
-{
-}
-
-void PluginManager::loadPlugins()
-{
- QDir pluginsDir(qApp->applicationDirPath());
-
-#if defined(Q_OS_WIN)
- if (pluginsDir.dirName().toLower() == "debug" || pluginsDir.dirName().toLower() == "release")
- pluginsDir.cdUp();
-#elif defined(Q_OS_MAC)
- if (pluginsDir.dirName() == "MacOS") {
- pluginsDir.cdUp();
- pluginsDir.cdUp();
- pluginsDir.cdUp();
- }
-#endif
- pluginsDir.cd("plugins");
-
- if (verbose)
- qDebug() << "Plugins Directory: " << pluginsDir;
-
- foreach (const QString& fileName, pluginsDir.entryList(QDir::Files)) {
- QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
- QObject *plugin = loader.instance();
- if(!plugin)
- continue;
-
- if (ISocialNetworkIntegration *social = qobject_cast<ISocialNetworkIntegration*>(plugin)) {
- qDebug() << "Adding the plugin: " << social->socialNetworkName();
- _socialNetworks.push_back(social);
- }
- }
-}
diff --git a/core/pluginmanager.h b/core/pluginmanager.h
deleted file mode 100644
index 55632c6fa..000000000
--- a/core/pluginmanager.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#ifndef PLUGINMANAGER_H
-#define PLUGINMANAGER_H
-
-#include <QObject>
-
-#include "isocialnetworkintegration.h"
-
-class PluginManager {
-public:
- static PluginManager& instance();
- void loadPlugins();
-private:
- PluginManager();
- PluginManager(const PluginManager&);
- PluginManager& operator=(const PluginManager&);
-};
-
-#endif
diff --git a/core/pref.h b/core/pref.h
index 3cfc90ebd..ee297780f 100644
--- a/core/pref.h
+++ b/core/pref.h
@@ -23,12 +23,6 @@ typedef struct
} partial_pressure_graphs_t;
typedef struct {
- const char *access_token;
- const char *user_id;
- const char *album_id;
-} facebook_prefs_t;
-
-typedef struct {
enum taxonomy_category category[3];
} geocoding_prefs_t;
@@ -111,9 +105,6 @@ struct preferences {
double mobile_scale;
bool show_developer;
- // ********** Facebook **********
- facebook_prefs_t facebook;
-
// ********** General **********
bool auto_recalculate_thumbnails;
bool extract_video_thumbnails;
diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp
index b1c7217b2..aded20e11 100644
--- a/core/settings/qPref.cpp
+++ b/core/settings/qPref.cpp
@@ -5,7 +5,6 @@
#include "qPrefDisplay.h"
#include "qPrefDiveComputer.h"
#include "qPrefDivePlanner.h"
-#include "qPrefFacebook.h"
#include "qPrefGeneral.h"
#include "qPrefGeocoding.h"
#include "qPrefLanguage.h"
@@ -51,7 +50,6 @@ void qPref::loadSync(bool doSync)
qPrefDisplay::loadSync(doSync);
qPrefDiveComputer::loadSync(doSync);
qPrefDivePlanner::loadSync(doSync);
- qPrefFacebook::loadSync(doSync);
qPrefGeneral::loadSync(doSync);
qPrefGeocoding::loadSync(doSync);
qPrefLanguage::loadSync(doSync);
@@ -76,7 +74,6 @@ void qPref::registerQML(QQmlEngine *engine)
ct->setContextProperty("PrefDisplay", qPrefDisplay::instance());
ct->setContextProperty("PrefDiveComputer", qPrefDiveComputer::instance());
ct->setContextProperty("PrefDivePlanner", qPrefDivePlanner::instance());
- ct->setContextProperty("PrefFacebook", qPrefFacebook::instance());
ct->setContextProperty("PrefGeneral", qPrefGeneral::instance());
ct->setContextProperty("PrefGeocoding", qPrefGeocoding::instance());
ct->setContextProperty("PrefLanguage", qPrefLanguage::instance());
diff --git a/core/settings/qPrefFacebook.cpp b/core/settings/qPrefFacebook.cpp
deleted file mode 100644
index 0f27c3c48..000000000
--- a/core/settings/qPrefFacebook.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include "qPrefFacebook.h"
-#include "qPrefPrivate.h"
-
-static const QString group = QStringLiteral("WebApps/Facebook");
-
-qPrefFacebook::qPrefFacebook(QObject *parent) : QObject(parent)
-{
-}
-
-qPrefFacebook*qPrefFacebook::instance()
-{
- static qPrefFacebook *self = new qPrefFacebook;
- return self;
-}
-
-void qPrefFacebook::loadSync(bool doSync)
-{
- // Empty, because FB probs are not loaded/synced to disk
-}
-
-void qPrefFacebook::set_access_token(const QString &value)
-{
- if (value != prefs.facebook.access_token) {
- qPrefPrivate::copy_txt(&prefs.facebook.access_token, value);
- emit instance()->access_tokenChanged(value);
- }
-}
-
-void qPrefFacebook::set_album_id(const QString &value)
-{
- if (value != prefs.facebook.album_id) {
- qPrefPrivate::copy_txt(&prefs.facebook.album_id, value);
- emit instance()->album_idChanged(value);
- }
-}
-
-void qPrefFacebook::set_user_id(const QString &value)
-{
- if (value != prefs.facebook.user_id) {
- qPrefPrivate::copy_txt(&prefs.facebook.user_id, value);
- emit instance()->user_idChanged(value);
- }
-}
diff --git a/core/settings/qPrefFacebook.h b/core/settings/qPrefFacebook.h
deleted file mode 100644
index fcd8f1f7c..000000000
--- a/core/settings/qPrefFacebook.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#ifndef QPREFSFACEBOOK_H
-#define QPREFSFACEBOOK_H
-#include "core/pref.h"
-
-#include <QObject>
-
-
-class qPrefFacebook : public QObject {
- Q_OBJECT
- Q_PROPERTY(QString access_token READ access_token WRITE set_access_token NOTIFY access_tokenChanged);
- Q_PROPERTY(QString album_id READ album_id WRITE set_album_id NOTIFY album_idChanged);
- Q_PROPERTY(QString user_id READ user_id WRITE set_user_id NOTIFY user_idChanged);
-
-public:
- qPrefFacebook(QObject *parent = NULL);
- static qPrefFacebook *instance();
-
- // Load/Sync local settings (disk) and struct preference
- static void loadSync(bool doSync);
- static void load() {loadSync(false); }
- static void sync() {loadSync(true); }
-
-public:
- static QString access_token() { return prefs.facebook.access_token; }
- static QString album_id() { return prefs.facebook.album_id; }
- static QString user_id() { return prefs.facebook.user_id; }
-
-public slots:
- static void set_access_token(const QString& value);
- static void set_album_id(const QString& value);
- static void set_user_id(const QString& value);
-
-signals:
- void access_tokenChanged(const QString& value);
- void album_idChanged(const QString& value);
- void user_idChanged(const QString& value);
-
-private:
- static void disk_access_token(bool doSync);
- static void disk_album_id(bool doSync);
- static void disk_user_id(bool doSync);
-};
-
-#endif
diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c
index 07be0cb43..3669cc8ec 100644
--- a/core/subsurfacestartup.c
+++ b/core/subsurfacestartup.c
@@ -77,11 +77,6 @@ struct preferences default_prefs = {
.pscr_ratio = 100,
.show_pictures_in_profile = true,
.tankbar = false,
- .facebook = {
- .user_id = NULL,
- .album_id = NULL,
- .access_token = NULL
- },
.defaultsetpoint = 1100,
.geocoding = {
.category = { 0 }
@@ -312,9 +307,6 @@ void copy_prefs(struct preferences *src, struct preferences *dest)
dest->cloud_storage_password = copy_string(src->cloud_storage_password);
dest->cloud_storage_email = copy_string(src->cloud_storage_email);
dest->cloud_storage_email_encoded = copy_string(src->cloud_storage_email_encoded);
- dest->facebook.access_token = copy_string(src->facebook.access_token);
- dest->facebook.user_id = copy_string(src->facebook.user_id);
- dest->facebook.album_id = copy_string(src->facebook.album_id);
dest->ffmpeg_executable = copy_string(src->ffmpeg_executable);
}