Commit 45c66157 authored by Laurent Montel's avatar Laurent Montel 😁

Fix api

parent 2eaad1f4
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
set(PIM_VERSION "5.5.62") set(PIM_VERSION "5.5.63")
project(MailTransport VERSION ${PIM_VERSION}) project(MailTransport VERSION ${PIM_VERSION})
......
...@@ -35,12 +35,15 @@ SMTPMailTransportPlugin::~SMTPMailTransportPlugin() ...@@ -35,12 +35,15 @@ SMTPMailTransportPlugin::~SMTPMailTransportPlugin()
} }
QString SMTPMailTransportPlugin::name() const QVector<MailTransport::TransportAbstractPluginInfo> SMTPMailTransportPlugin::names() const
{ {
return i18n("SMTP"); MailTransport::TransportAbstractPluginInfo info;
info.name = i18n("SMTP");
info.identifier = QStringLiteral("smtp");
return QVector<MailTransport::TransportAbstractPluginInfo>() << info;
} }
bool SMTPMailTransportPlugin::configureTransport(MailTransport::Transport *transport, QWidget *parent) bool SMTPMailTransportPlugin::configureTransport(const QString &identifier, MailTransport::Transport *transport, QWidget *parent)
{ {
//TODO FIXME //TODO FIXME
return false; return false;
...@@ -53,3 +56,5 @@ void SMTPMailTransportPlugin::cleanUp(const QString &identifier) ...@@ -53,3 +56,5 @@ void SMTPMailTransportPlugin::cleanUp(const QString &identifier)
} }
#include "smtpmailtransportplugin.moc" #include "smtpmailtransportplugin.moc"
...@@ -30,8 +30,8 @@ public: ...@@ -30,8 +30,8 @@ public:
explicit SMTPMailTransportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {}); explicit SMTPMailTransportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {});
~SMTPMailTransportPlugin(); ~SMTPMailTransportPlugin();
QString name() const override; QVector<MailTransport::TransportAbstractPluginInfo> names() const override;
bool configureTransport(MailTransport::Transport *transport, QWidget *parent) override; bool configureTransport(const QString &identifier, MailTransport::Transport *transport, QWidget *parent) override;
void cleanUp(const QString &identifier) override; void cleanUp(const QString &identifier) override;
}; };
......
...@@ -32,7 +32,7 @@ TransportAbstractPlugin::~TransportAbstractPlugin() ...@@ -32,7 +32,7 @@ TransportAbstractPlugin::~TransportAbstractPlugin()
} }
TransportJob *TransportAbstractPlugin::createTransportJob() TransportJob *TransportAbstractPlugin::createTransportJob(const QString &identifier)
{ {
return nullptr; return nullptr;
} }
......
...@@ -21,10 +21,18 @@ ...@@ -21,10 +21,18 @@
#define TRANSPORTABSTRACTPLUGIN_H #define TRANSPORTABSTRACTPLUGIN_H
#include <QObject> #include <QObject>
#include <QVector>
#include "mailtransport_export.h" #include "mailtransport_export.h"
namespace MailTransport { namespace MailTransport {
class TransportJob; class TransportJob;
class Transport; class Transport;
struct MAILTRANSPORT_EXPORT TransportAbstractPluginInfo
{
QString name;
QString identifier;
};
class MAILTRANSPORT_EXPORT TransportAbstractPlugin : public QObject class MAILTRANSPORT_EXPORT TransportAbstractPlugin : public QObject
{ {
Q_OBJECT Q_OBJECT
...@@ -32,11 +40,12 @@ public: ...@@ -32,11 +40,12 @@ public:
explicit TransportAbstractPlugin(QObject *parent = nullptr); explicit TransportAbstractPlugin(QObject *parent = nullptr);
~TransportAbstractPlugin(); ~TransportAbstractPlugin();
virtual TransportJob *createTransportJob(); virtual TransportJob *createTransportJob(const QString &identifier);
virtual QString name() const = 0; virtual QVector<TransportAbstractPluginInfo> names() const = 0;
virtual bool configureTransport(Transport *transport, QWidget *parent) = 0; virtual bool configureTransport(const QString &identifier, Transport *transport, QWidget *parent) = 0;
virtual void cleanUp(const QString &identifier); virtual void cleanUp(const QString &identifier);
}; };
} }
Q_DECLARE_TYPEINFO(MailTransport::TransportAbstractPluginInfo, Q_MOVABLE_TYPE);
#endif // TRANSPORTABSTRACTPLUGIN_H #endif // TRANSPORTABSTRACTPLUGIN_H
...@@ -34,22 +34,24 @@ AkonadiMailTransportPlugin::~AkonadiMailTransportPlugin() ...@@ -34,22 +34,24 @@ AkonadiMailTransportPlugin::~AkonadiMailTransportPlugin()
} }
QString AkonadiMailTransportPlugin::name() const void AkonadiMailTransportPlugin::cleanUp(const QString &identifier)
{ {
Q_UNUSED(identifier);
//TODO FIXME //TODO FIXME
return {};
} }
bool AkonadiMailTransportPlugin::configureTransport(MailTransport::Transport *transport, QWidget *parent) QVector<MailTransport::TransportAbstractPluginInfo> AkonadiMailTransportPlugin::names() const
{ {
//TODO FIXME //TODO
return false; return {};
} }
void AkonadiMailTransportPlugin::cleanUp(const QString &identifier) bool AkonadiMailTransportPlugin::configureTransport(const QString &identifier, MailTransport::Transport *transport, QWidget *parent)
{ {
Q_UNUSED(identifier); //TODO
//TODO FIXME return {};
} }
#include "akonadimailtransportplugin.moc" #include "akonadimailtransportplugin.moc"
...@@ -30,8 +30,9 @@ public: ...@@ -30,8 +30,9 @@ public:
explicit AkonadiMailTransportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {}); explicit AkonadiMailTransportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {});
~AkonadiMailTransportPlugin(); ~AkonadiMailTransportPlugin();
QString name() const override; QVector<MailTransport::TransportAbstractPluginInfo> names() const override;
bool configureTransport(MailTransport::Transport *transport, QWidget *parent) override; bool configureTransport(const QString &identifier, MailTransport::Transport *transport, QWidget *parent) override;
void cleanUp(const QString &identifier) override; void cleanUp(const QString &identifier) override;
}; };
......
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