File indexing completed on 2024-05-05 04:59:19

0001 /*
0002     This file is part of the KDE project
0003     Copyright (C) 2011 Ernesto Rodriguez Ortiz <eortiz@uci.cu>
0004 
0005     This program is free software: you can redistribute it and/or modify
0006     it under the terms of the GNU General Public License as published by
0007     the Free Software Foundation, either version 3 of the License, or
0008     (at your option) any later version.
0009 
0010     This program is distributed in the hope that it will be useful,
0011     but WITHOUT ANY WARRANTY; without even the implied warranty of
0012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013     GNU General Public License for more details.
0014 
0015     You should have received a copy of the GNU General Public License
0016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017 
0018 */
0019 
0020 #include "mmstransferfactory.h"
0021 #include "mmssettings.h"
0022 #include "mmstransfer.h"
0023 
0024 #include <KPluginFactory>
0025 
0026 #include "kget_debug.h"
0027 #include <QDebug>
0028 
0029 K_PLUGIN_CLASS_WITH_JSON(MmsTransferFactory, "kget_mmsfactory.json")
0030 
0031 MmsTransferFactory::MmsTransferFactory(QObject *parent, const QVariantList &args)
0032     : TransferFactory(parent, args)
0033 {
0034 }
0035 
0036 MmsTransferFactory::~MmsTransferFactory()
0037 {
0038 }
0039 
0040 Transfer *MmsTransferFactory::createTransfer(const QUrl &srcUrl, const QUrl &destUrl, TransferGroup *parent, Scheduler *scheduler, const QDomElement *e)
0041 {
0042     qCDebug(KGET_DEBUG) << "MmsTransferFactory::createTransfer";
0043 
0044     QString prot = srcUrl.scheme();
0045     qCDebug(KGET_DEBUG) << "Protocol = " << prot;
0046     if (prot == "mms" || prot == "mmsh") {
0047         return new MmsTransfer(parent, this, scheduler, srcUrl, destUrl, e);
0048     }
0049     return nullptr;
0050 }
0051 
0052 QWidget *MmsTransferFactory::createDetailsWidget(TransferHandler *transfer)
0053 {
0054     Q_UNUSED(transfer)
0055     return nullptr; // Temporary!!
0056 }
0057 
0058 const QList<QAction *> MmsTransferFactory::actions(TransferHandler *handler)
0059 {
0060     Q_UNUSED(handler)
0061     return QList<QAction *>();
0062 }
0063 
0064 bool MmsTransferFactory::isSupported(const QUrl &url) const
0065 {
0066     QString prot = url.scheme();
0067     qCDebug(KGET_DEBUG) << "Protocol = " << prot;
0068     return (prot == "mms" || prot == "mmsh");
0069 }
0070 
0071 #include "mmstransferfactory.moc"
0072 #include "moc_mmstransferfactory.cpp"