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 
38 void KAbstractWidgetJobTracker::setStopOnClose(KJob *job, bool stopOnClose)
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 }
bool resume()
void suspend(KJob *job)
Emitted when the user suspended the operation.
bool stopOnClose(KJob *job) const
Checks whether the job will be killed when the dialog is closed.
virtual void unregisterJob(KJob *job)
virtual void registerJob(KJob *job)
virtual void slotStop(KJob *job)
This method should be called for correct cancellation of IO operation Connect this to the progress wi...
bool suspend()
Q_EMITQ_EMIT
KAbstractWidgetJobTracker(QWidget *parent=nullptr)
Creates a new KAbstractWidgetJobTracker.
bool kill(KillVerbosity verbosity=Quietly)
void finished(KJob *job) override
Called when a job is finished, in any case.
bool autoDelete(KJob *job) const
Checks whether the dialog should be deleted or cleaned.
void stopped(KJob *job)
Emitted when the user aborted the operation.
void unregisterJob(KJob *job) override
Unregister a job from this tracker.
~KAbstractWidgetJobTracker() override
Destroys a KAbstractWidgetJobTracker.
virtual void slotResume(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.
void setAutoDelete(KJob *job, bool autoDelete)
This controls whether the dialog should be deleted or only cleaned when the KJob is finished (or canc...
virtual void slotClean(KJob *job)
This method is called when the widget should be cleaned (after job is finished).
void resume(KJob *job)
Emitted when the user resumed the operation.
virtual void slotSuspend(KJob *job)
This method should be called for pause/resume Connect this to the progress widgets buttons etc.
void registerJob(KJob *job) override
Register a new job in this tracker.
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Oct 6 2022 04:15:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.