• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • jobs
kabstractwidgetjobtracker.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2000 Matej Koss <koss@miesto.sk>
3 Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
4 Copyright (C) 2007 Rafael Fernández López <ereslibre@kde.org>
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#include <QTimer>
27#include <QEvent>
28#include <QMap>
29
30#include <kdebug.h>
31
32KAbstractWidgetJobTracker::KAbstractWidgetJobTracker(QWidget *parent)
33 : KJobTrackerInterface(parent)
34 , d(new Private(this))
35{
36}
37
38KAbstractWidgetJobTracker::~KAbstractWidgetJobTracker()
39{
40 delete d;
41}
42
43void KAbstractWidgetJobTracker::registerJob(KJob *job)
44{
45 KJobTrackerInterface::registerJob(job);
46}
47
48void KAbstractWidgetJobTracker::unregisterJob(KJob *job)
49{
50 KJobTrackerInterface::unregisterJob(job);
51}
52
53void KAbstractWidgetJobTracker::setStopOnClose(KJob *job, bool stopOnClose)
54{
55 d->setStopOnClose(job, stopOnClose);
56}
57
58bool KAbstractWidgetJobTracker::stopOnClose(KJob *job) const
59{
60 return d->stopOnClose(job);
61}
62
63void KAbstractWidgetJobTracker::setAutoDelete(KJob *job, bool autoDelete)
64{
65 d->setAutoDelete(job, autoDelete);
66}
67
68bool KAbstractWidgetJobTracker::autoDelete(KJob *job) const
69{
70 return d->autoDelete(job);
71}
72
73void KAbstractWidgetJobTracker::finished(KJob *job)
74{
75 Q_UNUSED(job);
76}
77
78void KAbstractWidgetJobTracker::slotStop(KJob *job)
79{
80 if (job) {
81 job->kill(KJob::EmitResult); // notify that the job has been killed
82 emit stopped(job);
83 }
84}
85
86void KAbstractWidgetJobTracker::slotSuspend(KJob *job)
87{
88 if (job) {
89 job->suspend();
90 emit suspend(job);
91 }
92}
93
94void KAbstractWidgetJobTracker::slotResume(KJob *job)
95{
96 if (job) {
97 job->resume();
98 emit resume(job);
99 }
100}
101
102void KAbstractWidgetJobTracker::slotClean(KJob *job)
103{
104 Q_UNUSED(job);
105}
106
107#include "kabstractwidgetjobtracker.moc"
KAbstractWidgetJobTracker::autoDelete
bool autoDelete(KJob *job) const
Checks whether the dialog should be deleted or cleaned.
Definition: kabstractwidgetjobtracker.cpp:68
KAbstractWidgetJobTracker::~KAbstractWidgetJobTracker
virtual ~KAbstractWidgetJobTracker()
Destroys a KAbstractWidgetJobTracker.
Definition: kabstractwidgetjobtracker.cpp:38
KAbstractWidgetJobTracker::slotStop
virtual void slotStop(KJob *job)
This method should be called for correct cancellation of IO operation Connect this to the progress wi...
Definition: kabstractwidgetjobtracker.cpp:78
KAbstractWidgetJobTracker::d
Private *const d
Definition: kabstractwidgetjobtracker.h:186
KAbstractWidgetJobTracker::resume
void resume(KJob *job)
Emitted when the user resumed the operation.
KAbstractWidgetJobTracker::slotClean
virtual void slotClean(KJob *job)
This method is called when the widget should be cleaned (after job is finished).
Definition: kabstractwidgetjobtracker.cpp:102
KAbstractWidgetJobTracker::stopOnClose
bool stopOnClose(KJob *job) const
Checks whether the job will be killed when the dialog is closed.
Definition: kabstractwidgetjobtracker.cpp:58
KAbstractWidgetJobTracker::slotSuspend
virtual void slotSuspend(KJob *job)
This method should be called for pause/resume Connect this to the progress widgets buttons etc.
Definition: kabstractwidgetjobtracker.cpp:86
KAbstractWidgetJobTracker::setAutoDelete
void setAutoDelete(KJob *job, bool autoDelete)
This controls whether the dialog should be deleted or only cleaned when the KJob is finished (or canc...
Definition: kabstractwidgetjobtracker.cpp:63
KAbstractWidgetJobTracker::stopped
void stopped(KJob *job)
Emitted when the user aborted the operation.
KAbstractWidgetJobTracker::setStopOnClose
void setStopOnClose(KJob *job, bool stopOnClose)
This controls whether the job should be canceled if the dialog is closed.
Definition: kabstractwidgetjobtracker.cpp:53
KAbstractWidgetJobTracker::unregisterJob
virtual void unregisterJob(KJob *job)
Unregister a job from this tracker.
Definition: kabstractwidgetjobtracker.cpp:48
KAbstractWidgetJobTracker::slotResume
virtual void slotResume(KJob *job)
This method should be called for pause/resume Connect this to the progress widgets buttons etc.
Definition: kabstractwidgetjobtracker.cpp:94
KAbstractWidgetJobTracker::suspend
void suspend(KJob *job)
Emitted when the user suspended the operation.
KAbstractWidgetJobTracker::finished
virtual void finished(KJob *job)
Called when a job is finished, in any case.
Definition: kabstractwidgetjobtracker.cpp:73
KAbstractWidgetJobTracker::registerJob
virtual void registerJob(KJob *job)
Register a new job in this tracker.
Definition: kabstractwidgetjobtracker.cpp:43
KAbstractWidgetJobTracker::KAbstractWidgetJobTracker
KAbstractWidgetJobTracker(QWidget *parent=0)
Creates a new KAbstractWidgetJobTracker.
Definition: kabstractwidgetjobtracker.cpp:32
KJobTrackerInterface
KJobTrackerInterface::registerJob
virtual void registerJob(KJob *job)
KJobTrackerInterface::unregisterJob
virtual void unregisterJob(KJob *job)
KJob
KJob::resume
bool resume()
KJob::suspend
bool suspend()
KJob::EmitResult
EmitResult
KJob::kill
bool kill(KillVerbosity verbosity=Quietly)
QWidget
kabstractwidgetjobtracker.h
kdebug.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal