Commit 1ca2dfff authored by Krzysztof Nowicki's avatar Krzysztof Nowicki Committed by Laurent Montel
Browse files

Use QVector instead of QList in Ews{Get,Update}ItemRequest


Signed-off-by: Krzysztof Nowicki's avatarKrzysztof Nowicki <krissn@op.pl>
parent dd318f7e
......@@ -24,7 +24,7 @@ EwsFetchAbchContactDetailsJob::~EwsFetchAbchContactDetailsJob()
{
}
void EwsFetchAbchContactDetailsJob::processItems(const QList<EwsGetItemRequest::Response> &responses)
void EwsFetchAbchContactDetailsJob::processItems(const EwsGetItemRequest::Response::List &responses)
{
Item::List::iterator it = mChangedItems.begin();
......
......@@ -16,6 +16,6 @@ public:
~EwsFetchAbchContactDetailsJob() override;
protected:
void processItems(const QList<EwsGetItemRequest::Response> &responses) override;
void processItems(const EwsGetItemRequest::Response::List &responses) override;
};
......@@ -63,7 +63,7 @@ EwsFetchCalendarDetailJob::~EwsFetchCalendarDetailJob()
{
}
void EwsFetchCalendarDetailJob::processItems(const QList<EwsGetItemRequest::Response> &responses)
void EwsFetchCalendarDetailJob::processItems(const EwsGetItemRequest::Response::List &responses)
{
Item::List::iterator it = mChangedItems.begin();
KCalendarCore::ICalFormat format;
......
......@@ -16,7 +16,7 @@ public:
~EwsFetchCalendarDetailJob() override;
protected:
void processItems(const QList<EwsGetItemRequest::Response> &responses) override;
void processItems(const EwsGetItemRequest::Response::List &responses) override;
private Q_SLOTS:
void exceptionItemsFetched(KJob *job);
};
......
......@@ -23,7 +23,7 @@ EwsFetchContactDetailJob::~EwsFetchContactDetailJob()
{
}
void EwsFetchContactDetailJob::processItems(const QList<EwsGetItemRequest::Response> &responses)
void EwsFetchContactDetailJob::processItems(const EwsGetItemRequest::Response::List &responses)
{
Item::List::iterator it = mChangedItems.begin();
......
......@@ -16,6 +16,6 @@ public:
~EwsFetchContactDetailJob() override;
protected:
void processItems(const QList<EwsGetItemRequest::Response> &responses) override;
void processItems(const EwsGetItemRequest::Response::List &responses) override;
};
......@@ -58,6 +58,7 @@ void EwsGetItemRequest::start()
bool EwsGetItemRequest::parseResult(QXmlStreamReader &reader)
{
mResponses.reserve(mIds.size());
return parseResponseMessage(reader, QStringLiteral("GetItem"), [this](QXmlStreamReader &reader) {
return parseItemsResponse(reader);
});
......
......@@ -6,7 +6,7 @@
#pragma once
#include <QList>
#include <QVector>
#include "ewsitem.h"
#include "ewsitemshape.h"
......@@ -20,6 +20,8 @@ public:
class Response : public EwsRequest::Response
{
public:
typedef QVector<Response> List;
explicit Response(QXmlStreamReader &reader);
bool parseItems(QXmlStreamReader &reader);
const EwsItem &item() const
......@@ -39,7 +41,7 @@ public:
void start() override;
const QList<Response> &responses() const
const Response::List &responses() const
{
return mResponses;
}
......@@ -51,6 +53,6 @@ protected:
private:
EwsId::List mIds;
EwsItemShape mShape;
QList<Response> mResponses;
Response::List mResponses;
};
......@@ -89,6 +89,7 @@ void EwsUpdateItemRequest::start()
bool EwsUpdateItemRequest::parseResult(QXmlStreamReader &reader)
{
mResponses.reserve(mChanges.size());
return parseResponseMessage(reader, QStringLiteral("UpdateItem"), [this](QXmlStreamReader &reader) {
return parseItemsResponse(reader);
});
......
......@@ -6,8 +6,8 @@
#pragma once
#include <QList>
#include <QSharedPointer>
#include <QVector>
#include "ewsitem.h"
#include "ewsitemshape.h"
......@@ -76,6 +76,8 @@ public:
class ItemChange
{
public:
typedef QVector<ItemChange> List;
ItemChange(const EwsId &itemId, EwsItemType type)
: mId(itemId)
, mType(type)
......@@ -92,12 +94,14 @@ public:
private:
EwsId mId;
EwsItemType mType;
QList<QSharedPointer<const Update>> mUpdates;
QVector<QSharedPointer<const Update>> mUpdates;
};
class Response : public EwsRequest::Response
{
public:
typedef QVector<Response> List;
const EwsId &itemId() const
{
return mId;
......@@ -147,7 +151,7 @@ public:
void start() override;
const QList<Response> &responses() const
const Response::List &responses() const
{
return mResponses;
}
......@@ -157,11 +161,11 @@ protected:
bool parseItemsResponse(QXmlStreamReader &reader);
private:
QList<ItemChange> mChanges;
ItemChange::List mChanges;
EwsMessageDisposition mMessageDisp;
EwsConflictResolution mConflictResol;
EwsMeetingDisposition mMeetingDisp;
EwsId mSavedFolderId;
QList<Response> mResponses;
Response::List mResponses;
};
......@@ -34,7 +34,7 @@ public:
void start() override;
protected:
virtual void processItems(const QList<EwsGetItemRequest::Response> &responses) = 0;
virtual void processItems(const EwsGetItemRequest::Response::List &responses) = 0;
QPointer<EwsGetItemRequest> mRequest;
Akonadi::Item::List mChangedItems;
......
......@@ -50,7 +50,7 @@ EwsFetchMailDetailJob::~EwsFetchMailDetailJob()
{
}
void EwsFetchMailDetailJob::processItems(const QList<EwsGetItemRequest::Response> &responses)
void EwsFetchMailDetailJob::processItems(const EwsGetItemRequest::Response::List &responses)
{
Item::List::iterator it = mChangedItems.begin();
......
......@@ -16,6 +16,6 @@ public:
~EwsFetchMailDetailJob() override;
protected:
void processItems(const QList<EwsGetItemRequest::Response> &responses) override;
void processItems(const EwsGetItemRequest::Response::List &responses) override;
};
......@@ -24,7 +24,7 @@ EwsFetchTaskDetailJob::~EwsFetchTaskDetailJob()
{
}
void EwsFetchTaskDetailJob::processItems(const QList<EwsGetItemRequest::Response> &responses)
void EwsFetchTaskDetailJob::processItems(const EwsGetItemRequest::Response::List &responses)
{
Item::List::iterator it = mChangedItems.begin();
......
......@@ -16,6 +16,6 @@ public:
~EwsFetchTaskDetailJob() override;
protected:
void processItems(const QList<EwsGetItemRequest::Response> &responses) override;
void processItems(const EwsGetItemRequest::Response::List &responses) override;
};
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