Commit 9c080879 authored by Lukas Appelhans's avatar Lukas Appelhans

Port more plugins from KUrl to QUrl and make them work again

parent 7ff765cd
......@@ -20,8 +20,9 @@
#include "kget_debug.h"
#include <qdebug.h>
//PORT QT5 KGET_EXPORT_PLUGIN( MetalinkFactory )
K_PLUGIN_FACTORY(KGetFactory,
registerPlugin<MetalinkFactory>();
)
MetalinkFactory::MetalinkFactory(QObject *parent, const QVariantList &args)
: TransferFactory(parent, args)
{
......@@ -31,7 +32,7 @@ MetalinkFactory::~MetalinkFactory()
{
}
Transfer * MetalinkFactory::createTransfer( const KUrl &srcUrl, const KUrl &destUrl,
Transfer * MetalinkFactory::createTransfer( const QUrl &srcUrl, const QUrl &destUrl,
TransferGroup * parent,
Scheduler * scheduler,
const QDomElement * e )
......@@ -55,7 +56,7 @@ Transfer * MetalinkFactory::createTransfer( const KUrl &srcUrl, const KUrl &dest
}
}
bool MetalinkFactory::isSupported(const KUrl &url) const
bool MetalinkFactory::isSupported(const QUrl &url) const
{
return (url.fileName().endsWith(QLatin1String(".metalink")) || url.fileName().endsWith(QLatin1String(".meta4")));
}
......
......@@ -27,7 +27,7 @@ class MetalinkFactory : public TransferFactory
MetalinkFactory(QObject *parent, const QVariantList &args);
~MetalinkFactory();
Transfer * createTransfer( const KUrl &srcUrl, const KUrl &destUrl,
Transfer * createTransfer( const QUrl &srcUrl, const QUrl &destUrl,
TransferGroup * parent, Scheduler * scheduler,
const QDomElement * e = 0 );
......@@ -38,7 +38,7 @@ class MetalinkFactory : public TransferFactory
* @param The Url to be tested
* @return True if the URL is a metalink (xml or http).
*/
bool isSupported(const KUrl &url) const;
bool isSupported(const QUrl &url) const;
};
#endif
......@@ -19,8 +19,9 @@
#include <QDomElement>
//PORT QT5 KGET_EXPORT_PLUGIN( MirrorSearchFactory )
K_PLUGIN_FACTORY(KGetFactory,
registerPlugin<MirrorSearchFactory>();
)
MirrorSearchFactory::MirrorSearchFactory(QObject *parent, const QVariantList &args)
: TransferFactory(parent, args)
{
......@@ -30,7 +31,7 @@ MirrorSearchFactory::~MirrorSearchFactory()
{
}
TransferDataSource *MirrorSearchFactory::createTransferDataSource(const KUrl &srcUrl, const QDomElement &type, QObject *parent)
TransferDataSource *MirrorSearchFactory::createTransferDataSource(const QUrl &srcUrl, const QDomElement &type, QObject *parent)
{
qCDebug(KGET_DEBUG);
......
......@@ -23,7 +23,7 @@ class MirrorSearchFactory : public TransferFactory
MirrorSearchFactory(QObject *parent, const QVariantList &args);
~MirrorSearchFactory();
TransferDataSource * createTransferDataSource(const KUrl &srcUrl, const QDomElement &type, QObject *parent);
TransferDataSource * createTransferDataSource(const QUrl &srcUrl, const QDomElement &type, QObject *parent);
};
#endif
......@@ -21,10 +21,14 @@
#include "mmssettings.h"
#include "mmstransfer.h"
#include <kpluginfactory.h>
#include "kget_debug.h"
#include <qdebug.h>
//KGET_EXPORT_PLUGIN( MmsTransferFactory )
K_PLUGIN_FACTORY(KGetFactory,
registerPlugin<MmsTransferFactory>();
)
MmsTransferFactory::MmsTransferFactory(QObject *parent, const QVariantList &args)
: TransferFactory(parent, args)
......@@ -33,14 +37,14 @@ MmsTransferFactory::MmsTransferFactory(QObject *parent, const QVariantList &args
MmsTransferFactory::~MmsTransferFactory()
{}
Transfer * MmsTransferFactory::createTransfer( const KUrl &srcUrl, const KUrl &destUrl,
Transfer * MmsTransferFactory::createTransfer( const QUrl &srcUrl, const QUrl &destUrl,
TransferGroup * parent,
Scheduler * scheduler,
const QDomElement * e )
{
qCDebug(KGET_DEBUG) << "MmsTransferFactory::createTransfer";
QString prot = srcUrl.protocol();
QString prot = srcUrl.scheme();
qCDebug(KGET_DEBUG) << "Protocol = " << prot;
if (prot == "mms" || prot == "mmsh") {
return new MmsTransfer(parent, this, scheduler, srcUrl, destUrl, e);
......@@ -60,11 +64,11 @@ const QList<QAction *> MmsTransferFactory::actions(TransferHandler *handler)
return QList<QAction *>();
}
bool MmsTransferFactory::isSupported(const KUrl &url) const
bool MmsTransferFactory::isSupported(const QUrl &url) const
{
QString prot = url.protocol();
QString prot = url.scheme();
qCDebug(KGET_DEBUG) << "Protocol = " << prot;
return (prot == "mms" || prot == "mmsh");
}
#include "mmstransferfactory.moc"
......@@ -34,7 +34,7 @@ class MmsTransferFactory : public TransferFactory
MmsTransferFactory(QObject *parent, const QVariantList &args);
~MmsTransferFactory();
Transfer * createTransfer( const KUrl &srcUrl, const KUrl &destUrl,
Transfer * createTransfer( const QUrl &srcUrl, const QUrl &destUrl,
TransferGroup * parent, Scheduler * scheduler,
const QDomElement * e = 0 );
......@@ -44,7 +44,7 @@ class MmsTransferFactory : public TransferFactory
const QList<QAction *> actions(TransferHandler *handler = 0);
bool isSupported(const KUrl &url) const;
bool isSupported(const QUrl &url) const;
QString displayName(){return "mms";}
......
......@@ -23,8 +23,9 @@
#include <qdebug.h>
#include "kget_macro.h"
//PORT QT5 KGET_EXPORT_PLUGIN( TransferMultiSegKioFactory )
K_PLUGIN_FACTORY(KGetFactory,
registerPlugin<TransferMultiSegKioFactory>();
)
TransferMultiSegKioFactory::TransferMultiSegKioFactory(QObject *parent, const QVariantList &args)
: TransferFactory(parent, args)
{
......@@ -34,7 +35,7 @@ TransferMultiSegKioFactory::~TransferMultiSegKioFactory()
{
}
Transfer * TransferMultiSegKioFactory::createTransfer( const KUrl &srcUrl, const KUrl &destUrl,
Transfer * TransferMultiSegKioFactory::createTransfer( const QUrl &srcUrl, const QUrl &destUrl,
TransferGroup * parent,
Scheduler * scheduler,
const QDomElement * e )
......@@ -65,7 +66,7 @@ const QList<QAction *> TransferMultiSegKioFactory::actions(TransferHandler *hand
return QList<QAction *>();
}
TransferDataSource * TransferMultiSegKioFactory::createTransferDataSource(const KUrl &srcUrl, const QDomElement &type, QObject *parent)
TransferDataSource * TransferMultiSegKioFactory::createTransferDataSource(const QUrl &srcUrl, const QDomElement &type, QObject *parent)
{
qCDebug(KGET_DEBUG);
......@@ -82,9 +83,9 @@ const QList<QAction *> TransferMultiSegKioFactory::actions(TransferHandler *hand
return 0;
}
bool TransferMultiSegKioFactory::isSupported(const KUrl &url) const
bool TransferMultiSegKioFactory::isSupported(const QUrl &url) const
{
QString prot = url.protocol();
QString prot = url.scheme();
qCDebug(KGET_DEBUG) << "Protocol = " << prot;
return addsProtocols().contains(prot);
}
......
......@@ -24,7 +24,7 @@ class TransferMultiSegKioFactory : public TransferFactory
TransferMultiSegKioFactory(QObject *parent, const QVariantList &args);
~TransferMultiSegKioFactory();
Transfer * createTransfer( const KUrl &srcUrl, const KUrl &destUrl,
Transfer * createTransfer( const QUrl &srcUrl, const QUrl &destUrl,
TransferGroup * parent, Scheduler * scheduler,
const QDomElement * e = 0 );
......@@ -34,8 +34,8 @@ class TransferMultiSegKioFactory : public TransferFactory
QWidget * createDetailsWidget( TransferHandler * transfer );
const QList<QAction *> actions(TransferHandler *handler = 0);
TransferDataSource * createTransferDataSource(const KUrl &srcUrl, const QDomElement &type, QObject *parent);
bool isSupported(const KUrl &url) const;
TransferDataSource * createTransferDataSource(const QUrl &srcUrl, const QDomElement &type, QObject *parent);
bool isSupported(const QUrl &url) const;
QStringList addsProtocols() const;
};
......
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