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

kget

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
KGet Class Reference

#include <kget.h>

Inheritance diagram for KGet:
Inheritance graph
[legend]

Public Types

enum  AfterFinishAction { Quit = 0, Shutdown = 1, Hibernate = 2, Suspend = 3 }
 
enum  DeleteMode { AutoDelete, DeleteFiles }
 

Public Member Functions

 ~KGet ()
 
 TransferData (const KUrl &src, const KUrl &dest, const QString &groupName=QString(), bool start=false, const QDomElement *e=0)
 

Static Public Member Functions

static KActionCollection * actionCollection ()
 
static bool addGroup (const QString &groupName)
 
static TransferHandler * addTransfer (KUrl srcUrl, QString destDir=QString(), QString suggestedFileName=QString(), QString groupName=QString(), bool start=false)
 
static const QList
< TransferHandler * > 
addTransfer (KUrl::List srcUrls, QString destDir=QString(), QString groupName=QString(), bool start=false)
 
static QList< TransferHandler * > addTransfers (const QList< QDomElement > &elements, const QString &groupName=QString())
 
static QList
< TransferGroupHandler * > 
allTransferGroups ()
 
static QList< TransferHandler * > allTransfers ()
 
static void calculateGlobalDownloadLimit ()
 
static void calculateGlobalSpeedLimits ()
 
static void calculateGlobalUploadLimit ()
 
static void checkSystemTray ()
 
static TransferDataSource * createTransferDataSource (const KUrl &src, const QDomElement &type=QDomElement(), QObject *parent=0)
 
static void delGroup (TransferGroupHandler *group, bool askUser=true)
 
static void delGroups (QList< TransferGroupHandler * > groups, bool askUser=true)
 
static bool delTransfer (TransferHandler *transfer, DeleteMode mode=AutoDelete)
 
static bool delTransfers (const QList< TransferHandler * > &transfers, DeleteMode mode=AutoDelete)
 
static QList< TransferFactory * > factories ()
 
static TransferFactory * factory (TransferHandler *transfer)
 
static TransferGroupHandler * findGroup (const QString &name)
 
static TransferHandler * findTransfer (const KUrl &src)
 
static QList< TransferHandler * > finishedTransfers ()
 
static QString generalDestDir (bool preferXDGDownloadDir=false)
 
static QList
< TransferGroupHandler * > 
groupsFromExceptions (const KUrl &filename)
 
static void load (QString filename=QString())
 
static void loadPlugins ()
 
static bool matchesExceptions (const KUrl &sourceUrl, const QStringList &patterns)
 
static TransferTreeModel * model ()
 
static void moveTransfer (TransferHandler *transfer, const QString &groupName)
 
static void redownloadTransfer (TransferHandler *transfer)
 
static void renameGroup (const QString &oldName, const QString &newName)
 
static void save (QString filename=QString(), bool plain=false)
 
static bool schedulerRunning ()
 
static QList
< TransferGroupHandler * > 
selectedTransferGroups ()
 
static QList< TransferHandler * > selectedTransfers ()
 
static TransferTreeSelectionModel * selectionModel ()
 
static KGet * self (MainWindow *mainWindow=0)
 
static void setGlobalDownloadLimit (int limit)
 
static void setGlobalUploadLimit (int limit)
 
static void setSchedulerRunning (bool running=true)
 
static void setSuspendScheduler (bool isSuspended)
 
static void settingsChanged ()
 
static KNotification * showNotification (QWidget *parent, const QString &eventType, const QString &text, const QString &icon=QString("dialog-error"), const QString &title=i18n("KGet"), const KNotification::NotificationFlags &flags=KNotification::CloseOnTimeout)
 
static QStringList transferGroupNames ()
 

Public Attributes

KUrl dest
 
const QDomElement * e
 
QString groupName
 
KUrl src
 
bool start
 

Detailed Description

This is our KGet class.

This is where the user's transfers and searches are stored and organized. Use this class from the views to add or remove transfers or searches In order to organize the transfers inside categories we have a TransferGroup class. By definition, a transfer must always belong to a TransferGroup. If we don't want it to be displayed by the gui inside a specific group, we will put it in the group named "Not grouped" (better name?).

Definition at line 67 of file kget.h.

Member Enumeration Documentation

enum KGet::AfterFinishAction
Enumerator
Quit 
Shutdown 
Hibernate 
Suspend 

Definition at line 75 of file kget.h.

enum KGet::DeleteMode
Enumerator
AutoDelete 
DeleteFiles 

Definition at line 81 of file kget.h.

Constructor & Destructor Documentation

KGet::~KGet ( )

Definition at line 842 of file kget.cpp.

Member Function Documentation

KActionCollection * KGet::actionCollection ( )
static
Returns
a pointer to the KActionCollection objects

Definition at line 631 of file kget.cpp.

bool KGet::addGroup ( const QString &  groupName)
static

Adds a new group to the KGet.

Parameters
groupNameThe name of the new group
Returns
true if the group has been successully added, otherwise it returns false, probably because a group with that named already exists

Definition at line 101 of file kget.cpp.

