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