Commit 8917e6e3 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Revert clang-format changes to templates

They havve the same file extansion as cpp/h files, but
clang-format would mess up the template macros.
parent dfed8b3c
DisableFormat: true
SortIncludes: false
......@@ -6,37 +6,38 @@
#include "%{APPNAMELC}resource.h"
#include "debug.h"
#include "settings.h"
#include "settingsadaptor.h"
#include "debug.h"
#include <QDBusConnection>
using namespace Akonadi;
% {APPNAME} Resource::
% {APPNAME} Resource(const QString &id)
%{APPNAME}Resource::%{APPNAME}Resource(const QString &id)
: ResourceBase(id)
{
new SettingsAdaptor(Settings::self());
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"), Settings::self(), QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
Settings::self(),
QDBusConnection::ExportAdaptors);
// TODO: you can put any resource specific initialization code here.
qCDebug(log_ % {APPNAMELC} resource) << "Resource started";
qCDebug(log_%{APPNAMELC}resource) << "Resource started";
}
% {APPNAME} Resource::~ % {APPNAME} Resource()
%{APPNAME}Resource::~%{APPNAME}Resource()
{
}
void % {APPNAME} Resource::retrieveCollections()
void %{APPNAME}Resource::retrieveCollections()
{
// TODO: this method is called when Akonadi wants to have all the
// collections your resource provides.
// Be sure to set the remote ID and the content MIME types
}
void % {APPNAME} Resource::retrieveItems(const Akonadi::Collection &collection)
void %{APPNAME}Resource::retrieveItems(const Akonadi::Collection &collection)
{
// TODO: this method is called when Akonadi wants to know about all the
// items in the given collection. You can but don't have to provide all the
......@@ -45,7 +46,7 @@ void % {APPNAME} Resource::retrieveItems(const Akonadi::Collection &collection)
// different ways to tell Akonadi when you are done.
}
bool % {APPNAME} Resource::retrieveItem(const Akonadi::Item &item, const QSet<QByteArray> &parts)
bool %{APPNAME}Resource::retrieveItem(const Akonadi::Item &item, const QSet<QByteArray> &parts)
{
// TODO: this method is called when Akonadi wants more data for a given item.
// You can only provide the parts that have been requested but you are allowed
......@@ -54,13 +55,13 @@ bool % {APPNAME} Resource::retrieveItem(const Akonadi::Item &item, const QSet<QB
return true;
}
void % {APPNAME} Resource::aboutToQuit()
void %{APPNAME}Resource::aboutToQuit()
{
// TODO: any cleanup you need to do while there is still an active
// event loop. The resource will terminate after this method returns
}
void % {APPNAME} Resource::configure(WId windowId)
void %{APPNAME}Resource::configure(WId windowId)
{
// TODO: this method is usually called when a new resource is being
// added to the Akonadi setup. You can do any kind of user interaction here,
......@@ -74,7 +75,7 @@ void % {APPNAME} Resource::configure(WId windowId)
// the user canceled the dialog, configurationDialogRejected() has to be emitted.
}
void % {APPNAME} Resource::itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection)
void %{APPNAME}Resource::itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection)
{
// TODO: this method is called when somebody else, e.g. a client application,
// has created an item in a collection managed by your resource.
......@@ -83,7 +84,7 @@ void % {APPNAME} Resource::itemAdded(const Akonadi::Item &item, const Akonadi::C
// of this template code to keep it simple
}
void % {APPNAME} Resource::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts)
void %{APPNAME}Resource::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts)
{
// TODO: this method is called when somebody else, e.g. a client application,
// has changed an item managed by your resource.
......@@ -92,7 +93,7 @@ void % {APPNAME} Resource::itemChanged(const Akonadi::Item &item, const QSet<QBy
// of this template code to keep it simple
}
void % {APPNAME} Resource::itemRemoved(const Akonadi::Item &item)
void %{APPNAME}Resource::itemRemoved(const Akonadi::Item &item)
{
// TODO: this method is called when somebody else, e.g. a client application,
// has deleted an item managed by your resource.
......@@ -101,4 +102,4 @@ void % {APPNAME} Resource::itemRemoved(const Akonadi::Item &item)
// of this template code to keep it simple
}
AKONADI_RESOURCE_MAIN(% {APPNAME} Resource)
AKONADI_RESOURCE_MAIN(%{APPNAME}Resource)
......@@ -4,18 +4,19 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef % {APPNAMEUC } RESOURCE_H
#define % {APPNAMEUC } RESOURCE_H
#ifndef %{APPNAMEUC}RESOURCE_H
#define %{APPNAMEUC}RESOURCE_H
#include <AkonadiAgentBase/ResourceBase>
class % {APPNAME} Resource : public Akonadi::ResourceBase, public Akonadi::AgentBase::Observer
class %{APPNAME}Resource : public Akonadi::ResourceBase,
public Akonadi::AgentBase::Observer
{
Q_OBJECT
public:
explicit % {APPNAME} Resource(const QString &id);
~ % {APPNAME} Resource() override;
explicit %{APPNAME}Resource(const QString &id);
~%{APPNAME}Resource() override;
public Q_SLOTS:
void configure(WId windowId) override;
......
......@@ -10,11 +10,7 @@
using namespace Akonadi;
bool SerializerPlugin %
{
APPNAME
}
::deserialize(Item &item, const QByteArray &label, QIODevice &data, int version)
bool SerializerPlugin%{APPNAME}::deserialize(Item &item, const QByteArray &label, QIODevice &data, int version)
{
Q_UNUSED(item)
Q_UNUSED(label)
......@@ -26,11 +22,7 @@ bool SerializerPlugin %
return false;
}
void SerializerPlugin %
{
APPNAME
}
::serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version)
void SerializerPlugin%{APPNAME}::serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version)
{
Q_UNUSED(item)
Q_UNUSED(label)
......@@ -40,11 +32,7 @@ void SerializerPlugin %
// TODO Implement this
}
QSet<QByteArray> SerializerPlugin %
{
APPNAME
}
::parts(const Item &item) const
QSet<QByteArray> SerializerPlugin%{APPNAME}::parts(const Item &item) const
{
// only need to reimplement this when implementing partial serialization
// i.e. when using the "label" parameter of the other two methods
......
......@@ -4,8 +4,8 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef AKONADI_SERIALIZER_ % {APPNAMEUC } _H
#define AKONADI_SERIALIZER_ % {APPNAMEUC} _H
#ifndef AKONADI_SERIALIZER_%{APPNAMEUC}_H
#define AKONADI_SERIALIZER_%{APPNAMEUC}_H
#include <QObject>
......@@ -13,14 +13,16 @@
namespace Akonadi
{
class SerializerPlugin % {APPNAME} : public QObject, public ItemSerializerPlugin
class SerializerPlugin%{APPNAME} : public QObject
, public ItemSerializerPlugin
{
Q_OBJECT
Q_INTERFACES(Akonadi::ItemSerializerPlugin)
Q_PLUGIN_METADATA(IID "org.kde.akonadi.SerializerPlugin%{APPNAME}")
public:
bool deserialize(Item & item, const QByteArray &label, QIODevice &data, int version) override;
bool deserialize(Item &item, const QByteArray &label, QIODevice &data, int version) override;
void serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version) override;
QSet<QByteArray> parts(const Item &item) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment