Port the KGet plugin system to the KDE standard one.
[kdenetwork.git] / kget / transfer-plugins / kio / transferKioFactory.cpp
blob37e023f57e7a40befdfc3f2f57bc633bee01a9db
1 /* This file is part of the KDE project
3 Copyright (C) 2004 Dario Massarin <nekkar@libero.it>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9 */
11 #include "transferKioFactory.h"
13 #include "core/scheduler.h"
14 #include "core/transfergroup.h"
15 #include "transferKio.h"
17 #include <kdebug.h>
19 KGET_EXPORT_PLUGIN( TransferKioFactory )
21 TransferKioFactory::TransferKioFactory(QObject *parent, const QVariantList &args)
22 : TransferFactory(parent, args)
26 TransferKioFactory::~TransferKioFactory()
30 Transfer * TransferKioFactory::createTransfer( const KUrl &srcUrl, const KUrl &destUrl,
31 TransferGroup * parent,
32 Scheduler * scheduler,
33 const QDomElement * e )
35 kDebug(5001) << "TransferKioFactory::createTransfer";
37 QString prot = srcUrl.protocol();
38 kDebug(5001) << "Protocol = " << prot;
39 if( prot == "http" || prot == "https"
40 || prot == "ftp" || prot == "sftp"
41 || prot == "file")
43 return new TransferKio(parent, this, scheduler, srcUrl, destUrl, e);
45 return 0;
48 TransferHandler * TransferKioFactory::createTransferHandler(Transfer * transfer, Scheduler * scheduler)
50 return new TransferHandler(transfer, scheduler);
53 QWidget * TransferKioFactory::createDetailsWidget( TransferHandler * transfer )
55 Q_UNUSED(transfer);
56 return 0; //Temporary!!
59 QWidget * TransferKioFactory::createSettingsWidget(KDialog * parent)
61 Q_UNUSED(parent);
62 return 0; // if there is no settings widget we must return 0
65 const QList<KAction *> TransferKioFactory::actions(TransferHandler *handler)
67 Q_UNUSED(handler);
68 return QList<KAction *>();