KDEUI
kabstractwidgetjobtracker.cpp
Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (C) 2000 Matej Koss <koss@miesto.sk> 00003 Copyright (C) 2007 Kevin Ottens <ervin@kde.org> 00004 Copyright (C) 2007 Rafael Fernández López <ereslibre@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 00020 */ 00021 00022 #include "kabstractwidgetjobtracker.h" 00023 #include "kabstractwidgetjobtracker_p.h" 00024 00025 #include <QWidget> 00026 #include <QTimer> 00027 #include <QEvent> 00028 #include <QMap> 00029 00030 #include <kdebug.h> 00031 00032 KAbstractWidgetJobTracker::KAbstractWidgetJobTracker(QWidget *parent) 00033 : KJobTrackerInterface(parent) 00034 , d(new Private(this)) 00035 { 00036 } 00037 00038 KAbstractWidgetJobTracker::~KAbstractWidgetJobTracker() 00039 { 00040 delete d; 00041 } 00042 00043 void KAbstractWidgetJobTracker::registerJob(KJob *job) 00044 { 00045 KJobTrackerInterface::registerJob(job); 00046 } 00047 00048 void KAbstractWidgetJobTracker::unregisterJob(KJob *job) 00049 { 00050 KJobTrackerInterface::unregisterJob(job); 00051 } 00052 00053 void KAbstractWidgetJobTracker::setStopOnClose(KJob *job, bool stopOnClose) 00054 { 00055 d->setStopOnClose(job, stopOnClose); 00056 } 00057 00058 bool KAbstractWidgetJobTracker::stopOnClose(KJob *job) const 00059 { 00060 return d->stopOnClose(job); 00061 } 00062 00063 void KAbstractWidgetJobTracker::setAutoDelete(KJob *job, bool autoDelete) 00064 { 00065 d->setAutoDelete(job, autoDelete); 00066 } 00067 00068 bool KAbstractWidgetJobTracker::autoDelete(KJob *job) const 00069 { 00070 return d->autoDelete(job); 00071 } 00072 00073 void KAbstractWidgetJobTracker::finished(KJob *job) 00074 { 00075 Q_UNUSED(job); 00076 } 00077 00078 void KAbstractWidgetJobTracker::slotStop(KJob *job) 00079 { 00080 if (job) { 00081 job->kill(KJob::EmitResult); // notify that the job has been killed 00082 emit stopped(job); 00083 } 00084 } 00085 00086 void KAbstractWidgetJobTracker::slotSuspend(KJob *job) 00087 { 00088 if (job) { 00089 job->suspend(); 00090 emit suspend(job); 00091 } 00092 } 00093 00094 void KAbstractWidgetJobTracker::slotResume(KJob *job) 00095 { 00096 if (job) { 00097 job->resume(); 00098 emit resume(job); 00099 } 00100 } 00101 00102 void KAbstractWidgetJobTracker::slotClean(KJob *job) 00103 { 00104 Q_UNUSED(job); 00105 } 00106 00107 #include "kabstractwidgetjobtracker.moc"
KDE 4.6 API Reference