• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • jobs
kjobtrackerinterface.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17
18*/
19
20#include "kjobtrackerinterface.h"
21
22#include "kjob.h"
23
24class KJobTrackerInterface::Private
25{
26public:
27 Private(KJobTrackerInterface *interface) : q(interface)
28 {
29
30 }
31
32 KJobTrackerInterface *const q;
33};
34
35KJobTrackerInterface::KJobTrackerInterface(QObject *parent)
36 : QObject(parent), d(new Private(this))
37{
38
39}
40
41KJobTrackerInterface::~KJobTrackerInterface()
42{
43 delete d;
44}
45
46void KJobTrackerInterface::registerJob(KJob *job)
47{
48 QObject::connect(job, SIGNAL(finished(KJob*)),
49 this, SLOT(unregisterJob(KJob*)));
50 QObject::connect(job, SIGNAL(finished(KJob*)),
51 this, SLOT(finished(KJob*)));
52
53 QObject::connect(job, SIGNAL(suspended(KJob*)),
54 this, SLOT(suspended(KJob*)));
55 QObject::connect(job, SIGNAL(resumed(KJob*)),
56 this, SLOT(resumed(KJob*)));
57
58 QObject::connect(job, SIGNAL(description(KJob*, const QString&,
59 const QPair<QString, QString>&,
60 const QPair<QString, QString>&)),
61 this, SLOT(description(KJob*, const QString&,
62 const QPair<QString, QString>&,
63 const QPair<QString, QString>&)));
64 QObject::connect(job, SIGNAL(infoMessage(KJob*,QString,QString)),
65 this, SLOT(infoMessage(KJob*,QString,QString)));
66 QObject::connect(job, SIGNAL(warning(KJob*,QString,QString)),
67 this, SLOT(warning(KJob*,QString,QString)));
68
69 QObject::connect(job, SIGNAL(totalAmount(KJob*,KJob::Unit,qulonglong)),
70 this, SLOT(totalAmount(KJob*,KJob::Unit,qulonglong)));
71 QObject::connect(job, SIGNAL(processedAmount(KJob*,KJob::Unit,qulonglong)),
72 this, SLOT(processedAmount(KJob*,KJob::Unit,qulonglong)));
73 QObject::connect(job, SIGNAL(percent(KJob*,ulong)),
74 this, SLOT(percent(KJob*,ulong)));
75 QObject::connect(job, SIGNAL(speed(KJob*,ulong)),
76 this, SLOT(speed(KJob*,ulong)));
77}
78
79void KJobTrackerInterface::unregisterJob(KJob *job)
80{
81 job->disconnect(this);
82}
83
84void KJobTrackerInterface::finished(KJob *job)
85{
86 Q_UNUSED(job)
87}
88
89void KJobTrackerInterface::suspended(KJob *job)
90{
91 Q_UNUSED(job)
92}
93
94void KJobTrackerInterface::resumed(KJob *job)
95{
96 Q_UNUSED(job)
97}
98
99void KJobTrackerInterface::description(KJob *job, const QString &title,
100 const QPair<QString, QString> &field1,
101 const QPair<QString, QString> &field2)
102{
103 Q_UNUSED(job)
104 Q_UNUSED(title)
105 Q_UNUSED(field1)
106 Q_UNUSED(field2)
107
108}
109
110void KJobTrackerInterface::infoMessage(KJob *job, const QString &plain, const QString &rich)
111{
112 Q_UNUSED(job)
113 Q_UNUSED(plain)
114 Q_UNUSED(rich)
115}
116
117void KJobTrackerInterface::warning(KJob *job, const QString &plain, const QString &rich)
118{
119 Q_UNUSED(job)
120 Q_UNUSED(plain)
121 Q_UNUSED(rich)
122}
123
124void KJobTrackerInterface::totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
125{
126 Q_UNUSED(job)
127 Q_UNUSED(unit)
128 Q_UNUSED(amount)
129}
130
131void KJobTrackerInterface::processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
132{
133 Q_UNUSED(job)
134 Q_UNUSED(unit)
135 Q_UNUSED(amount)
136}
137
138void KJobTrackerInterface::percent(KJob *job, unsigned long percent)
139{
140 Q_UNUSED(job)
141 Q_UNUSED(percent)
142}
143
144void KJobTrackerInterface::speed(KJob *job, unsigned long value)
145{
146 Q_UNUSED(job)
147 Q_UNUSED(value)
148}
149
150#include "kjobtrackerinterface.moc"
KJobTrackerInterface
The interface to implement to track the progresses of a job.
Definition: kjobtrackerinterface.h:33
KJobTrackerInterface::registerJob
virtual void registerJob(KJob *job)
Register a new job in this tracker.
Definition: kjobtrackerinterface.cpp:46
KJobTrackerInterface::speed
virtual void speed(KJob *job, unsigned long value)
Called to show the speed of the job.
Definition: kjobtrackerinterface.cpp:144
KJobTrackerInterface::finished
virtual void finished(KJob *job)
Called when a job is finished, in any case.
Definition: kjobtrackerinterface.cpp:84
KJobTrackerInterface::KJobTrackerInterface
KJobTrackerInterface(QObject *parent=0)
Creates a new KJobTrackerInterface.
Definition: kjobtrackerinterface.cpp:35
KJobTrackerInterface::totalAmount
virtual void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
Called when we know the amount a job will have to process.
Definition: kjobtrackerinterface.cpp:124
KJobTrackerInterface::resumed
virtual void resumed(KJob *job)
Called when a job is resumed.
Definition: kjobtrackerinterface.cpp:94
KJobTrackerInterface::percent
virtual void percent(KJob *job, unsigned long percent)
Called to show the overall progress of the job.
Definition: kjobtrackerinterface.cpp:138
KJobTrackerInterface::suspended
virtual void suspended(KJob *job)
Called when a job is suspended.
Definition: kjobtrackerinterface.cpp:89
KJobTrackerInterface::infoMessage
virtual void infoMessage(KJob *job, const QString &plain, const QString &rich)
Called to display state information about a job.
Definition: kjobtrackerinterface.cpp:110
KJobTrackerInterface::~KJobTrackerInterface
virtual ~KJobTrackerInterface()
Destroys a KJobTrackerInterface.
Definition: kjobtrackerinterface.cpp:41
KJobTrackerInterface::unregisterJob
virtual void unregisterJob(KJob *job)
Unregister a job from this tracker.
Definition: kjobtrackerinterface.cpp:79
KJobTrackerInterface::warning
virtual void warning(KJob *job, const QString &plain, const QString &rich)
Emitted to display a warning about a job.
Definition: kjobtrackerinterface.cpp:117
KJobTrackerInterface::processedAmount
virtual void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
Regularly called to show the progress of a job by giving the current amount.
Definition: kjobtrackerinterface.cpp:131
KJobTrackerInterface::description
virtual void description(KJob *job, const QString &title, const QPair< QString, QString > &field1, const QPair< QString, QString > &field2)
Called to display general description of a job.
Definition: kjobtrackerinterface.cpp:99
KJob
The base class for all jobs.
Definition: kjob.h:85
KJob::Unit
Unit
Definition: kjob.h:91
QObject
QPair
QString
kjob.h
kjobtrackerinterface.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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