Changeset View
Changeset View
Standalone View
Standalone View
runners/katesessions/katesessions.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright 2008 Sebastian Kügler <sebas@kde.org> | 2 | * Copyright 2008 Sebastian Kügler <sebas@kde.org> | ||
3 | * Copyright 2017 Kai Uwe Broulik <kde@privat.broulik.de> | 3 | * Copyright 2017 Kai Uwe Broulik <kde@privat.broulik.de> | ||
4 | * Copyright 2020 Alexander Lohnau <alexander.lohnau@gmx.de> | ||||
4 | * | 5 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU Library General Public License as | 7 | * it under the terms of the GNU Library General Public License as | ||
7 | * published by the Free Software Foundation; either version 2, or | 8 | * published by the Free Software Foundation; either version 2, or | ||
8 | * (at your option) any later version. | 9 | * (at your option) any later version. | ||
9 | * | 10 | * | ||
10 | * This program is distributed in the hope that it will be useful, | 11 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details | 14 | * GNU General Public License for more details | ||
14 | * | 15 | * | ||
15 | * You should have received a copy of the GNU Library General Public | 16 | * You should have received a copy of the GNU Library General Public | ||
16 | * License along with this program; if not, write to the | 17 | * License along with this program; if not, write to the | ||
17 | * Free Software Foundation, Inc., | 18 | * Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 20 | */ | ||
20 | 21 | | |||
21 | #ifndef KATESESSIONS_H | 22 | #ifndef KATESESSIONS_H | ||
22 | #define KATESESSIONS_H | 23 | #define KATESESSIONS_H | ||
23 | 24 | | |||
24 | #include <krunner/abstractrunner.h> | 25 | #include <KRunner/AbstractRunner> | ||
25 | 26 | | |||
26 | class KDirWatch; | 27 | class KDirWatch; | ||
27 | 28 | | |||
28 | class KateSessions : public Plasma::AbstractRunner { | 29 | class KateSessions : public Plasma::AbstractRunner { | ||
29 | Q_OBJECT | 30 | Q_OBJECT | ||
30 | 31 | | |||
31 | public: | 32 | public: | ||
32 | explicit KateSessions( QObject *parent, const QVariantList& args ); | 33 | explicit KateSessions(QObject *parent, const QVariantList& args); | ||
33 | ~KateSessions() override; | 34 | ~KateSessions() override; | ||
34 | 35 | | |||
35 | void match(Plasma::RunnerContext &context) override; | 36 | void match(Plasma::RunnerContext &context) override; | ||
36 | void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override; | 37 | void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override; | ||
37 | 38 | | |||
38 | private Q_SLOTS: | 39 | private Q_SLOTS: | ||
39 | void loadSessions(); | 40 | void loadSessions(); | ||
40 | void slotPrepare(); | | |||
41 | void slotTeardown(); | | |||
42 | 41 | | |||
43 | private: | 42 | private: | ||
44 | KDirWatch* m_sessionWatch = nullptr; | 43 | KDirWatch* m_sessionWatch = nullptr; | ||
45 | QString m_sessionsFolderPath; | 44 | QString m_sessionsFolderPath; | ||
46 | QStringList m_sessions; | 45 | QStringList m_sessions; | ||
46 | QLatin1String m_triggerWord = QLatin1String("kate"); | ||||
47 | }; | 47 | }; | ||
48 | 48 | | |||
49 | #endif | 49 | #endif |