Changeset View
Changeset View
Standalone View
Standalone View
shell/panelcountsource.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2019 Aleix Pol Gonzalez <aleixpol@kde.org> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU Library General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU Library General Public | ||||
15 | * License along with this program; if not, write to the | ||||
16 | * Free Software Foundation, Inc., | ||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | #ifndef PANELCOUNTSOURCE_H | ||||
21 | #define PANELCOUNTSOURCE_H | ||||
22 | | ||||
23 | #include "shellcorona.h" | ||||
24 | #include <KLocalizedString> | ||||
25 | #include <KUserFeedback/AbstractDataSource> | ||||
26 | | ||||
27 | class PanelCountSource : public KUserFeedback::AbstractDataSource | ||||
28 | { | ||||
29 | public: | ||||
30 | /*! Create a new start count data source. */ | ||||
31 | PanelCountSource(ShellCorona* corona) | ||||
32 | : AbstractDataSource(QStringLiteral("panelCount"), KUserFeedback::Provider::DetailedSystemInformation) | ||||
33 | , corona(corona) | ||||
34 | {} | ||||
35 | | ||||
36 | QString name() const override { return i18n("Panel Count"); } | ||||
37 | QString description() const override { return i18n("Counts the panels"); } | ||||
38 | | ||||
39 | QVariant data() override { return corona->panelCount(); } | ||||
40 | | ||||
41 | private: | ||||
42 | ShellCorona* const corona; | ||||
43 | }; | ||||
44 | | ||||
45 | #endif |