GIT_SILENT Fix formatting for templates

This commit is contained in:
Alexander Lohnau 2021-03-13 21:52:20 +01:00
parent c7c0146cc6
commit 9b7b38004e
No known key found for this signature in database
GPG Key ID: 6C45BA731AA2ED36
7 changed files with 29 additions and 35 deletions

2
templates/.clang-format Normal file
View File

@ -0,0 +1,2 @@
DisableFormat: true
SortIncludes: false

View File

@ -6,32 +6,21 @@
#include "%{APPNAMELC}.h"
#include <KLocalizedString>
%
{
APPNAME
}
::
% {APPNAME}(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args)
, m_nativeText(i18n("Text coming from C++ plugin")){}
%
{
APPNAME
}
::~ % {APPNAME}()
%{APPNAME}::%{APPNAME}(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args),
m_nativeText(i18n("Text coming from C++ plugin"))
{
}
QString %
%{APPNAME}::~%{APPNAME}()
{
APPNAME
}
::nativeText() const
QString %{APPNAME}::nativeText() const
{
return m_nativeText;
}
K_EXPORT_PLASMA_APPLET_WITH_JSON(% {APPNAMELC}, % {APPNAME}, "metadata.json")
K_EXPORT_PLASMA_APPLET_WITH_JSON(%{APPNAMELC}, %{APPNAME}, "metadata.json")
#include "%{APPNAMELC}.moc"

View File

@ -3,19 +3,20 @@
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef % {APPNAMEUC } _H
#define % {APPNAMEUC } _H
#ifndef %{APPNAMEUC}_H
#define %{APPNAMEUC}_H
#include <Plasma/Applet>
class % {APPNAME} : public Plasma::Applet
class %{APPNAME} : public Plasma::Applet
{
Q_OBJECT
Q_PROPERTY(QString nativeText READ nativeText CONSTANT)
public:
% {APPNAME}(QObject * parent, const QVariantList &args);
~ % {APPNAME}();
%{APPNAME}( QObject *parent, const QVariantList &args );
~%{APPNAME}();
QString nativeText() const;

View File

@ -9,10 +9,10 @@
#include <KLocalizedString>
// Qt
#include <QJSEngine>
#include <QQmlContext>
#include <QQmlEngine>
#include <QQmlContext>
static QJSValue singletonTypeExampleProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
static QJSValue singletonTypeExampleProvider(QQmlEngine* engine, QJSEngine* scriptEngine)
{
Q_UNUSED(engine)
@ -21,7 +21,8 @@ static QJSValue singletonTypeExampleProvider(QQmlEngine *engine, QJSEngine *scri
return helloWorld;
}
void % {APPNAME} Plugin::registerTypes(const char *uri)
void %{APPNAME}Plugin::registerTypes(const char* uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.%{APPNAMELC}"));

View File

@ -3,12 +3,12 @@
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef % {APPNAMEUC } PLUGIN_H
#define % {APPNAMEUC } PLUGIN_H
#ifndef %{APPNAMEUC}PLUGIN_H
#define %{APPNAMEUC}PLUGIN_H
#include <QQmlExtensionPlugin>
class % {APPNAME} Plugin : public QQmlExtensionPlugin
class %{APPNAME}Plugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")

View File

@ -9,10 +9,10 @@
#include <KLocalizedString>
// Qt
#include <QJSEngine>
#include <QQmlContext>
#include <QQmlEngine>
#include <QQmlContext>
static QJSValue singletonTypeExampleProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
static QJSValue singletonTypeExampleProvider(QQmlEngine* engine, QJSEngine* scriptEngine)
{
Q_UNUSED(engine)
@ -21,7 +21,8 @@ static QJSValue singletonTypeExampleProvider(QQmlEngine *engine, QJSEngine *scri
return helloWorld;
}
void % {APPNAME} Plugin::registerTypes(const char *uri)
void %{APPNAME}Plugin::registerTypes(const char* uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.%{APPNAMELC}"));

View File

@ -3,12 +3,12 @@
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef % {APPNAMEUC } PLUGIN_H
#define % {APPNAMEUC } PLUGIN_H
#ifndef %{APPNAMEUC}PLUGIN_H
#define %{APPNAMEUC}PLUGIN_H
#include <QQmlExtensionPlugin>
class % {APPNAME} Plugin : public QQmlExtensionPlugin
class %{APPNAME}Plugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")