Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3e5a23f4 authored by Laurent Montel's avatar Laurent Montel 😁

Use const'ref

parent 554661ba
......@@ -22,7 +22,7 @@
using namespace KDAV;
QString translateErrorString(Error error)
QString translateErrorString(const Error &error)
{
QString result;
......
......@@ -21,6 +21,6 @@
#include <KDAV/DavError>
QString translateErrorString(KDAV::Error error);
QString translateErrorString(const KDAV::Error &error);
#endif
......@@ -40,7 +40,7 @@ public:
struct Item {
Item() : key(Ignore) {}
Item(T k, const QString &n, ReadFunction rfn = ReadFunction(), WriteFunction wfn = WriteFunction())
Item(T k, const QString &n, const ReadFunction &rfn = ReadFunction(), const WriteFunction &wfn = WriteFunction())
: key(k), elmName(n), readFn(rfn), writeFn(wfn) {}
T key;
QString elmName;
......@@ -90,7 +90,7 @@ public:
}
bool readItems(QXmlStreamReader &reader, const QString &nsUri,
UnknownElementFunction unknownElmFn = &defaultUnknownElmFunction)
const UnknownElementFunction &unknownElmFn = &defaultUnknownElmFunction)
{
QString elmName(reader.name().toString());
while (reader.readNextStartElement()) {
......
......@@ -37,7 +37,7 @@ EwsItemHandler::~EwsItemHandler()
{
}
void EwsItemHandler::registerItemHandler(EwsItemType type, ItemHandlerFactory factory)
void EwsItemHandler::registerItemHandler(EwsItemType type, const ItemHandlerFactory &factory)
{
handlerFactories->append({type, factory});
}
......
......@@ -57,7 +57,7 @@ public:
EwsTagStore *tagStore, EwsResource *parent) = 0;
typedef std::function<EwsItemHandler*()> ItemHandlerFactory;
static void registerItemHandler(EwsItemType type, ItemHandlerFactory factory);
static void registerItemHandler(EwsItemType type, const ItemHandlerFactory &factory);
static EwsItemHandler *itemHandler(EwsItemType type);
static EwsItemType mimeToItemType(const QString &mimeType);
static QHash<EwsPropertyField, QVariant> writeFlags(const QSet<QByteArray> &flags);
......
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