take an optional parent parameter, always be sure the job has a parent

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=866341
This commit is contained in:
Aaron J. Seigo 2008-09-30 16:03:11 +00:00
parent 443a3b3352
commit 266765dd9b
2 changed files with 3 additions and 2 deletions

View File

@ -132,7 +132,7 @@ KConfigGroup Service::operationDescription(const QString &operationName)
return params;
}
ServiceJob* Service::startOperationCall(const KConfigGroup &description)
ServiceJob* Service::startOperationCall(const KConfigGroup &description, QObject *parent)
{
// TODO: nested groups?
ServiceJob *job = 0;
@ -159,6 +159,7 @@ ServiceJob* Service::startOperationCall(const KConfigGroup &description)
job = new NullServiceJob(destination(), op, this);
}
job->setParent(parent ? parent : this);
connect(job, SIGNAL(finished(KJob*)), this, SLOT(jobFinished(KJob*)));
QTimer::singleShot(0, job, SLOT(slotStart()));
return job;

View File

@ -123,7 +123,7 @@ public:
* @return a started ServiceJob; the consumer may connect to relevant
* signals before returning to the event loop
*/
ServiceJob* startOperationCall(const KConfigGroup &description);
ServiceJob* startOperationCall(const KConfigGroup &description, QObject *parent = 0);
/**
* Query to find if an operation is enabled or not.