let's see if serializing (via a mutex) access to kservicetypetrader helps with those kservicetypetrader related crashes i'm seeing constantly go away
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=768454
This commit is contained in:
parent
9df86adbd2
commit
099785fbdc
|
@ -18,11 +18,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "abstractrunner.h"
|
#include "abstractrunner.h"
|
||||||
#include "searchcontext.h"
|
|
||||||
|
#include <QMutex>
|
||||||
|
#include <QMutexLocker>
|
||||||
|
|
||||||
#include <KDebug>
|
#include <KDebug>
|
||||||
#include <KServiceTypeTrader>
|
#include <KServiceTypeTrader>
|
||||||
|
|
||||||
|
#include "searchcontext.h"
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -147,6 +151,14 @@ void AbstractRunner::setPriority(Priority priority)
|
||||||
d->priority = priority;
|
d->priority = priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QMutex serviceTypeTraderLock;
|
||||||
|
|
||||||
|
KService::List AbstractRunner::serviceQuery(const QString &serviceType, const QString &constraint) const
|
||||||
|
{
|
||||||
|
QMutexLocker lock(&serviceTypeTraderLock);
|
||||||
|
return KServiceTypeTrader::self()->query(serviceType, constraint);
|
||||||
|
}
|
||||||
|
|
||||||
void AbstractRunner::exec(Plasma::SearchMatch *action)
|
void AbstractRunner::exec(Plasma::SearchMatch *action)
|
||||||
{
|
{
|
||||||
Q_UNUSED(action)
|
Q_UNUSED(action)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
#include <KDE/KConfigGroup>
|
#include <KDE/KConfigGroup>
|
||||||
|
#include <KDE/KService>
|
||||||
|
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
#include <plasma/searchmatch.h>
|
#include <plasma/searchmatch.h>
|
||||||
|
@ -193,6 +194,18 @@ class PLASMA_EXPORT AbstractRunner : public QObject
|
||||||
*/
|
*/
|
||||||
void setPriority(Priority newPriority);
|
void setPriority(Priority newPriority);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A thread safe (blocking) method to do queries of installed Services
|
||||||
|
*
|
||||||
|
* @arg serviceType a service type like "Plasma/Applet" or "KFilePlugin"
|
||||||
|
* @arg constraint a constraint to limie the the choices returned.
|
||||||
|
* @see KServiceTypeTrader::query(const QString&, const QString&)
|
||||||
|
*
|
||||||
|
* @return a list of services that satisfy the query.
|
||||||
|
*/
|
||||||
|
KService::List serviceQuery(const QString &serviceType,
|
||||||
|
const QString &constraint = QString()) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Private;
|
class Private;
|
||||||
Private* const d;
|
Private* const d;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user