TransferHandler * KGet::addTransfer ( KUrl  srcUrl,
QString  destDir = QString(),
QString  suggestedFileName = QString(),
QString  groupName = QString(),
bool  start = false 
)
static

Adds a new transfer to the KGet.

Parameters
srcUrlThe url to be downloaded
destDirThe destination directory. If empty we show a dialog where the user can choose it.
suggestedFileNamea suggestion of a simple filename to be saved in destDir
groupNameThe name of the group the new transfer will belong to
startSpecifies if the newly added transfers should be started. If the group queue is already in a running state, this flag does nothing

Definition at line 179 of file kget.cpp.

const QList< TransferHandler * > KGet::addTransfer ( KUrl::List  srcUrls,
QString  destDir = QString(),
QString  groupName = QString(),
bool  start = false 
)
static

Adds new transfers to the KGet.

Parameters
srcUrlsThe urls to be downloaded
destDirThe destination directory. If empty we show a dialog where the user can choose it.
groupNameThe name of the group the new transfer will belong to
startSpecifies if the newly added transfers should be started. If the group queue is already in a running state, this flag does nothing

Definition at line 281 of file kget.cpp.

QList< TransferHandler * > KGet::addTransfers ( const QList< QDomElement > &  elements,
const QString &  groupName = QString() 
)
static

Adds new transfers to the KGet, it is assumed that this takes place because of loading that results in less checks for loaction etc.

Parameters
elementsThe dom elements of the transfers to add
groupNameThe name of the group the new transfer will belong to

Definition at line 264 of file kget.cpp.

QList< TransferGroupHandler * > KGet::allTransferGroups ( )
static

Gets all transfer-groups.

Definition at line 668 of file kget.cpp.

QList< TransferHandler * > KGet::allTransfers ( )
static

Gets all transfers.

Definition at line 657 of file kget.cpp.

void KGet::calculateGlobalDownloadLimit ( )
static

Recalculates the global download-limit.

Definition at line 793 of file kget.cpp.

void KGet::calculateGlobalSpeedLimits ( )
static

Recalculates the global speedlimits.

Definition at line 785 of file kget.cpp.

void KGet::calculateGlobalUploadLimit ( )
static

Recalculates the global upload-limit.

Definition at line 798 of file kget.cpp.

void KGet::checkSystemTray ( )
static

Run this function for enabling the systemTray (will be automatically done, if there is download running)

Definition at line 700 of file kget.cpp.

TransferDataSource * KGet::createTransferDataSource ( const KUrl &  src,
const QDomElement &  type = QDomElement(),
QObject *  parent = 0 
)
static

Scans for all the available plugins and creates the proper transfer DataSource object for transfers Containers.

Parameters
srcSource Url
typethe type of the DataSource that should be created e.g. <TransferDataSource type="search"> this is only needed when creating a "special" TransferDataSource like the search for Urls you can set additional information and the TransferDataSource will use it if it can

Definition at line 931 of file kget.cpp.

void KGet::delGroup ( TransferGroupHandler *  group,
bool  askUser = true 
)
static

Removes a group from the KGet.

Parameters
groupNameThe name of the group to be deleted

Definition at line 115 of file kget.cpp.

void KGet::delGroups ( QList< TransferGroupHandler * >  groups,
bool  askUser = true 
)
static

Removes specific groups from the KGet.

Parameters
groupsThe names of the groups to be deleted.

Definition at line 132 of file kget.cpp.

bool KGet::delTransfer ( TransferHandler *  transfer,
DeleteMode  mode = AutoDelete 
)
static

Removes a transfer from the KGet.

Parameters
transferThe transfer to be removed

Definition at line 362 of file kget.cpp.

bool KGet::delTransfers ( const QList< TransferHandler * > &  transfers,
DeleteMode  mode = AutoDelete 
)
static

Removes multiple transfers from the KGet.

Parameters
transfersThe transfers to be removed

Definition at line 367 of file kget.cpp.

QList< TransferFactory * > KGet::factories ( )
static
Returns
a list of all transferfactories

Definition at line 621 of file kget.cpp.

TransferFactory * KGet::factory ( TransferHandler *  transfer)
static
Returns
The factory of a given transfer
Parameters
transferthe transfer about which we want to have the factory

Definition at line 626 of file kget.cpp.

TransferGroupHandler * KGet::findGroup ( const QString &  name)
static

Get the group with the given name.

Parameters
namethe name

Definition at line 690 of file kget.cpp.

TransferHandler * KGet::findTransfer ( const KUrl &  src)
static

Get the transfer with the given url.

Parameters
srcthe url

Definition at line 680 of file kget.cpp.

QList< TransferHandler * > KGet::finishedTransfers ( )
static
Returns
the list of the finished transfers

Definition at line 456 of file kget.cpp.

QString KGet::generalDestDir ( bool  preferXDGDownloadDir = false)
static

Returns a download directory.

Parameters
preferXDGDownloadDirif true the XDG_DOWNLOAD_DIR will be taken if it is not empty
Note
depending if the directories exist it will return them in the following order: (preferXDGDownloadDirectory >) lastDirectory > XDG_DOWNLOAD_DIR

Definition at line 945 of file kget.cpp.

