• 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
  • contentfetch
scriptdownloadengine.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2008 Ningyu Shi <shiningyu@gmail.com>
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 "scriptdownloadengine.h"
12 #include "core/transfergroup.h"
13 #include <kdebug.h>
14 
15 ScriptDownloadEngine::ScriptDownloadEngine(QObject *parent,
16  const KUrl &source)
17  : QObject(parent),
18  m_source_url(source.url())
19 {
20 }
21 
22 void ScriptDownloadEngine::setSourceUrl(const QString &url)
23 {
24  m_source_url = url;
25 }
26 
27 QString ScriptDownloadEngine::getSourceUrl() const
28 {
29  return m_source_url;
30 }
31 
32 bool ScriptDownloadEngine::addTransfer(const QString &url,
33  const QString &filename)
34 {
35  kDebug(5002) << "Url" << url << " file " << filename << " from Script.";
36  // TODO: check url here?
37  emit newTransfer(url, filename);
38  kDebug(5002) << "Transfer" << url << " Added to KGet.";
39  return true;
40 }
41 
42 void ScriptDownloadEngine::setPercent(int percent)
43 {
44  emit percentUpdated(percent);
45 }
46 
47 void ScriptDownloadEngine::setTextStatus(const QString &text)
48 {
49  emit textStatusUpdated(text);
50 }
51 
52 void ScriptDownloadEngine::finish()
53 {
54  emit finished();
55 }
56 
57 void ScriptDownloadEngine::abort(const QString &error)
58 {
59  emit aborted(error);
60 }
61 
ScriptDownloadEngine::textStatusUpdated
void textStatusUpdated(const QString &text)
ScriptDownloadEngine::finish
void finish()
Definition: scriptdownloadengine.cpp:52
ScriptDownloadEngine::addTransfer
bool addTransfer(const QString &url, const QString &filename=QString())
Definition: scriptdownloadengine.cpp:32
ScriptDownloadEngine::percentUpdated
void percentUpdated(int percent)
ScriptDownloadEngine::aborted
void aborted(const QString &error)
ScriptDownloadEngine::getSourceUrl
QString getSourceUrl() const
Definition: scriptdownloadengine.cpp:27
ScriptDownloadEngine::newTransfer
void newTransfer(const QString &url, const QString &filename)
QObject
scriptdownloadengine.h
transfergroup.h
ScriptDownloadEngine::setPercent
void setPercent(int percent)
Definition: scriptdownloadengine.cpp:42
ScriptDownloadEngine::finished
void finished()
ScriptDownloadEngine::setSourceUrl
void setSourceUrl(const QString &url)
Definition: scriptdownloadengine.cpp:22
ScriptDownloadEngine::ScriptDownloadEngine
ScriptDownloadEngine(QObject *parent, const KUrl &source)
Definition: scriptdownloadengine.cpp:15
ScriptDownloadEngine::abort
void abort(const QString &error=QString())
Definition: scriptdownloadengine.cpp:57
ScriptDownloadEngine::setTextStatus
void setTextStatus(const QString &text)
Definition: scriptdownloadengine.cpp:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 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