GrantleeTheme

grantleethemeengine.cpp
1 /*
2  SPDX-FileCopyrightText: 2016 Daniel Vr├ítil <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6 
7 #include "grantleethemeengine.h"
8 #include "grantleeki18nlocalizer.h"
9 
10 #include <config-grantleetheme.h>
11 
12 using namespace GrantleeTheme;
13 
14 class GrantleeTheme::EnginePrivate
15 {
16 public:
17  EnginePrivate() = default;
18 
19  ~EnginePrivate() = default;
20 
22 };
23 
24 Engine::Engine(QObject *parent)
25 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
26  : Grantlee::Engine(parent)
27 #else
28  : KTextTemplate::Engine(parent)
29 #endif
30  , d(new GrantleeTheme::EnginePrivate)
31 {
32  addPluginPath(QStringLiteral(GRANTLEE_PLUGIN_INSTALL_DIR));
33 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
34  addDefaultLibrary(QStringLiteral("grantlee_i18ntags"));
35 #else
36  addDefaultLibrary(QStringLiteral("ktexttemplate_i18ntags"));
37 #endif
38  addDefaultLibrary(QStringLiteral("kde_grantlee_plugin"));
39  addDefaultLibrary(QStringLiteral("grantlee_scriptabletags"));
40  setSmartTrimEnabled(true);
41 }
42 
43 Engine::~Engine() = default;
44 
45 QSharedPointer<GrantleeKi18nLocalizer> Engine::localizer() const
46 {
47  auto loc = d->localizer.toStrongRef();
48  if (!loc) {
49  loc.reset(new GrantleeKi18nLocalizer());
50  d->localizer = loc.toWeakRef();
51  }
52  return loc;
53 }
The GrantleeKi18nLocalizer class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Sep 28 2022 04:06:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.