1/*
2 This file is part of the KDE project
3
4 SPDX-FileCopyrightText: 2007 Kevin Ottens <ervin@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#include "kjobtrackerinterface.h"
10
11#include "kjob.h"
12
13class KJobTrackerInterfacePrivate
14{
15public:
16 KJobTrackerInterfacePrivate(KJobTrackerInterface *interface)
17 : q(interface)
18 {
19 }
20
21 KJobTrackerInterface *const q;
22};
23
24KJobTrackerInterface::KJobTrackerInterface(QObject *parent)
25 : QObject(parent)
26 , d(new KJobTrackerInterfacePrivate(this))
27{
28 qRegisterMetaType<KJob::Unit>();
29 qRegisterMetaType<QPair<QString, QString>>();
30}
31
32KJobTrackerInterface::~KJobTrackerInterface() = default;
33
34void KJobTrackerInterface::registerJob(KJob *job)
35{
36 connect(job, &KJob::finished, this, &KJobTrackerInterface::unregisterJob);
37 connect(job, &KJob::finished, this, &KJobTrackerInterface::finished);
38 connect(job, &KJob::suspended, this, &KJobTrackerInterface::suspended);
39 connect(job, &KJob::resumed, this, &KJobTrackerInterface::resumed);
40
41 connect(job, &KJob::description, this, &KJobTrackerInterface::description);
42 connect(job, &KJob::infoMessage, this, &KJobTrackerInterface::infoMessage);
43 connect(job, &KJob::warning, this, &KJobTrackerInterface::warning);
44 connect(job, &KJob::totalAmountChanged, this, &KJobTrackerInterface::totalAmount);
45 connect(job, &KJob::processedAmountChanged, this, &KJobTrackerInterface::processedAmount);
46 connect(job, &KJob::percentChanged, this, &KJobTrackerInterface::percent);
47 connect(job, &KJob::speed, this, &KJobTrackerInterface::speed);
48}
49
50void KJobTrackerInterface::unregisterJob(KJob *job)
51{
52 job->disconnect(this);
53}
54
55void KJobTrackerInterface::finished(KJob *job)
56{
57 Q_UNUSED(job)
58}
59
60void KJobTrackerInterface::suspended(KJob *job)
61{
62 Q_UNUSED(job)
63}
64
65void KJobTrackerInterface::resumed(KJob *job)
66{
67 Q_UNUSED(job)
68}
69
70void KJobTrackerInterface::description(KJob *job, const QString &title, const QPair<QString, QString> &field1, const QPair<QString, QString> &field2)
71{
72 Q_UNUSED(job)
73 Q_UNUSED(title)
74 Q_UNUSED(field1)
75 Q_UNUSED(field2)
76}
77
78void KJobTrackerInterface::infoMessage(KJob *job, const QString &text)
79{
80 Q_UNUSED(job)
81 Q_UNUSED(text)
82}
83
84void KJobTrackerInterface::warning(KJob *job, const QString &message)
85{
86 Q_UNUSED(job)
87 Q_UNUSED(message)
88}
89
90void KJobTrackerInterface::totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
91{
92 Q_UNUSED(job)
93 Q_UNUSED(unit)
94 Q_UNUSED(amount)
95}
96
97void KJobTrackerInterface::processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
98{
99 Q_UNUSED(job)
100 Q_UNUSED(unit)
101 Q_UNUSED(amount)
102}
103
104void KJobTrackerInterface::percent(KJob *job, unsigned long percent)
105{
106 Q_UNUSED(job)
107 Q_UNUSED(percent)
108}
109
110void KJobTrackerInterface::speed(KJob *job, unsigned long value)
111{
112 Q_UNUSED(job)
113 Q_UNUSED(value)
114}
115
116#include "moc_kjobtrackerinterface.cpp"
117

source code of kcoreaddons/src/lib/jobs/kjobtrackerinterface.cpp