Commit be88f08f authored by Albert Astals Cid's avatar Albert Astals Cid
parent 038c604a
......@@ -136,7 +136,8 @@ void AddItemTask::triggerSearchJob(KIMAP::Session *session)
} else {
search->addSearchCriteria(KIMAP::SearchJob::New);
UidNextAttribute *uidNext = collection().attribute<UidNextAttribute>();
Akonadi::Collection c = collection();
UidNextAttribute *uidNext = c.attribute<UidNextAttribute>();
if (!uidNext) {
cancelTask(i18n("Could not determine the UID for the newly created message on the server"));
search->deleteLater();
......
......@@ -63,7 +63,7 @@ void ChangeCollectionTask::doStart(KIMAP::Session *session)
m_pendingJobs = 0;
if (parts().contains("AccessRights")) {
Akonadi::ImapAclAttribute *aclAttribute = collection().attribute<Akonadi::ImapAclAttribute>();
Akonadi::ImapAclAttribute *aclAttribute = m_collection.attribute<Akonadi::ImapAclAttribute>();
if (aclAttribute == Q_NULLPTR) {
emitWarning(i18n("ACLs for '%1' need to be retrieved from the IMAP server first. Skipping ACL change",
......@@ -128,8 +128,9 @@ void ChangeCollectionTask::doStart(KIMAP::Session *session)
}
if (parts().contains("collectionannotations") && serverSupportsAnnotations()) {
Akonadi::Collection c = collection();
Akonadi::CollectionAnnotationsAttribute *annotationsAttribute =
collection().attribute<Akonadi::CollectionAnnotationsAttribute>();
c.attribute<Akonadi::CollectionAnnotationsAttribute>();
if (annotationsAttribute) { // No annotations it seems... server is lieing to us?
QMap<QByteArray, QByteArray> annotations = annotationsAttribute->annotations();
......@@ -163,7 +164,8 @@ void ChangeCollectionTask::doStart(KIMAP::Session *session)
}
if (parts().contains("imapacl")) {
Akonadi::ImapAclAttribute *aclAttribute = collection().attribute<Akonadi::ImapAclAttribute>();
Akonadi::Collection c = collection();
Akonadi::ImapAclAttribute *aclAttribute = c.attribute<Akonadi::ImapAclAttribute>();
if (aclAttribute) {
const QMap<QByteArray, KIMAP::Acl::Rights> rights = aclAttribute->rights();
......
......@@ -217,7 +217,8 @@ void MoveItemsTask::onPreSearchSelectDone(KJob *job)
search->setSearchLogic(KIMAP::SearchJob::And);
search->addSearchCriteria(KIMAP::SearchJob::New);
UidNextAttribute *uidNext = targetCollection().attribute<UidNextAttribute>();
Akonadi::Collection c = targetCollection();
UidNextAttribute *uidNext = c.attribute<UidNextAttribute>();
if (!uidNext) {
cancelTask(i18n("Could not determine the UID for the newly created message on the server"));
search->deleteLater();
......
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