Branch 'kolab/integration/4.13.0' - incidenceeditor-ng/individualmailcomponentfactory.cpp incidenceeditor-ng/opencomposerjob.cpp

Sandro Knauß knauss at kolabsys.com
Mon Aug 25 18:57:56 CEST 2014


 incidenceeditor-ng/individualmailcomponentfactory.cpp |    4 ++--
 incidenceeditor-ng/opencomposerjob.cpp                |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9e8077f5064b6136573acb282077e8d82fbeb43f
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Mon Aug 25 18:54:03 2014 +0200

    Make OpenComposer not crash.
    
    Bug-Kolab: #3030

diff --git a/incidenceeditor-ng/individualmailcomponentfactory.cpp b/incidenceeditor-ng/individualmailcomponentfactory.cpp
index 343ff9f..fec1f09 100644
--- a/incidenceeditor-ng/individualmailcomponentfactory.cpp
+++ b/incidenceeditor-ng/individualmailcomponentfactory.cpp
@@ -89,6 +89,7 @@ void IndividualMessageQueueJob::startQueueJob(const QStringList &to, const QStri
     msg->cc()->fromUnicodeString(cc.join(QLatin1String(", ")), "utf-8");
     msg->assemble();
 
+    mQueueJob = new MailTransport::MessageQueueJob(this);
     mQueueJob->setMessage(msg);
     mQueueJob->transportAttribute().setTransportId(transportAttribute().transportId());
     mQueueJob->sentBehaviourAttribute().setSentBehaviour(sentBehaviourAttribute().sentBehaviour());
@@ -97,7 +98,6 @@ void IndividualMessageQueueJob::startQueueJob(const QStringList &to, const QStri
     mQueueJob->addressAttribute().setCc(cc);
     mQueueJob->addressAttribute().setBcc(addressAttribute().bcc());
 
-    mQueueJob = new MailTransport::MessageQueueJob(this);
     connect(mQueueJob, SIGNAL(finished(KJob*)), SLOT(handleJobFinished(KJob*)));
     mQueueJob->start();
 }
@@ -115,7 +115,7 @@ void IndividualMessageQueueJob::handleJobFinished(KJob *job)
         if (job == mQueueJob && mComposerJob) {
             mComposerJob->kill();
             mComposerJob = 0;
-        } else if (mComposerJob) {
+        } else if (job == mComposerJob && mQueueJob) {
             mQueueJob->kill();
             mQueueJob = 0;
         }
diff --git a/incidenceeditor-ng/opencomposerjob.cpp b/incidenceeditor-ng/opencomposerjob.cpp
index 14199af..06164f9 100644
--- a/incidenceeditor-ng/opencomposerjob.cpp
+++ b/incidenceeditor-ng/opencomposerjob.cpp
@@ -52,7 +52,7 @@ void OpenComposerJob::start()
 {
     mSuccess = false;
     if (QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kmail"))) {
-        processMail();
+        QMetaObject::invokeMethod(this, "processMail", Qt::QueuedConnection);
     }
     //Check if Kontact is already running and if not ...
     int result = KDBusServiceStarter::self()->findServiceFor(QLatin1String("DBUS/Mailer"), QString(),




More information about the commits mailing list