Commit d70c72cb authored by Shashwat Jolly's avatar Shashwat Jolly

Minor refactor

setupItems doesn't need to take a new Akonadi item by reference - simply creating it inside the function is good.
parent dc3dec0c
......@@ -99,18 +99,16 @@ void EntriesFetchJob::fetchEntries()
setErrorText(QString::fromUtf8(err));
}
Item item;
for (uintptr_t i = 0; i < dataLength; i++) {
mClientState->saveEtebaseItemCache(etesyncItems[i], mEtesyncCollection.get());
setupItem(item, etesyncItems[i], type);
setupItem(etesyncItems[i], type);
}
}
mCollection.setRemoteRevision(sToken);
}
void EntriesFetchJob::setupItem(Akonadi::Item &item, const EtebaseItem *etesyncItem, const QString &type)
void EntriesFetchJob::setupItem(const EtebaseItem *etesyncItem, const QString &type)
{
if (!etesyncItem) {
qCDebug(ETESYNC_LOG) << "Unable to setup item - etesyncItem is null";
......@@ -119,6 +117,8 @@ void EntriesFetchJob::setupItem(Akonadi::Item &item, const EtebaseItem *etesyncI
qCDebug(ETESYNC_LOG) << "Setting up item" << etebase_item_get_uid(etesyncItem);
Item item;
if (type == ETEBASE_COLLECTION_TYPE_ADDRESS_BOOK) {
item.setMimeType(KContacts::Addressee::mimeType());
} else if (type == ETEBASE_COLLECTION_TYPE_CALENDAR) {
......
......@@ -41,7 +41,7 @@ public:
protected:
void fetchEntries();
void setupItem(Akonadi::Item &item, const EtebaseItem *etesyncItem, const QString &type);
void setupItem(const EtebaseItem *etesyncItem, const QString &type);
private:
const EteSyncClientState *mClientState = nullptr;
......
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