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

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 "ewsfetchabchpersondetailjob.h"
0008 
0009 #include "ewsgetitemrequest.h"
0010 #include "ewsitemshape.h"
0011 #include "ewsmailbox.h"
0012 #include "ewsresource_debug.h"
0013 
0014 using namespace Akonadi;
0015 
0016 EwsFetchAbchContactDetailsJob::EwsFetchAbchContactDetailsJob(EwsClient &client, QObject *parent, const Akonadi::Collection &collection)
0017     : EwsFetchItemDetailJob(client, parent, collection)
0018 {
0019     EwsItemShape shape(EwsShapeIdOnly);
0020     mRequest->setItemShape(shape);
0021 }
0022 
0023 EwsFetchAbchContactDetailsJob::~EwsFetchAbchContactDetailsJob() = default;
0024 
0025 void EwsFetchAbchContactDetailsJob::processItems(const EwsGetItemRequest::Response::List &responses)
0026 {
0027     Item::List::iterator it = mChangedItems.begin();
0028 
0029     for (const EwsGetItemRequest::Response &resp : responses) {
0030         Item &item = *it;
0031 
0032         if (!resp.isSuccess()) {
0033             qCWarningNC(EWSRES_LOG) << QStringLiteral("Failed to fetch item %1").arg(item.remoteId());
0034             continue;
0035         }
0036 
0037         // const EwsItem &ewsItem = resp.item();
0038 
0039         // TODO: Implement
0040 
0041         ++it;
0042     }
0043 
0044     emitResult();
0045 }
0046 
0047 #include "moc_ewsfetchabchpersondetailjob.cpp"