Changeset View
Changeset View
Standalone View
Standalone View
runners/datetime/datetimerunner.h
Show All 14 Lines | |||||
15 | * Free Software Foundation, Inc., | 15 | * Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #ifndef DATETIMERUNNER_H | 19 | #ifndef DATETIMERUNNER_H | ||
20 | #define DATETIMERUNNER_H | 20 | #define DATETIMERUNNER_H | ||
21 | 21 | | |||
22 | #include <QDateTime> | 22 | #include <QDateTime> | ||
23 | #include <QTimeZone> | ||||
23 | 24 | | |||
24 | #include <KRunner/AbstractRunner> | 25 | #include <KRunner/AbstractRunner> | ||
25 | #include <KRunner/QueryMatch> | 26 | #include <KRunner/QueryMatch> | ||
26 | 27 | | |||
27 | /** | 28 | /** | ||
28 | * This class looks for matches in the set of .desktop files installed by | 29 | * This class looks for matches in the set of .desktop files installed by | ||
29 | * applications. This way the user can type exactly what they see in the | 30 | * applications. This way the user can type exactly what they see in the | ||
30 | * applications menu and have it start the appropriate app. Essentially anything | 31 | * applications menu and have it start the appropriate app. Essentially anything | ||
31 | * that KService knows about, this runner can launch | 32 | * that KService knows about, this runner can launch | ||
32 | */ | 33 | */ | ||
33 | 34 | | |||
34 | class DateTimeRunner : public Plasma::AbstractRunner | 35 | class DateTimeRunner : public Plasma::AbstractRunner | ||
35 | { | 36 | { | ||
36 | Q_OBJECT | 37 | Q_OBJECT | ||
37 | 38 | | |||
38 | public: | 39 | public: | ||
39 | DateTimeRunner(QObject *parent, const QVariantList &args); | 40 | DateTimeRunner(QObject *parent, const QVariantList &args); | ||
40 | ~DateTimeRunner() override; | 41 | ~DateTimeRunner() override; | ||
41 | 42 | | |||
42 | void match(Plasma::RunnerContext &context) override; | 43 | void match(Plasma::RunnerContext &context) override; | ||
43 | 44 | | |||
44 | private: | 45 | private: | ||
45 | QHash<QString, QDateTime> datetime(const QStringRef &tz); | 46 | QMultiHash<QString, QTimeZone> timeZoneMatches(QString tz); | ||
46 | void addMatch(const QString &text, const QString &clipboardText, | 47 | void addMatch(const QString &text, const QString &clipboardText, | ||
47 | Plasma::RunnerContext &context, const QString& iconName); | 48 | Plasma::RunnerContext &context, const QString& iconName); | ||
48 | }; | 49 | }; | ||
49 | 50 | | |||
50 | #endif | 51 | #endif | ||
51 | 52 | |