KCalUtils

kcalendargrantleeplugin.cpp
1 /*
2  * SPDX-FileCopyrightText: 2015 Daniel Vr├ítil <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  */
7 
8 #include "kcalendargrantleeplugin.h"
9 #include "datetimefilters.h"
10 #include "icon.h"
11 
12 KCalendarGrantleePlugin::KCalendarGrantleePlugin(QObject *parent)
13  : QObject(parent)
14 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
15  , Grantlee::TagLibraryInterface()
16 #else
17  , KTextTemplate::TagLibraryInterface()
18 #endif
19 {
20 }
21 
22 KCalendarGrantleePlugin::~KCalendarGrantleePlugin()
23 {
24 }
25 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
26 QHash<QString, Grantlee::AbstractNodeFactory *> KCalendarGrantleePlugin::nodeFactories(const QString &name)
27 #else
28 QHash<QString, KTextTemplate::AbstractNodeFactory *> KCalendarGrantleePlugin::nodeFactories(const QString &name)
29 #endif
30 {
31  Q_UNUSED(name)
32 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
34 #else
36 #endif
37  nodeFactories[QStringLiteral("icon")] = new IconTag();
38 
39  return nodeFactories;
40 }
41 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
42 QHash<QString, Grantlee::Filter *> KCalendarGrantleePlugin::filters(const QString &name)
43 #else
44 QHash<QString, KTextTemplate::Filter *> KCalendarGrantleePlugin::filters(const QString &name)
45 #endif
46 {
47  Q_UNUSED(name)
48 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
50 #else
52 #endif
53  filters[QStringLiteral("kdate")] = new KDateFilter();
54  filters[QStringLiteral("ktime")] = new KTimeFilter();
55  filters[QStringLiteral("kdatetime")] = new KDateTimeFilter();
56 
57  return filters;
58 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:09:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.