summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-06-28 13:47:07 +0200
committerMontel Laurent <[email protected]>2017-06-28 13:47:07 +0200
commit62732ad5ce112d42003ddd308692120cc3dc4155 (patch)
tree94c1546198bca151f6480e3038529a0b59aa35a4
parent45c6615711729e846cb3e3bbd61d7f08baaa72a1 (diff)
Continue to implement manager
-rw-r--r--src/kmailtransport/plugins/transportpluginmanager.cpp62
-rw-r--r--src/kmailtransport/plugins/transportpluginmanager.h3
2 files changed, 61 insertions, 4 deletions
diff --git a/src/kmailtransport/plugins/transportpluginmanager.cpp b/src/kmailtransport/plugins/transportpluginmanager.cpp
index 7a7c24a..18b8d6e 100644
--- a/src/kmailtransport/plugins/transportpluginmanager.cpp
+++ b/src/kmailtransport/plugins/transportpluginmanager.cpp
@@ -20,22 +20,76 @@
#include "transportpluginmanager.h"
using namespace MailTransport;
-Q_GLOBAL_STATIC(TransportPluginManager, sInstance)
+
+class TransportPluginManagerInstancePrivate
+{
+public:
+ TransportPluginManagerInstancePrivate()
+ : transportPluginManager(new TransportPluginManager)
+ {
+ }
+
+ ~TransportPluginManagerInstancePrivate()
+ {
+ delete transportPluginManager;
+ }
+
+ TransportPluginManager *transportPluginManager;
+};
+
+Q_GLOBAL_STATIC(TransportPluginManagerInstancePrivate, sInstance)
+
+class MailTransportPluginInfo
+{
+public:
+ MailTransportPluginInfo()
+ : /*plugin(nullptr),*/
+ isEnabled(true)
+ {
+
+ }
+ QString metaDataFileNameBaseName;
+ QString metaDataFileName;
+ bool isEnabled;
+};
+
+namespace
+{
+QString pluginVersion()
+{
+ return QStringLiteral("1.0");
+}
+}
+
+class MailTransport::TransportPluginManagerPrivate
+{
+public:
+ TransportPluginManagerPrivate(TransportPluginManager *qq)
+ : q(qq)
+ {
+
+ }
+ void loadPlugin(MailTransportPluginInfo *item);
+private:
+ TransportPluginManager *q;
+};
+
TransportPluginManager::TransportPluginManager(QObject *parent)
- : QObject(parent)
+ : QObject(parent),
+ d(new TransportPluginManagerPrivate(this))
{
}
TransportPluginManager::~TransportPluginManager()
{
-
+ delete d;
}
TransportPluginManager *TransportPluginManager::self()
{
- return sInstance;
+ return sInstance->transportPluginManager;
}
diff --git a/src/kmailtransport/plugins/transportpluginmanager.h b/src/kmailtransport/plugins/transportpluginmanager.h
index 4005fe9..7d64cec 100644
--- a/src/kmailtransport/plugins/transportpluginmanager.h
+++ b/src/kmailtransport/plugins/transportpluginmanager.h
@@ -22,6 +22,7 @@
#include <QObject>
namespace MailTransport {
+class TransportPluginManagerPrivate;
class TransportPluginManager : public QObject
{
Q_OBJECT
@@ -30,6 +31,8 @@ public:
~TransportPluginManager();
static TransportPluginManager *self();
+private:
+ TransportPluginManagerPrivate *const d;
};
}