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 | |
13 | class KJobTrackerInterfacePrivate |
14 | { |
15 | public: |
16 | KJobTrackerInterfacePrivate(KJobTrackerInterface *interface) |
17 | : q(interface) |
18 | { |
19 | } |
20 | |
21 | KJobTrackerInterface *const q; |
22 | }; |
23 | |
24 | KJobTrackerInterface::KJobTrackerInterface(QObject *parent) |
25 | : QObject(parent) |
26 | , d(new KJobTrackerInterfacePrivate(this)) |
27 | { |
28 | qRegisterMetaType<KJob::Unit>(); |
29 | qRegisterMetaType<QPair<QString, QString>>(); |
30 | } |
31 | |
32 | KJobTrackerInterface::~KJobTrackerInterface() = default; |
33 | |
34 | void KJobTrackerInterface::registerJob(KJob *job) |
35 | { |
36 | connect(sender: job, signal: &KJob::finished, context: this, slot: &KJobTrackerInterface::unregisterJob); |
37 | connect(sender: job, signal: &KJob::finished, context: this, slot: &KJobTrackerInterface::finished); |
38 | connect(sender: job, signal: &KJob::suspended, context: this, slot: &KJobTrackerInterface::suspended); |
39 | connect(sender: job, signal: &KJob::resumed, context: this, slot: &KJobTrackerInterface::resumed); |
40 | |
41 | connect(sender: job, signal: &KJob::description, context: this, slot: &KJobTrackerInterface::description); |
42 | connect(sender: job, signal: &KJob::infoMessage, context: this, slot: &KJobTrackerInterface::infoMessage); |
43 | connect(sender: job, signal: &KJob::warning, context: this, slot: &KJobTrackerInterface::warning); |
44 | connect(sender: job, signal: &KJob::totalAmountChanged, context: this, slot: &KJobTrackerInterface::totalAmount); |
45 | connect(sender: job, signal: &KJob::processedAmountChanged, context: this, slot: &KJobTrackerInterface::processedAmount); |
46 | connect(sender: job, signal: &KJob::percentChanged, context: this, slot: &KJobTrackerInterface::percent); |
47 | connect(sender: job, signal: &KJob::speed, context: this, slot: &KJobTrackerInterface::speed); |
48 | } |
49 | |
50 | void KJobTrackerInterface::unregisterJob(KJob *job) |
51 | { |
52 | job->disconnect(receiver: this); |
53 | } |
54 | |
55 | void KJobTrackerInterface::finished(KJob *job) |
56 | { |
57 | Q_UNUSED(job) |
58 | } |
59 | |
60 | void KJobTrackerInterface::suspended(KJob *job) |
61 | { |
62 | Q_UNUSED(job) |
63 | } |
64 | |
65 | void KJobTrackerInterface::resumed(KJob *job) |
66 | { |
67 | Q_UNUSED(job) |
68 | } |
69 | |
70 | void 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 | |
78 | void KJobTrackerInterface::infoMessage(KJob *job, const QString &text) |
79 | { |
80 | Q_UNUSED(job) |
81 | Q_UNUSED(text) |
82 | } |
83 | |
84 | void KJobTrackerInterface::warning(KJob *job, const QString &message) |
85 | { |
86 | Q_UNUSED(job) |
87 | Q_UNUSED(message) |
88 | } |
89 | |
90 | void KJobTrackerInterface::totalAmount(KJob *job, KJob::Unit unit, qulonglong amount) |
91 | { |
92 | Q_UNUSED(job) |
93 | Q_UNUSED(unit) |
94 | Q_UNUSED(amount) |
95 | } |
96 | |
97 | void KJobTrackerInterface::processedAmount(KJob *job, KJob::Unit unit, qulonglong amount) |
98 | { |
99 | Q_UNUSED(job) |
100 | Q_UNUSED(unit) |
101 | Q_UNUSED(amount) |
102 | } |
103 | |
104 | void KJobTrackerInterface::percent(KJob *job, unsigned long percent) |
105 | { |
106 | Q_UNUSED(job) |
107 | Q_UNUSED(percent) |
108 | } |
109 | |
110 | void KJobTrackerInterface::speed(KJob *job, unsigned long value) |
111 | { |
112 | Q_UNUSED(job) |
113 | Q_UNUSED(value) |
114 | } |
115 | |
116 | #include "moc_kjobtrackerinterface.cpp" |
117 | |