some improvements as suggested by mattr via review-board. boy, what a neat tool
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=768467
This commit is contained in:
parent
099785fbdc
commit
55eb91140b
@ -44,8 +44,12 @@ class AbstractRunner::Private
|
||||
speed(NormalSpeed),
|
||||
tier(0)
|
||||
{}
|
||||
|
||||
static QMutex serviceTypeTraderLock;
|
||||
};
|
||||
|
||||
QMutex AbstractRunner::Private::serviceTypeTraderLock;
|
||||
|
||||
AbstractRunner::AbstractRunner(QObject* parent)
|
||||
: QObject(parent),
|
||||
d(new Private())
|
||||
@ -151,11 +155,9 @@ void AbstractRunner::setPriority(Priority priority)
|
||||
d->priority = priority;
|
||||
}
|
||||
|
||||
QMutex serviceTypeTraderLock;
|
||||
|
||||
KService::List AbstractRunner::serviceQuery(const QString &serviceType, const QString &constraint) const
|
||||
{
|
||||
QMutexLocker lock(&serviceTypeTraderLock);
|
||||
QMutexLocker lock(&Private::serviceTypeTraderLock);
|
||||
return KServiceTypeTrader::self()->query(serviceType, constraint);
|
||||
}
|
||||
|
||||
|
@ -195,10 +195,12 @@ class PLASMA_EXPORT AbstractRunner : public QObject
|
||||
void setPriority(Priority newPriority);
|
||||
|
||||
/**
|
||||
* A thread safe (blocking) method to do queries of installed Services
|
||||
* A blocking method to do queries of installed Services which can provide
|
||||
* a measure of safety for runners running their own threads. This should
|
||||
* be used instead of calling KServiceTypeTrader::query(..) directly.
|
||||
*
|
||||
* @arg serviceType a service type like "Plasma/Applet" or "KFilePlugin"
|
||||
* @arg constraint a constraint to limie the the choices returned.
|
||||
* @arg constraint a constraint to limit the the choices returned.
|
||||
* @see KServiceTypeTrader::query(const QString&, const QString&)
|
||||
*
|
||||
* @return a list of services that satisfy the query.
|
||||
|
Loading…
Reference in New Issue
Block a user