2
Copyright (c) 2008-2009 Sebastian Trueg <trueg@kde.org>
2
Copyright (c) 2008-2010 Sebastian Trueg <trueg@kde.org>
4
4
This library is free software; you can redistribute it and/or
5
5
modify it under the terms of the GNU Library General Public
47
49
QueryService( QObject* parent, const QVariantList& );
50
static QueryService* instance();
52
static QThreadPool* searchThreadPool();
54
* Create a query folder from desktop query string \p query. The optional properties in \p requestProps will be
55
* added to the Query object once \p query has been parsed by QueryParser.
56
* Create a query folder from encoded query \p query.
57
58
Q_SCRIPTABLE QDBusObjectPath query( const QString& query, const QDBusMessage& msg );
61
* Create a query folder from desktop query string \p query which needs to be parsable by QueryParser.
63
Q_SCRIPTABLE QDBusObjectPath desktopQuery( const QString& query, const QDBusMessage& msg );
60
66
* Create a query folder from SPARQL query string \p query. The optional properties in \p requestProps are assumed
61
67
* to be part of \p query already as done by Query::toSparqlQuery. They are simple needed to map bindings to properties.
63
69
Q_SCRIPTABLE QDBusObjectPath sparqlQuery( const QString& query, const RequestPropertyMapDBus& requestProps, const QDBusMessage& msg );
66
void slotServiceUnregistered( const QString& serviceName );
67
void slotFolderDestroyed( QObject* folder );
68
void slotFolderConnectionDestroyed( QObject* conn );
72
void slotFolderAboutToBeDeleted( Nepomuk::Query::Folder* folder );
72
76
* Creates a new folder or reuses an existing one.
78
Folder* getFolder( const Query& query );
81
* Creates a new folder or reuses an existing one.
74
83
Folder* getFolder( const QString& sparql, const RequestPropertyMap& requestProps );
76
static QueryService* s_instance;
78
QHash<QString, Folder*> m_openFolders;
79
QHash<Folder*, QString> m_folderQueryHash;
80
QMultiHash<QString, FolderConnection*> m_openConnections; // maps from DBus service to connection
81
QHash<FolderConnection*, QString> m_connectionDBusServiceHash; // maps connections to their using dbus service
85
QHash<QString, Folder*> m_openSparqlFolders;
86
QHash<Query, Folder*> m_openQueryFolders;
83
88
int m_folderConnectionCnt; // only used for unique dbus object path generation
84
QDBusServiceWatcher *m_serviceWatcher;