KJobWidgets

kabstractwidgetjobtracker.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2000 Matej Koss <[email protected]>
3  Copyright (C) 2007 Kevin Ottens <[email protected]>
4  Copyright (C) 2007 Rafael Fernández López <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 
20 */
21 
22 #include "kabstractwidgetjobtracker.h"
23 #include "kabstractwidgetjobtracker_p.h"
24 
25 #include <QWidget>
26 
28  : KJobTrackerInterface(parent)
29  , d(new Private(this))
30 {
31 }
32 
34 {
35  delete d;
36 }
37 
39 {
41 }
42 
44 {
46 }
47 
49 {
50  d->setStopOnClose(job, stopOnClose);
51 }
52 
54 {
55  return d->stopOnClose(job);
56 }
57 
59 {
60  d->setAutoDelete(job, autoDelete);
61 }
62 
64 {
65  return d->autoDelete(job);
66 }
67 
69 {
70  Q_UNUSED(job);
71 }
72 
74 {
75  if (job) {
76  job->kill(KJob::EmitResult); // notify that the job has been killed
77  emit stopped(job);
78  }
79 }
80 
82 {
83  if (job) {
84  job->suspend();
85  emit suspend(job);
86  }
87 }
88 
90 {
91  if (job) {
92  job->resume();
93  emit resume(job);
94  }
95 }
96 
98 {
99  Q_UNUSED(job);
100 }
101 
bool kill(KillVerbosity verbosity=Quietly)
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...
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.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 14 2020 22:48:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.