Commit 62732ad5 authored by Laurent Montel's avatar Laurent Montel 😁

Continue to implement manager

parent 45c66157
......@@ -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;
}
......@@ -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;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment