• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • transfer-plugins
  • kio
transferKioFactory.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2004 Dario Massarin <nekkar@libero.it>
4 
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 */
10 
11 #include "transferKioFactory.h"
12 
13 #include "core/scheduler.h"
14 #include "core/transfergroup.h"
15 #include "transferKio.h"
16 
17 #include <kdebug.h>
18 
19 KGET_EXPORT_PLUGIN( TransferKioFactory )
20 
21 TransferKioFactory::TransferKioFactory(QObject *parent, const QVariantList &args)
22  : TransferFactory(parent, args)
23 {
24 }
25 
26 TransferKioFactory::~TransferKioFactory()
27 {
28 }
29 
30 Transfer * TransferKioFactory::createTransfer( const KUrl &srcUrl, const KUrl &destUrl,
31  TransferGroup * parent,
32  Scheduler * scheduler,
33  const QDomElement * e )
34 {
35  kDebug(5001) << "TransferKioFactory::createTransfer";
36 
37  if (isSupported(srcUrl))
38  {
39  return new TransferKio(parent, this, scheduler, srcUrl, destUrl, e);
40  }
41  return 0;
42 }
43 
44 bool TransferKioFactory::isSupported(const KUrl &url) const
45 {
46  QString prot = url.protocol();
47  kDebug(5001) << "Protocol = " << prot;
48  return addsProtocols().contains(prot);
49 }
50 
51 QStringList TransferKioFactory::addsProtocols() const
52 {
53  static const QStringList protocols = QStringList() << "http" << "https" << "ftp" << "sftp";
54  return protocols;
55 }
TransferGroup
class TransferGroup:
Definition: transfergroup.h:46
Scheduler
Scheduler class: what handle all the jobs in kget.
Definition: scheduler.h:32
TransferKioFactory::isSupported
bool isSupported(const KUrl &url) const
Definition: transferKioFactory.cpp:44
transferKioFactory.h
TransferKioFactory
Definition: transferKioFactory.h:20
TransferKioFactory::addsProtocols
QStringList addsProtocols() const
Returns a list of protocols for which the TransferFactory adds support.
Definition: transferKioFactory.cpp:51
QObject
scheduler.h
TransferKioFactory::createTransfer
Transfer * createTransfer(const KUrl &srcUrl, const KUrl &destUrl, TransferGroup *parent, Scheduler *scheduler, const QDomElement *e=0)
Definition: transferKioFactory.cpp:30
transfergroup.h
TransferKio
Definition: transferKio.h:27
transferKio.h
TransferKioFactory::~TransferKioFactory
~TransferKioFactory()
Definition: transferKioFactory.cpp:26
KGET_EXPORT_PLUGIN
#define KGET_EXPORT_PLUGIN(classname)
Declares a class as plugin.
Definition: kget_export.h:40
TransferFactory
TransferFactory.
Definition: transferfactory.h:52
Transfer
Definition: transfer.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal