1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2000 Matej Koss <koss@miesto.sk>
4 SPDX-FileCopyrightText: 2007 Kevin Ottens <ervin@kde.org>
5 SPDX-FileCopyrightText: 2007 Rafael Fernández López <ereslibre@kde.org>
6
7 SPDX-License-Identifier: LGPL-2.0-only
8*/
9
10#include "kabstractwidgetjobtracker.h"
11#include "kabstractwidgetjobtracker_p.h"
12
13#include <QWidget>
14
15KAbstractWidgetJobTracker::KAbstractWidgetJobTracker(QWidget *parent)
16 : KAbstractWidgetJobTracker(*new KAbstractWidgetJobTrackerPrivate(this), parent)
17{
18}
19
20KAbstractWidgetJobTracker::KAbstractWidgetJobTracker(KAbstractWidgetJobTrackerPrivate &dd, QWidget *parent)
21 : KJobTrackerInterface(parent)
22 , d_ptr(&dd)
23{
24}
25
26KAbstractWidgetJobTracker::~KAbstractWidgetJobTracker() = default;
27
28void KAbstractWidgetJobTracker::registerJob(KJob *job)
29{
30 KJobTrackerInterface::registerJob(job);
31}
32
33void KAbstractWidgetJobTracker::unregisterJob(KJob *job)
34{
35 KJobTrackerInterface::unregisterJob(job);
36}
37
38void KAbstractWidgetJobTracker::setStopOnClose(KJob *job, bool stopOnClose)
39{
40 Q_D(KAbstractWidgetJobTracker);
41
42 d->setStopOnClose(job, stopOnClose);
43}
44
45bool KAbstractWidgetJobTracker::stopOnClose(KJob *job) const
46{
47 Q_D(const KAbstractWidgetJobTracker);
48
49 return d->stopOnClose(job);
50}
51
52void KAbstractWidgetJobTracker::setAutoDelete(KJob *job, bool autoDelete)
53{
54 Q_D(KAbstractWidgetJobTracker);
55
56 d->setAutoDelete(job, autoDelete);
57}
58
59bool KAbstractWidgetJobTracker::autoDelete(KJob *job) const
60{
61 Q_D(const KAbstractWidgetJobTracker);
62
63 return d->autoDelete(job);
64}
65
66void KAbstractWidgetJobTracker::finished(KJob *job)
67{
68 Q_UNUSED(job);
69}
70
71void KAbstractWidgetJobTracker::slotStop(KJob *job)
72{
73 if (job) {
74 job->kill(verbosity: KJob::EmitResult); // notify that the job has been killed
75 Q_EMIT stopped(job);
76 }
77}
78
79void KAbstractWidgetJobTracker::slotSuspend(KJob *job)
80{
81 if (job) {
82 job->suspend();
83 Q_EMIT suspend(job);
84 }
85}
86
87void KAbstractWidgetJobTracker::slotResume(KJob *job)
88{
89 if (job) {
90 job->resume();
91 Q_EMIT resume(job);
92 }
93}
94
95void KAbstractWidgetJobTracker::slotClean(KJob *job)
96{
97 Q_UNUSED(job);
98}
99
100#include "moc_kabstractwidgetjobtracker.cpp"
101

source code of kjobwidgets/src/kabstractwidgetjobtracker.cpp