Changeset View
Changeset View
Standalone View
Standalone View
runners/konsoleprofiles/konsoleprofiles.h
- This file was moved from runners/konsolesessions/konsolesessions.h.
Show All 11 Lines | |||||
12 | * GNU General Public License for more details | 12 | * GNU General Public License for more details | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef KONSOLESESSIONS_H | 20 | #ifndef KONSOLEPROFILES_H | ||
21 | #define KONSOLESESSIONS_H | 21 | #define KONSOLEPROFILES_H | ||
22 | 22 | | |||
23 | #include <KRunner/AbstractRunner> | 23 | #include <KRunner/AbstractRunner> | ||
24 | 24 | | |||
25 | class KDirWatch; | 25 | class KDirWatch; | ||
26 | 26 | | |||
27 | struct KonsoleProfileData | 27 | struct KonsoleProfileData | ||
28 | { | 28 | { | ||
29 | QString displayName; | 29 | QString displayName; | ||
30 | QString iconName; | 30 | QString iconName; | ||
31 | }; | 31 | }; | ||
32 | 32 | | |||
33 | Q_DECLARE_TYPEINFO(KonsoleProfileData, Q_MOVABLE_TYPE); | 33 | Q_DECLARE_TYPEINFO(KonsoleProfileData, Q_MOVABLE_TYPE); | ||
34 | 34 | | |||
35 | 35 | | |||
36 | class KonsoleSessions : public Plasma::AbstractRunner { | 36 | class KonsoleProfiles : public Plasma::AbstractRunner { | ||
37 | Q_OBJECT | 37 | Q_OBJECT | ||
38 | 38 | | |||
39 | public: | 39 | public: | ||
40 | KonsoleSessions( QObject *parent, const QVariantList& args ); | 40 | KonsoleProfiles( QObject *parent, const QVariantList& args ); | ||
41 | ~KonsoleSessions() override; | 41 | ~KonsoleProfiles() override; | ||
42 | 42 | | |||
43 | void match(Plasma::RunnerContext &context) override; | 43 | void match(Plasma::RunnerContext &context) override; | ||
44 | void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override; | 44 | void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override; | ||
45 | 45 | | |||
46 | private Q_SLOTS: | 46 | private Q_SLOTS: | ||
47 | void loadSessions(); | 47 | void loadProfiles(); | ||
48 | void slotPrepare(); | 48 | void slotPrepare(); | ||
49 | void slotTeardown(); | 49 | void slotTeardown(); | ||
50 | 50 | | |||
51 | private: | 51 | private: | ||
52 | KDirWatch* m_sessionWatch = nullptr; | 52 | KDirWatch* m_profileFilesWatch = nullptr; | ||
53 | 53 | | |||
54 | QHash<QString, KonsoleProfileData> m_sessions; | 54 | QHash<QString, KonsoleProfileData> m_profiles; | ||
55 | }; | 55 | }; | ||
56 | 56 | | |||
57 | #endif | 57 | #endif |