Changeset View
Changeset View
Standalone View
Standalone View
agents/unifiedmailboxagent/unifiedmailboxmanager.cpp
Show First 20 Lines • Show All 382 Lines • ▼ Show 20 Line(s) | 382 | #else | |||
---|---|---|---|---|---|
383 | list->fetchScope().setResource(Common::AgentIdentifier); | 383 | list->fetchScope().setResource(Common::AgentIdentifier); | ||
384 | #endif | 384 | #endif | ||
385 | connect(list, &Akonadi::CollectionFetchJob::collectionsReceived, | 385 | connect(list, &Akonadi::CollectionFetchJob::collectionsReceived, | ||
386 | this, [this](const Akonadi::Collection::List &list) { | 386 | this, [this](const Akonadi::Collection::List &list) { | ||
387 | for (const auto &col : list) { | 387 | for (const auto &col : list) { | ||
388 | if (!isUnifiedMailbox(col) || col.parentCollection() == Akonadi::Collection::root()) { | 388 | if (!isUnifiedMailbox(col) || col.parentCollection() == Akonadi::Collection::root()) { | ||
389 | continue; | 389 | continue; | ||
390 | } | 390 | } | ||
391 | 391 | const auto it = mMailboxes.find(col.name()); | |||
392 | mMailboxes.at(col.name())->setCollectionId(col.id()); | 392 | if (it == mMailboxes.end()) { | ||
393 | qCWarning(UNIFIEDMAILBOXAGENT_LOG) << "Failed to find an unified mailbox for source collection" << col.id(); | ||||
394 | } else { | ||||
395 | it->second->setCollectionId(col.id()); | ||||
396 | } | ||||
mlaurent: We don't use exception in kde apps in general
why don't use
std… | |||||
Normally i would do that too. But there is a similar try-catch block in the function UnifiedMailboxManager::createDefaultBoxes. I just wanted to follow the coding style already used. jaham: Normally i would do that too. But there is a similar try-catch block in the function… | |||||
jaham: Do you still want me to change it? | |||||
393 | } | 397 | } | ||
394 | }); | 398 | }); | ||
395 | if (finishedCb) { | 399 | if (finishedCb) { | ||
396 | connect(list, &Akonadi::CollectionFetchJob::result, this, finishedCb); | 400 | connect(list, &Akonadi::CollectionFetchJob::result, this, finishedCb); | ||
397 | } | 401 | } | ||
398 | } | 402 | } | ||
399 | 403 | | |||
400 | const UnifiedMailbox *UnifiedMailboxManager::registerSpecialSourceCollection(const Akonadi::Collection &col) | 404 | const UnifiedMailbox *UnifiedMailboxManager::registerSpecialSourceCollection(const Akonadi::Collection &col) | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
We don't use exception in kde apps in general
why don't use