Changeset View
Changeset View
Standalone View
Standalone View
src/server/search/agentsearchinstance.h
Show All 17 Lines | |||||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef AKONADI_AGENTSEARCHINSTANCE_H | 20 | #ifndef AKONADI_AGENTSEARCHINSTANCE_H | ||
21 | #define AKONADI_AGENTSEARCHINSTANCE_H | 21 | #define AKONADI_AGENTSEARCHINSTANCE_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QString> | 24 | #include <QString> | ||
25 | 25 | | |||
26 | #include <memory> | ||||
27 | | ||||
26 | class QDBusServiceWatcher; | 28 | class QDBusServiceWatcher; | ||
27 | class OrgFreedesktopAkonadiAgentSearchInterface; | 29 | class OrgFreedesktopAkonadiAgentSearchInterface; | ||
28 | 30 | | |||
29 | namespace Akonadi | 31 | namespace Akonadi | ||
30 | { | 32 | { | ||
31 | namespace Server | 33 | namespace Server | ||
32 | { | 34 | { | ||
33 | 35 | | |||
34 | class AgentSearchInstance : public QObject | 36 | class AgentSearchInstance : public QObject | ||
35 | { | 37 | { | ||
36 | Q_OBJECT | 38 | Q_OBJECT | ||
37 | public: | 39 | public: | ||
38 | explicit AgentSearchInstance(const QString &id); | 40 | explicit AgentSearchInstance(const QString &id); | ||
39 | ~AgentSearchInstance() override; | 41 | ~AgentSearchInstance() override; | ||
40 | 42 | | |||
41 | bool init(); | 43 | bool init(); | ||
42 | 44 | | |||
43 | void search(const QByteArray &searchId, const QString &query, qlonglong collectionId); | 45 | void search(const QByteArray &searchId, const QString &query, qlonglong collectionId); | ||
44 | 46 | | |||
45 | OrgFreedesktopAkonadiAgentSearchInterface *interface() const; | 47 | OrgFreedesktopAkonadiAgentSearchInterface *interface() const; | ||
46 | 48 | | |||
47 | private Q_SLOTS: | | |||
48 | void serviceOwnerChanged(const QString &service, const QString &oldName, const QString &newName); | | |||
49 | | ||||
50 | private: | 49 | private: | ||
51 | QString mId; | 50 | QString mId; | ||
52 | OrgFreedesktopAkonadiAgentSearchInterface *mInterface; | 51 | OrgFreedesktopAkonadiAgentSearchInterface *mInterface; | ||
53 | QDBusServiceWatcher *mServiceWatcher; | 52 | std::unique_ptr<QDBusServiceWatcher> mServiceWatcher; | ||
54 | }; | 53 | }; | ||
55 | 54 | | |||
56 | } // namespace Server | 55 | } // namespace Server | ||
57 | } // namespace Akonadi | 56 | } // namespace Akonadi | ||
58 | 57 | | |||
59 | #endif // AKONADI_AGENTSEARCHINSTANCE_H | 58 | #endif // AKONADI_AGENTSEARCHINSTANCE_H |