Changeset View
Changeset View
Standalone View
Standalone View
runners/baloo/baloosearchrunner.h
Show All 16 Lines | |||||
17 | * License along with this library; if not, write to the Free Software | 17 | * License along with this library; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef _BALOO_SEARCH_RUNNER_H_ | 22 | #ifndef _BALOO_SEARCH_RUNNER_H_ | ||
23 | #define _BALOO_SEARCH_RUNNER_H_ | 23 | #define _BALOO_SEARCH_RUNNER_H_ | ||
24 | 24 | | |||
25 | #include <QObject> | 25 | #include <KDBusRunner/AbstractRunner> | ||
26 | #include <QDBusContext> | | |||
27 | #include <QDBusMessage> | | |||
28 | | ||||
29 | #include <KRunner/QueryMatch> | | |||
30 | #include "dbusutils_p.h" | | |||
31 | 26 | | |||
32 | class QTimer; | 27 | class QTimer; | ||
33 | 28 | | |||
34 | class SearchRunner : public QObject, protected QDBusContext | 29 | class SearchRunner : public KDBusRunner::AbstractRunner | ||
35 | { | 30 | { | ||
36 | Q_OBJECT | 31 | Q_OBJECT | ||
37 | 32 | | |||
38 | public: | 33 | public: | ||
39 | explicit SearchRunner(QObject* parent=nullptr); | 34 | explicit SearchRunner(QObject* parent=nullptr); | ||
40 | ~SearchRunner() override; | 35 | ~SearchRunner() override; | ||
41 | 36 | | |||
42 | RemoteActions Actions(); | 37 | KDBusRunner::Actions actions() const override; | ||
43 | RemoteMatches Match(const QString &searchTerm); | 38 | void handleMatchRequest(const KDBusRunner::MatchReply::Ptr &matchReply) override; | ||
44 | void Run(const QString &id, const QString &actionId); | 39 | void run(const QString &matchId, const QString &actionId) override; | ||
45 | 40 | | |||
46 | private: | 41 | private: | ||
47 | void performMatch(); | 42 | void performMatch(); | ||
48 | RemoteMatches matchInternal(const QString &searchTerm, const QString& type, | 43 | void matchInternal(const QString &type, const QString &category); | ||
49 | const QString& category); | | |||
50 | 44 | | |||
51 | QDBusMessage m_lastRequest; | 45 | KDBusRunner::MatchReply::Ptr m_matchReply; | ||
52 | QString m_searchTerm; | | |||
53 | QTimer *m_timer = nullptr; | 46 | QTimer *m_timer = nullptr; | ||
54 | }; | 47 | }; | ||
55 | 48 | | |||
56 | #endif // _BALOO_SEARCH_RUNNER_H_ | 49 | #endif // _BALOO_SEARCH_RUNNER_H_ |