File indexing completed on 2024-11-24 04:43:50

0001 /*
0002     SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "ewsfetchtaskdetailjob.h"
0008 
0009 #include "ewsgetitemrequest.h"
0010 #include "ewsitemshape.h"
0011 #include "ewsresource_debug.h"
0012 
0013 using namespace Akonadi;
0014 
0015 EwsFetchTaskDetailJob::EwsFetchTaskDetailJob(EwsClient &client, QObject *parent, const Akonadi::Collection &collection)
0016     : EwsFetchItemDetailJob(client, parent, collection)
0017 {
0018     EwsItemShape shape(EwsShapeIdOnly);
0019     mRequest->setItemShape(shape);
0020 }
0021 
0022 EwsFetchTaskDetailJob::~EwsFetchTaskDetailJob() = default;
0023 
0024 void EwsFetchTaskDetailJob::processItems(const EwsGetItemRequest::Response::List &responses)
0025 {
0026     Item::List::iterator it = mChangedItems.begin();
0027 
0028     for (const EwsGetItemRequest::Response &resp : responses) {
0029         Item &item = *it;
0030 
0031         if (!resp.isSuccess()) {
0032             qCWarningNC(EWSRES_LOG) << QStringLiteral("Failed to fetch item %1").arg(item.remoteId());
0033             continue;
0034         }
0035 
0036         // const EwsItem &ewsItem = resp.item();
0037 
0038         // TODO: Implement
0039 
0040         ++it;
0041     }
0042 
0043     emitResult();
0044 }
0045 
0046 #include "moc_ewsfetchtaskdetailjob.cpp"