KJobWidgets

kabstractwidgetjobtracker.cpp
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
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
27
32
37
39{
41
42 d->setStopOnClose(job, stopOnClose);
43}
44
46{
48
49 return d->stopOnClose(job);
50}
51
53{
55
56 d->setAutoDelete(job, autoDelete);
57}
58
60{
62
63 return d->autoDelete(job);
64}
65
67{
68 Q_UNUSED(job);
69}
70
72{
73 if (job) {
74 job->kill(KJob::EmitResult); // notify that the job has been killed
75 Q_EMIT stopped(job);
76 }
77}
78
80{
81 if (job) {
82 job->suspend();
83 Q_EMIT suspend(job);
84 }
85}
86
88{
89 if (job) {
90 job->resume();
91 Q_EMIT resume(job);
92 }
93}
94
96{
97 Q_UNUSED(job);
98}
99
100#include "moc_kabstractwidgetjobtracker.cpp"
The base class for widget based job trackers.
bool autoDelete(KJob *job) const
Checks whether the dialog should be deleted or cleaned.
virtual void slotStop(KJob *job)
This method should be called for correct cancellation of IO operation Connect this to the progress wi...
~KAbstractWidgetJobTracker() override
Destroys a KAbstractWidgetJobTracker.
KAbstractWidgetJobTracker(QWidget *parent=nullptr)
Creates a new KAbstractWidgetJobTracker.
void resume(KJob *job)
Emitted when the user resumed the operation.
virtual void slotClean(KJob *job)
This method is called when the widget should be cleaned (after job is finished).
bool stopOnClose(KJob *job) const
Checks whether the job will be killed when the dialog is closed.
virtual void slotSuspend(KJob *job)
This method should be called for pause/resume Connect this to the progress widgets buttons etc.
void unregisterJob(KJob *job) override
Unregister a job from this tracker.
void setAutoDelete(KJob *job, bool autoDelete)
This controls whether the dialog should be deleted or only cleaned when the KJob is finished (or canc...
void stopped(KJob *job)
Emitted when the user aborted the operation.
void registerJob(KJob *job) override
Register a new job in this tracker.
void setStopOnClose(KJob *job, bool stopOnClose)
This controls whether the job should be canceled if the dialog is closed.
void finished(KJob *job) override
Called when a job is finished, in any case.
virtual void slotResume(KJob *job)
This method should be called for pause/resume Connect this to the progress widgets buttons etc.
virtual void registerJob(KJob *job)
virtual void unregisterJob(KJob *job)
bool resume()
bool suspend()
bool kill(KJob::KillVerbosity verbosity=KJob::Quietly)
void suspend()
Q_EMITQ_EMIT
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.