Changeset View
Changeset View
Standalone View
Standalone View
runners/kill/killrunner.h
Show All 16 Lines | |||||
17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef KILLRUNNER_H | 20 | #ifndef KILLRUNNER_H | ||
21 | #define KILLRUNNER_H | 21 | #define KILLRUNNER_H | ||
22 | 22 | | |||
23 | #include <QReadWriteLock> | 23 | #include <QReadWriteLock> | ||
24 | #include <QTimer> | 24 | #include <QTimer> | ||
25 | | ||||
26 | #include <KRunner/AbstractRunner> | 25 | #include <KRunner/AbstractRunner> | ||
27 | 26 | | |||
28 | #include "killrunner_config.h" | 27 | #include "config_keys.h" | ||
28 | | ||||
29 | class QAction; | 29 | class QAction; | ||
30 | 30 | | |||
31 | namespace KSysGuard | 31 | namespace KSysGuard | ||
32 | { | 32 | { | ||
33 | class Processes; | 33 | class Processes; | ||
34 | class Process; | 34 | class Process; | ||
35 | } | 35 | } | ||
36 | 36 | | |||
Show All 10 Lines | 41 | public: | |||
47 | QList<QAction*> actionsForMatch(const Plasma::QueryMatch &match) override; | 47 | QList<QAction*> actionsForMatch(const Plasma::QueryMatch &match) override; | ||
48 | void reloadConfiguration() override; | 48 | void reloadConfiguration() override; | ||
49 | 49 | | |||
50 | private Q_SLOTS: | 50 | private Q_SLOTS: | ||
51 | void prep(); | 51 | void prep(); | ||
52 | void cleanup(); | 52 | void cleanup(); | ||
53 | 53 | | |||
54 | private: | 54 | private: | ||
55 | /** @param uid the uid of the user | | |||
56 | * @return the username of the user with the UID uid | | |||
57 | */ | | |||
58 | QString getUserName(qlonglong uid); | | |||
59 | | ||||
60 | /** The trigger word */ | 55 | /** The trigger word */ | ||
61 | QString m_triggerWord; | 56 | QString m_triggerWord; | ||
62 | 57 | | |||
63 | /** How to sort */ | 58 | /** How to sort */ | ||
64 | KillRunnerConfig::Sort m_sorting; | 59 | Sort m_sorting; | ||
65 | 60 | | |||
66 | /** process lister */ | 61 | /** process lister */ | ||
67 | KSysGuard::Processes *m_processes; | 62 | KSysGuard::Processes *m_processes; | ||
68 | 63 | | |||
69 | /** lock for initializing m_processes */ | 64 | /** lock for initializing m_processes */ | ||
70 | QReadWriteLock m_prepLock; | 65 | QReadWriteLock m_prepLock; | ||
71 | 66 | | |||
72 | /** timer for retrying the cleanup due to lock contention */ | 67 | /** timer for retrying the cleanup due to lock contention */ | ||
73 | QTimer m_delayedCleanupTimer; | 68 | QTimer m_delayedCleanupTimer; | ||
69 | | ||||
70 | /** Reuse actions */ | ||||
71 | QList<QAction *> m_actionList; | ||||
72 | | ||||
73 | /** Reuse value */ | ||||
74 | bool m_hasTrigger; | ||||
74 | }; | 75 | }; | ||
75 | 76 | | |||
76 | #endif | 77 | #endif |