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

Fix api

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