KJobWidgets

kabstractwidgetjobtracker.cpp
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 2000 Matej Koss <[email protected]>
4  SPDX-FileCopyrightText: 2007 Kevin Ottens <[email protected]>
5  SPDX-FileCopyrightText: 2007 Rafael Fernández López <[email protected]>
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 
20 KAbstractWidgetJobTracker::KAbstractWidgetJobTracker(KAbstractWidgetJobTrackerPrivate &dd, QWidget *parent)
21  : KJobTrackerInterface(parent)
22  , d(&dd)
23 {
24 }
25 
27 
29 {
31 }
32 
34 {
36 }
37 
39 {
41 
42  d->setStopOnClose(job, stopOnClose);
43 }
44 
46 {
47  Q_D(const KAbstractWidgetJobTracker);
48 
49  return d->stopOnClose(job);
50 }
51 
53 {
55 
56  d->setAutoDelete(job, autoDelete);
57 }
58 
60 {
61  Q_D(const KAbstractWidgetJobTracker);
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 }
bool kill(KillVerbosity verbosity=Quietly)
KJobTrackerInterface(QObject *parent=nullptr)
void finished(KJob *job) override
Called when a job is finished, in any case.
~KAbstractWidgetJobTracker() override
Destroys a KAbstractWidgetJobTracker.
void setAutoDelete(KJob *job, bool autoDelete)
This controls whether the dialog should be deleted or only cleaned when the KJob is finished (or canc...
The base class for widget based job trackers.
virtual void slotSuspend(KJob *job)
This method should be called for pause/resume Connect this to the progress widgets buttons etc...
void setStopOnClose(KJob *job, bool stopOnClose)
This controls whether the job should be canceled if the dialog is closed.
virtual void slotClean(KJob *job)
This method is called when the widget should be cleaned (after job is finished).
bool autoDelete(KJob *job) const
Checks whether the dialog should be deleted or cleaned.
bool suspend()
void resume(KJob *job)
Emitted when the user resumed the operation.
void unregisterJob(KJob *job) override
Unregister a job from this tracker.
void registerJob(KJob *job) override
Register a new job in this tracker.
bool resume()
KAbstractWidgetJobTracker(QWidget *parent=nullptr)
Creates a new KAbstractWidgetJobTracker.
virtual void slotResume(KJob *job)
This method should be called for pause/resume Connect this to the progress widgets buttons etc...
void suspend(KJob *job)
Emitted when the user suspended the operation.
void stopped(KJob *job)
Emitted when the user aborted the operation.
virtual void slotStop(KJob *job)
This method should be called for correct cancellation of IO operation Connect this to the progress wi...
virtual void unregisterJob(KJob *job)
virtual void registerJob(KJob *job)
bool stopOnClose(KJob *job) const
Checks whether the job will be killed when the dialog is closed.
QObject * parent() const const
Q_EMITQ_EMIT
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun May 16 2021 22:48:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.