QList< TransferGroupHandler * > KGet::groupsFromExceptions ( const KUrl &  filename)
static
Returns
a list of the groups assigned to the filename of a transfer

Definition at line 730 of file kget.cpp.

void KGet::load ( QString  filename = QString())
static

Imports the transfers and groups included in the provided xml file.

Parameters
filenamethe file name to

Definition at line 508 of file kget.cpp.

void KGet::loadPlugins ( )
static

Definition at line 1144 of file kget.cpp.

bool KGet::matchesExceptions ( const KUrl &  sourceUrl,
const QStringList &  patterns 
)
static

Returns true if sourceUrl matches any of the patterns.

Definition at line 743 of file kget.cpp.

TransferTreeModel * KGet::model ( )
static
Returns
a pointer to the TransferTreeModel object

Definition at line 487 of file kget.cpp.

void KGet::moveTransfer ( TransferHandler *  transfer,
const QString &  groupName 
)
static

Moves a transfer to a new group.

Parameters
transferThe transfer to be moved
groupNameThe name of the new transfer's group

Definition at line 399 of file kget.cpp.

void KGet::redownloadTransfer ( TransferHandler *  transfer)
static

Redownload a transfer.

Parameters
transferthe transfer to redownload

Definition at line 405 of file kget.cpp.

void KGet::renameGroup ( const QString &  oldName,
const QString &  newName 
)
static

Changes the name of the group.

Parameters
oldNamethe name of the group to be changed
newNamethe new name of the group

Definition at line 158 of file kget.cpp.

void KGet::save ( QString  filename = QString(),
bool  plain = false 
)
static

Exports all the transfers and groups to the given file.

Parameters
filenamethe file name
plainshould list be in plain mode or kget mode

Definition at line 573 of file kget.cpp.

bool KGet::schedulerRunning ( )
static

Returns true if the scheduler has running jobs.

Definition at line 647 of file kget.cpp.

QList< TransferGroupHandler * > KGet::selectedTransferGroups ( )
static
Returns
the list of selected groups

Definition at line 469 of file kget.cpp.

QList< TransferHandler * > KGet::selectedTransfers ( )
static
Returns
the list of selected transfers

Definition at line 416 of file kget.cpp.

TransferTreeSelectionModel * KGet::selectionModel ( )
static
Returns
a pointer to the QItemSelectionModel object

Definition at line 492 of file kget.cpp.

KGet * KGet::self ( MainWindow *  mainWindow = 0)
static

This is our KGet class.

This is where the user's transfers and searches are stored and organized. Use this class from the views to add or remove transfers or searches In order to organize the transfers inside categories we have a TransferGroup class. By definition, a transfer must always belong to a TransferGroup. If we don't want it to be displayed by the gui inside a specific group, we will put it in the group named "Not grouped" (better name?).

Definition at line 88 of file kget.cpp.

void KGet::setGlobalDownloadLimit ( int  limit)
static

Sets the global download limit.

Parameters
limitthe new global download limit

Definition at line 775 of file kget.cpp.

void KGet::setGlobalUploadLimit ( int  limit)
static

Sets the global upload limit.

Parameters
limitthe new global upload limit

Definition at line 780 of file kget.cpp.

void KGet::setSchedulerRunning ( bool  running = true)
static

if running == true starts the scheduler if running == false stops the scheduler

Definition at line 636 of file kget.cpp.

void KGet::setSuspendScheduler ( bool  isSuspended)
static

true suspends the scheduler, any events that would result in a reschedule are ignored false wakes up the scheduler, events result in reschedule again NOTE this is a HACK for cases where the scheduler is the bottleneck, e.g.

when stopping a lot of running transfers, or starting a lot transfers

Definition at line 652 of file kget.cpp.

void KGet::settingsChanged ( )
static

This will be called when the settings have been changed.

Definition at line 717 of file kget.cpp.

KNotification * KGet::showNotification ( QWidget *  parent,
const QString &  eventType,
const QString &  text,
const QString &  icon = QString("dialog-error"),
const QString &  title = i18n("KGet"),
const KNotification::NotificationFlags &  flags = KNotification::CloseOnTimeout 
)
static

Shows a knotification.

Parameters
parentQWidget parent of the notification
eventIdNotification type
textDescription of the information showed by the notification
iconPixmap showed in the notification, by default 'dialog-error'

Definition at line 1281 of file kget.cpp.

KGet::TransferData ( const KUrl &  src,
const KUrl &  dest,
const QString &  groupName = QString(),
bool  start = false,
const QDomElement *  e = 0 
)
QStringList KGet::transferGroupNames ( )
static
Returns
the name of the available transfers groups

Definition at line 168 of file kget.cpp.

Member Data Documentation

KUrl KGet::dest

Definition at line 460 of file kget.h.

const QDomElement* KGet::e

Definition at line 463 of file kget.h.

QString KGet::groupName

Definition at line 461 of file kget.h.

KUrl KGet::src

Definition at line 459 of file kget.h.

bool KGet::start

Definition at line 462 of file kget.h.


The documentation for this class was generated from the following files:
  • kget.h
  • kget.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:44 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