From ee9428a0844c0262223efa097c3f3a258b38e56b Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 20 Mar 2018 07:05:27 +0100 Subject: [PATCH] Don't assign invalid collection. When kmail start CommonKernel can not be initialized => CommonKernel->sentCollectionFolder(); is invalid. => we can see correct collection in combobox but void ComposerViewBase::slotFccCollectionCheckResult(KJob *job) return an error => change to default collection name. But found by David (cherry picked from commit 574f5864307beb540aa10034ad284878bfb5ce5a) --- src/editor/kmcomposerwin.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/editor/kmcomposerwin.cpp b/src/editor/kmcomposerwin.cpp index a643b6f6f..1a884b25d 100644 --- a/src/editor/kmcomposerwin.cpp +++ b/src/editor/kmcomposerwin.cpp @@ -619,6 +619,7 @@ void KMComposerWin::readConfig(bool reload /* = false */) if (!ident.fcc().isEmpty()) { fccName = ident.fcc(); } + qDebug() <<" fccName" << fccName; setFcc(fccName); } @@ -1618,6 +1619,7 @@ void KMComposerWin::setMessage(const KMime::Message::Ptr &newMsg, bool lastSignS if (auto hdr = mMsg->headerByType("X-KMail-Fcc")) { kmailFcc = hdr->asUnicodeString(); } + qDebug() << "sssssssssssssssssssssssssss22222222" << kmailFcc; if (kmailFcc.isEmpty()) { setFcc(ident.fcc()); } else { @@ -1703,9 +1705,10 @@ void KMComposerWin::setFcc(const QString &idString) } else { col = Akonadi::Collection(idString.toLongLong()); } - - mComposerBase->setFcc(col); - mFccFolder->setCollection(col); + if (col.isValid()) { + mComposerBase->setFcc(col); + mFccFolder->setCollection(col); + } } bool KMComposerWin::isComposerModified() const