Commit 30e49895 authored by Laurent Montel's avatar Laurent Montel 😁

Rename

parent 090bfddd
......@@ -17,23 +17,24 @@
#include "mailnetworkaccessmanager.h"
#include "viewer/webengine/urlinterceptor/mailnetworkurlinterceptormanager.h"
#include "viewer/webengine/urlinterceptor/mailnetworkurlinterceptor.h"
#include <QWebEngineProfile>
#include <viewer/webengine/urlinterceptor/mailnetworkurlinterceptor.h>
using namespace MessageViewer;
MailNetworkAccessManager::MailNetworkAccessManager(QObject *parent)
NetworkAccessManager::NetworkAccessManager(QObject *parent)
: QNetworkAccessManager(parent)
{
MessageViewer::MailNetworkUrlInterceptorManager *manager = new MessageViewer::MailNetworkUrlInterceptorManager(this);
MessageViewer::NetworkUrlInterceptorManager *manager = new MessageViewer::NetworkUrlInterceptorManager(this);
MessageViewer::MailNetworkUrlInterceptor *networkUrlInterceptor = new MessageViewer::MailNetworkUrlInterceptor(this);
Q_FOREACH (MessageViewer::MailNetworkPluginUrlInterceptorInterface *interface, manager->interfaceList()) {
MessageViewer::NetworkUrlInterceptor *networkUrlInterceptor = new MessageViewer::NetworkUrlInterceptor(this);
Q_FOREACH (MessageViewer::NetworkPluginUrlInterceptorInterface *interface, manager->interfaceList()) {
networkUrlInterceptor->addInterceptor(interface);
}
QWebEngineProfile::defaultProfile()->setRequestInterceptor(networkUrlInterceptor);
}
MailNetworkAccessManager::~MailNetworkAccessManager()
NetworkAccessManager::~NetworkAccessManager()
{
}
......@@ -22,12 +22,12 @@
#include "messageviewer_export.h"
namespace MessageViewer
{
class MESSAGEVIEWER_EXPORT MailNetworkAccessManager : public QNetworkAccessManager
class MESSAGEVIEWER_EXPORT NetworkAccessManager : public QNetworkAccessManager
{
Q_OBJECT
public:
explicit MailNetworkAccessManager(QObject *parent = Q_NULLPTR);
~MailNetworkAccessManager();
explicit NetworkAccessManager(QObject *parent = Q_NULLPTR);
~NetworkAccessManager();
};
}
#endif // MAILNETWORKACCESSMANAGER_H
......@@ -19,18 +19,18 @@
using namespace MessageViewer;
MailNetworkPluginUrlInterceptor::MailNetworkPluginUrlInterceptor(QObject *parent)
NetworkPluginUrlInterceptor::NetworkPluginUrlInterceptor(QObject *parent)
: QObject(parent)
{
}
MailNetworkPluginUrlInterceptor::~MailNetworkPluginUrlInterceptor()
NetworkPluginUrlInterceptor::~NetworkPluginUrlInterceptor()
{
}
bool MailNetworkPluginUrlInterceptor::hasConfigureSupport() const
bool NetworkPluginUrlInterceptor::hasConfigureSupport() const
{
return false;
}
......@@ -22,14 +22,14 @@
#include "messageviewer_export.h"
namespace MessageViewer
{
class MailNetworkPluginUrlInterceptorInterface;
class MESSAGEVIEWER_EXPORT MailNetworkPluginUrlInterceptor : public QObject
class NetworkPluginUrlInterceptorInterface;
class MESSAGEVIEWER_EXPORT NetworkPluginUrlInterceptor : public QObject
{
Q_OBJECT
public:
explicit MailNetworkPluginUrlInterceptor(QObject *parent = Q_NULLPTR);
~MailNetworkPluginUrlInterceptor();
virtual MailNetworkPluginUrlInterceptorInterface *createInterface(QObject *parent = Q_NULLPTR) = 0;
explicit NetworkPluginUrlInterceptor(QObject *parent = Q_NULLPTR);
~NetworkPluginUrlInterceptor();
virtual NetworkPluginUrlInterceptorInterface *createInterface(QObject *parent = Q_NULLPTR) = 0;
virtual bool hasConfigureSupport() const;
};
......
......@@ -19,13 +19,13 @@
using namespace MessageViewer;
MailNetworkPluginUrlInterceptorInterface::MailNetworkPluginUrlInterceptorInterface(QObject *parent)
NetworkPluginUrlInterceptorInterface::NetworkPluginUrlInterceptorInterface(QObject *parent)
: QObject(parent)
{
}
MailNetworkPluginUrlInterceptorInterface::~MailNetworkPluginUrlInterceptorInterface()
NetworkPluginUrlInterceptorInterface::~NetworkPluginUrlInterceptorInterface()
{
}
......@@ -23,12 +23,12 @@
class QWebEngineUrlRequestInfo;
namespace MessageViewer
{
class MESSAGEVIEWER_EXPORT MailNetworkPluginUrlInterceptorInterface : public QObject
class MESSAGEVIEWER_EXPORT NetworkPluginUrlInterceptorInterface : public QObject
{
Q_OBJECT
public:
explicit MailNetworkPluginUrlInterceptorInterface(QObject *parent = Q_NULLPTR);
~MailNetworkPluginUrlInterceptorInterface();
explicit NetworkPluginUrlInterceptorInterface(QObject *parent = Q_NULLPTR);
~NetworkPluginUrlInterceptorInterface();
virtual void interceptRequest(QWebEngineUrlRequestInfo &info) = 0;
};
......
......@@ -23,19 +23,19 @@
using namespace MessageViewer;
class MessageViewer::MailNetworkUrlInterceptorPrivate
class MessageViewer::NetworkUrlInterceptorPrivate
{
public:
MailNetworkUrlInterceptorPrivate()
NetworkUrlInterceptorPrivate()
{
}
void addInterceptor(MailNetworkPluginUrlInterceptorInterface *interceptor);
void addInterceptor(NetworkPluginUrlInterceptorInterface *interceptor);
void interceptRequest(QWebEngineUrlRequestInfo &info);
QVector<MailNetworkPluginUrlInterceptorInterface *> listInterceptor;
QVector<NetworkPluginUrlInterceptorInterface *> listInterceptor;
};
void MailNetworkUrlInterceptorPrivate::addInterceptor(MailNetworkPluginUrlInterceptorInterface *interceptor)
void NetworkUrlInterceptorPrivate::addInterceptor(NetworkPluginUrlInterceptorInterface *interceptor)
{
if (!listInterceptor.contains(interceptor)) {
listInterceptor.append(interceptor);
......@@ -44,31 +44,31 @@ void MailNetworkUrlInterceptorPrivate::addInterceptor(MailNetworkPluginUrlInterc
}
}
void MailNetworkUrlInterceptorPrivate::interceptRequest(QWebEngineUrlRequestInfo &info)
void NetworkUrlInterceptorPrivate::interceptRequest(QWebEngineUrlRequestInfo &info)
{
Q_FOREACH (MailNetworkPluginUrlInterceptorInterface *inter, listInterceptor) {
Q_FOREACH (NetworkPluginUrlInterceptorInterface *inter, listInterceptor) {
inter->interceptRequest(info);
}
}
MailNetworkUrlInterceptor::MailNetworkUrlInterceptor(QObject *parent)
NetworkUrlInterceptor::NetworkUrlInterceptor(QObject *parent)
: QWebEngineUrlRequestInterceptor(parent),
d(new MailNetworkUrlInterceptorPrivate)
d(new NetworkUrlInterceptorPrivate)
{
}
MailNetworkUrlInterceptor::~MailNetworkUrlInterceptor()
NetworkUrlInterceptor::~NetworkUrlInterceptor()
{
delete d;
}
void MailNetworkUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
void NetworkUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
{
d->interceptRequest(info);
}
void MailNetworkUrlInterceptor::addInterceptor(MailNetworkPluginUrlInterceptorInterface *interceptor)
void NetworkUrlInterceptor::addInterceptor(NetworkPluginUrlInterceptorInterface *interceptor)
{
d->addInterceptor(interceptor);
}
......
......@@ -23,20 +23,20 @@
namespace MessageViewer
{
class MailNetworkUrlInterceptorPrivate;
class MailNetworkPluginUrlInterceptorInterface;
class MESSAGEVIEWER_EXPORT MailNetworkUrlInterceptor : public QWebEngineUrlRequestInterceptor
class NetworkUrlInterceptorPrivate;
class NetworkPluginUrlInterceptorInterface;
class MESSAGEVIEWER_EXPORT NetworkUrlInterceptor : public QWebEngineUrlRequestInterceptor
{
Q_OBJECT
public:
explicit MailNetworkUrlInterceptor(QObject *parent = Q_NULLPTR);
~MailNetworkUrlInterceptor();
explicit NetworkUrlInterceptor(QObject *parent = Q_NULLPTR);
~NetworkUrlInterceptor();
void interceptRequest(QWebEngineUrlRequestInfo &info) Q_DECL_OVERRIDE;
void addInterceptor(MailNetworkPluginUrlInterceptorInterface *interceptor);
void addInterceptor(NetworkPluginUrlInterceptorInterface *interceptor);
private:
MailNetworkUrlInterceptorPrivate *const d;
NetworkUrlInterceptorPrivate *const d;
};
}
#endif // MAILNETWORKURLINTERCEPTOR_H
......@@ -22,40 +22,40 @@
using namespace MessageViewer;
class MessageViewer::MailNetworkUrlInterceptorManagerPrivate
class MessageViewer::NetworkUrlInterceptorManagerPrivate
{
public:
MailNetworkUrlInterceptorManagerPrivate(MailNetworkUrlInterceptorManager *qq)
NetworkUrlInterceptorManagerPrivate(NetworkUrlInterceptorManager *qq)
: q(qq)
{
createInterfaces();
}
void createInterfaces();
QVector<MessageViewer::MailNetworkPluginUrlInterceptorInterface *> mListInterface;
MailNetworkUrlInterceptorManager *q;
QVector<MessageViewer::NetworkPluginUrlInterceptorInterface *> mListInterface;
NetworkUrlInterceptorManager *q;
};
void MailNetworkUrlInterceptorManagerPrivate::createInterfaces()
void NetworkUrlInterceptorManagerPrivate::createInterfaces()
{
Q_FOREACH (MailNetworkPluginUrlInterceptor *plugin, MailNetworkUrlInterceptorPluginManager::self()->pluginsList()) {
MessageViewer::MailNetworkPluginUrlInterceptorInterface *interface = plugin->createInterface(q);
Q_FOREACH (NetworkPluginUrlInterceptor *plugin, NetworkUrlInterceptorPluginManager::self()->pluginsList()) {
MessageViewer::NetworkPluginUrlInterceptorInterface *interface = plugin->createInterface(q);
mListInterface.append(interface);
}
}
MailNetworkUrlInterceptorManager::MailNetworkUrlInterceptorManager(QObject *parent)
NetworkUrlInterceptorManager::NetworkUrlInterceptorManager(QObject *parent)
: QObject(parent),
d(new MailNetworkUrlInterceptorManagerPrivate(this))
d(new NetworkUrlInterceptorManagerPrivate(this))
{
}
MailNetworkUrlInterceptorManager::~MailNetworkUrlInterceptorManager()
NetworkUrlInterceptorManager::~NetworkUrlInterceptorManager()
{
delete d;
}
QVector<MessageViewer::MailNetworkPluginUrlInterceptorInterface *> MailNetworkUrlInterceptorManager::interfaceList() const
QVector<MessageViewer::NetworkPluginUrlInterceptorInterface *> NetworkUrlInterceptorManager::interfaceList() const
{
return d->mListInterface;
}
......
......@@ -24,17 +24,17 @@
namespace MessageViewer
{
class MailNetworkUrlInterceptorManagerPrivate;
class MESSAGEVIEWER_EXPORT MailNetworkUrlInterceptorManager : public QObject
class NetworkUrlInterceptorManagerPrivate;
class MESSAGEVIEWER_EXPORT NetworkUrlInterceptorManager : public QObject
{
Q_OBJECT
public:
explicit MailNetworkUrlInterceptorManager(QObject *parent = Q_NULLPTR);
~MailNetworkUrlInterceptorManager();
explicit NetworkUrlInterceptorManager(QObject *parent = Q_NULLPTR);
~NetworkUrlInterceptorManager();
QVector<MailNetworkPluginUrlInterceptorInterface *> interfaceList() const;
QVector<NetworkPluginUrlInterceptorInterface *> interfaceList() const;
private:
MailNetworkUrlInterceptorManagerPrivate *const d;
NetworkUrlInterceptorManagerPrivate *const d;
};
}
#endif // MAILNETWORKURLINTERCEPTORMANAGER_H
......@@ -31,7 +31,7 @@ class MailNetworkUrlInterceptorPluginManagerInstancePrivate
{
public:
MailNetworkUrlInterceptorPluginManagerInstancePrivate()
: mailNetworkUrlInterceptorPluginManager(new MailNetworkUrlInterceptorPluginManager)
: mailNetworkUrlInterceptorPluginManager(new NetworkUrlInterceptorPluginManager)
{
}
......@@ -40,7 +40,7 @@ public:
delete mailNetworkUrlInterceptorPluginManager;
}
MailNetworkUrlInterceptorPluginManager *mailNetworkUrlInterceptorPluginManager;
NetworkUrlInterceptorPluginManager *mailNetworkUrlInterceptorPluginManager;
};
Q_GLOBAL_STATIC(MailNetworkUrlInterceptorPluginManagerInstancePrivate, sInstance)
......@@ -56,7 +56,7 @@ public:
QString saveName() const;
KPluginMetaData metaData;
MessageViewer::MailNetworkPluginUrlInterceptor *plugin;
MessageViewer::NetworkPluginUrlInterceptor *plugin;
};
QString MailNetworkUrlInterceptorPluginInfo::saveName() const
......@@ -72,10 +72,10 @@ QString pluginVersion()
}
}
class MessageViewer::MailNetworkUrlInterceptorPluginManagerPrivate
class MessageViewer::NetworkUrlInterceptorPluginManagerPrivate
{
public:
MailNetworkUrlInterceptorPluginManagerPrivate(MailNetworkUrlInterceptorPluginManager *qq)
NetworkUrlInterceptorPluginManagerPrivate(NetworkUrlInterceptorPluginManager *qq)
: q(qq)
{
......@@ -83,13 +83,13 @@ public:
void initializePluginList();
void loadPlugin(MailNetworkUrlInterceptorPluginInfo *item);
QVector<MessageViewer::MailNetworkPluginUrlInterceptor *> pluginsList() const;
QVector<MessageViewer::NetworkPluginUrlInterceptor *> pluginsList() const;
QVector<MailNetworkUrlInterceptorPluginInfo> mPluginList;
MailNetworkUrlInterceptorPluginManager *q;
NetworkUrlInterceptorPluginManager *q;
};
void MailNetworkUrlInterceptorPluginManagerPrivate::initializePluginList()
void NetworkUrlInterceptorPluginManagerPrivate::initializePluginList()
{
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("messageviewer"), [](const KPluginMetaData & md) {
return md.serviceTypes().contains(QStringLiteral("MessageViewer/UrlInterceptor"));
......@@ -120,9 +120,9 @@ void MailNetworkUrlInterceptorPluginManagerPrivate::initializePluginList()
}
}
QVector<MessageViewer::MailNetworkPluginUrlInterceptor *> MailNetworkUrlInterceptorPluginManagerPrivate::pluginsList() const
QVector<MessageViewer::NetworkPluginUrlInterceptor *> NetworkUrlInterceptorPluginManagerPrivate::pluginsList() const
{
QVector<MessageViewer::MailNetworkPluginUrlInterceptor *> lst;
QVector<MessageViewer::NetworkPluginUrlInterceptor *> lst;
QVector<MailNetworkUrlInterceptorPluginInfo>::ConstIterator end(mPluginList.constEnd());
for (QVector<MailNetworkUrlInterceptorPluginInfo>::ConstIterator it = mPluginList.constBegin(); it != end; ++it) {
if ((*it).plugin) {
......@@ -132,29 +132,29 @@ QVector<MessageViewer::MailNetworkPluginUrlInterceptor *> MailNetworkUrlIntercep
return lst;
}
void MailNetworkUrlInterceptorPluginManagerPrivate::loadPlugin(MailNetworkUrlInterceptorPluginInfo *item)
void NetworkUrlInterceptorPluginManagerPrivate::loadPlugin(MailNetworkUrlInterceptorPluginInfo *item)
{
item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<MessageViewer::MailNetworkPluginUrlInterceptor>(q, QVariantList() << item->saveName());
item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<MessageViewer::NetworkPluginUrlInterceptor>(q, QVariantList() << item->saveName());
}
MailNetworkUrlInterceptorPluginManager *MailNetworkUrlInterceptorPluginManager::self()
NetworkUrlInterceptorPluginManager *NetworkUrlInterceptorPluginManager::self()
{
return sInstance->mailNetworkUrlInterceptorPluginManager;
}
MailNetworkUrlInterceptorPluginManager::MailNetworkUrlInterceptorPluginManager(QObject *parent)
NetworkUrlInterceptorPluginManager::NetworkUrlInterceptorPluginManager(QObject *parent)
: QObject(parent),
d(new MailNetworkUrlInterceptorPluginManagerPrivate(this))
d(new NetworkUrlInterceptorPluginManagerPrivate(this))
{
d->initializePluginList();
}
MailNetworkUrlInterceptorPluginManager::~MailNetworkUrlInterceptorPluginManager()
NetworkUrlInterceptorPluginManager::~NetworkUrlInterceptorPluginManager()
{
delete d;
}
QVector<MessageViewer::MailNetworkPluginUrlInterceptor *> MailNetworkUrlInterceptorPluginManager::pluginsList() const
QVector<MessageViewer::NetworkPluginUrlInterceptor *> NetworkUrlInterceptorPluginManager::pluginsList() const
{
return d->pluginsList();
}
......@@ -23,19 +23,19 @@
#include "messageviewer_export.h"
namespace MessageViewer
{
class MailNetworkUrlInterceptorPluginManagerPrivate;
class MailNetworkPluginUrlInterceptor;
class MESSAGEVIEWER_EXPORT MailNetworkUrlInterceptorPluginManager : public QObject
class NetworkUrlInterceptorPluginManagerPrivate;
class NetworkPluginUrlInterceptor;
class MESSAGEVIEWER_EXPORT NetworkUrlInterceptorPluginManager : public QObject
{
Q_OBJECT
public:
static MailNetworkUrlInterceptorPluginManager *self();
explicit MailNetworkUrlInterceptorPluginManager(QObject *parent = Q_NULLPTR);
~MailNetworkUrlInterceptorPluginManager();
static NetworkUrlInterceptorPluginManager *self();
explicit NetworkUrlInterceptorPluginManager(QObject *parent = Q_NULLPTR);
~NetworkUrlInterceptorPluginManager();
QVector<MessageViewer::MailNetworkPluginUrlInterceptor *> pluginsList() const;
QVector<MessageViewer::NetworkPluginUrlInterceptor *> pluginsList() const;
private:
MailNetworkUrlInterceptorPluginManagerPrivate *const d;
NetworkUrlInterceptorPluginManagerPrivate *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