00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kjobtrackerinterface.h"
00021
00022 #include "kjob.h"
00023
00024 class KJobTrackerInterface::Private
00025 {
00026 public:
00027 Private(KJobTrackerInterface *interface) : q(interface)
00028 {
00029
00030 }
00031
00032 KJobTrackerInterface *const q;
00033 };
00034
00035 KJobTrackerInterface::KJobTrackerInterface(QObject *parent)
00036 : QObject(parent), d(new Private(this))
00037 {
00038
00039 }
00040
00041 KJobTrackerInterface::~KJobTrackerInterface()
00042 {
00043 delete d;
00044 }
00045
00046 void KJobTrackerInterface::registerJob(KJob *job)
00047 {
00048 QObject::connect(job, SIGNAL(finished(KJob*)),
00049 this, SLOT(unregisterJob(KJob*)));
00050 QObject::connect(job, SIGNAL(finished(KJob*)),
00051 this, SLOT(finished(KJob*)));
00052
00053 QObject::connect(job, SIGNAL(suspended(KJob*)),
00054 this, SLOT(suspended(KJob*)));
00055 QObject::connect(job, SIGNAL(resumed(KJob*)),
00056 this, SLOT(resumed(KJob*)));
00057
00058 QObject::connect(job, SIGNAL(description(KJob*, const QString&,
00059 const QPair<QString, QString>&,
00060 const QPair<QString, QString>&)),
00061 this, SLOT(description(KJob*, const QString&,
00062 const QPair<QString, QString>&,
00063 const QPair<QString, QString>&)));
00064 QObject::connect(job, SIGNAL(infoMessage(KJob*, const QString&, const QString&)),
00065 this, SLOT(infoMessage(KJob*, const QString&, const QString&)));
00066 QObject::connect(job, SIGNAL(warning(KJob*, const QString&, const QString&)),
00067 this, SLOT(warning(KJob*, const QString&, const QString&)));
00068
00069 QObject::connect(job, SIGNAL(totalAmount(KJob*, KJob::Unit, qulonglong)),
00070 this, SLOT(totalAmount(KJob*, KJob::Unit, qulonglong)));
00071 QObject::connect(job, SIGNAL(processedAmount(KJob*, KJob::Unit, qulonglong)),
00072 this, SLOT(processedAmount(KJob*, KJob::Unit, qulonglong)));
00073 QObject::connect(job, SIGNAL(percent(KJob*, unsigned long)),
00074 this, SLOT(percent(KJob*, unsigned long)));
00075 QObject::connect(job, SIGNAL(speed(KJob*, unsigned long)),
00076 this, SLOT(speed(KJob*, unsigned long)));
00077 }
00078
00079 void KJobTrackerInterface::unregisterJob(KJob *job)
00080 {
00081 QObject::disconnect(job, SIGNAL(finished(KJob*)),
00082 this, SLOT(unregisterJob(KJob*)));
00083 QObject::disconnect(job, SIGNAL(finished(KJob*)),
00084 this, SLOT(finished(KJob*)));
00085
00086 QObject::disconnect(job, SIGNAL(suspended(KJob*)),
00087 this, SLOT(suspended(KJob*)));
00088 QObject::disconnect(job, SIGNAL(resumed(KJob*)),
00089 this, SLOT(resumed(KJob*)));
00090
00091 QObject::disconnect(job, SIGNAL(description(KJob*, const QString&,
00092 const QPair<QString, QString>&,
00093 const QPair<QString, QString>&)),
00094 this, SLOT(description(KJob*, const QString&,
00095 const QPair<QString, QString>&,
00096 const QPair<QString, QString>&)));
00097 QObject::disconnect(job, SIGNAL(infoMessage(KJob*, const QString&, const QString&)),
00098 this, SLOT(infoMessage(KJob*, const QString&, const QString&)));
00099 QObject::disconnect(job, SIGNAL(warning(KJob*, const QString&, const QString&)),
00100 this, SLOT(warning(KJob*, const QString&, const QString&)));
00101
00102 QObject::disconnect(job, SIGNAL(totalAmount(KJob*, KJob::Unit, qulonglong)),
00103 this, SLOT(totalAmount(KJob*, KJob::Unit, qulonglong)));
00104 QObject::disconnect(job, SIGNAL(processedAmount(KJob*, KJob::Unit, qulonglong)),
00105 this, SLOT(processedAmount(KJob*, KJob::Unit, qulonglong)));
00106 QObject::disconnect(job, SIGNAL(percent(KJob*, unsigned long)),
00107 this, SLOT(percent(KJob*, unsigned long)));
00108 QObject::disconnect(job, SIGNAL(speed(KJob*, unsigned long)),
00109 this, SLOT(speed(KJob*, unsigned long)));
00110 }
00111
00112 void KJobTrackerInterface::finished(KJob *job)
00113 {
00114 Q_UNUSED(job)
00115 }
00116
00117 void KJobTrackerInterface::suspended(KJob *job)
00118 {
00119 Q_UNUSED(job)
00120 }
00121
00122 void KJobTrackerInterface::resumed(KJob *job)
00123 {
00124 Q_UNUSED(job)
00125 }
00126
00127 void KJobTrackerInterface::description(KJob *job, const QString &title,
00128 const QPair<QString, QString> &field1,
00129 const QPair<QString, QString> &field2)
00130 {
00131 Q_UNUSED(job)
00132 Q_UNUSED(title)
00133 Q_UNUSED(field1)
00134 Q_UNUSED(field2)
00135
00136 }
00137
00138 void KJobTrackerInterface::infoMessage(KJob *job, const QString &plain, const QString &rich)
00139 {
00140 Q_UNUSED(job)
00141 Q_UNUSED(plain)
00142 Q_UNUSED(rich)
00143 }
00144
00145 void KJobTrackerInterface::warning(KJob *job, const QString &plain, const QString &rich)
00146 {
00147 Q_UNUSED(job)
00148 Q_UNUSED(plain)
00149 Q_UNUSED(rich)
00150 }
00151
00152 void KJobTrackerInterface::totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
00153 {
00154 Q_UNUSED(job)
00155 Q_UNUSED(unit)
00156 Q_UNUSED(amount)
00157 }
00158
00159 void KJobTrackerInterface::processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
00160 {
00161 Q_UNUSED(job)
00162 Q_UNUSED(unit)
00163 Q_UNUSED(amount)
00164 }
00165
00166 void KJobTrackerInterface::percent(KJob *job, unsigned long percent)
00167 {
00168 Q_UNUSED(job)
00169 Q_UNUSED(percent)
00170 }
00171
00172 void KJobTrackerInterface::speed(KJob *job, unsigned long value)
00173 {
00174 Q_UNUSED(job)
00175 Q_UNUSED(value)
00176 }
00177
00178 #include "kjobtrackerinterface.moc"