File use-plugin-for-sendlater.patch of Package kdepim4.openSUSE_Leap_42.2_Update

From 78c5552be2f00a4ac25bd77ca39386522fca70a8 Mon Sep 17 00:00:00 2001
From: Montel Laurent <montel@kde.org>
Date: Fri, 2 Jun 2017 13:59:02 +0200
Subject: Make sure that we use plugin when we use sendlater feature

---
 src/editor/kmcomposewin.cpp | 9 +++++----
 src/editor/kmcomposewin.h   | 3 ++-
 2 files changed, 7 insertions(+), 5 deletions(-)

Index: kdepim-4.14.10/kmail/editor/kmcomposewin.cpp
===================================================================
--- kdepim-4.14.10.orig/kmail/editor/kmcomposewin.cpp
+++ kdepim-4.14.10/kmail/editor/kmcomposewin.cpp
@@ -2533,7 +2533,7 @@ void KMComposeWin::printComposeResult( K
 
 
 void KMComposeWin::doSend( MessageComposer::MessageSender::SendMethod method,
-                           MessageComposer::MessageSender::SaveIn saveIn )
+                           MessageComposer::MessageSender::SaveIn saveIn, bool willSendItWithoutReediting )
 {
     if ( mStorageService->numProgressUpdateFile() > 0) {
         KMessageBox::sorry( this, i18np( "There is %1 file upload in progress.",
@@ -2549,7 +2549,7 @@ void KMComposeWin::doSend( MessageCompos
     }
 
 
-    if ( saveIn == MessageComposer::MessageSender::SaveInNone ) { // don't save as draft or template, send immediately
+    if ( saveIn == MessageComposer::MessageSender::SaveInNone || willSendItWithoutReediting ) { // don't save as draft or template, send immediately
         if ( KPIMUtils::firstEmailAddress( from() ).isEmpty() ) {
             if ( !( mShowHeaders & HDR_FROM ) ) {
                 mShowHeaders |= HDR_FROM;
@@ -2716,6 +2716,7 @@ void KMComposeWin::slotSendLater()
         return;
     if ( !checkRecipientNumber() )
         return;
+    mComposerBase->setSendLaterInfo(NULL);
     if ( mComposerBase->editor()->checkExternalEditorFinished() ) {
         const bool wasRegistered = (SendLater::SendLaterUtil::sentLaterAgentWasRegistered() && SendLater::SendLaterUtil::sentLaterAgentEnabled());
         if (wasRegistered) {
@@ -2739,9 +2740,9 @@ void KMComposeWin::slotSendLater()
                 {
                     mComposerBase->setSendLaterInfo(info);
                     if (info->isRecurrence()) {
-                        doSend( MessageComposer::MessageSender::SendLater, MessageComposer::MessageSender::SaveInTemplates );
+                        doSend( MessageComposer::MessageSender::SendLater, MessageComposer::MessageSender::SaveInTemplates, true );
                     } else {
-                        doSend( MessageComposer::MessageSender::SendLater, MessageComposer::MessageSender::SaveInDrafts );
+                        doSend( MessageComposer::MessageSender::SendLater, MessageComposer::MessageSender::SaveInDrafts, true );
                     }
                     break;
                 }
Index: kdepim-4.14.10/kmail/editor/kmcomposewin.h
===================================================================
--- kdepim-4.14.10.orig/kmail/editor/kmcomposewin.h
+++ kdepim-4.14.10/kmail/editor/kmcomposewin.h
@@ -549,7 +549,8 @@ private:
      * Send the message.
      */
     void doSend( MessageComposer::MessageSender::SendMethod method=MessageComposer::MessageSender::SendDefault,
-                 MessageComposer::MessageSender::SaveIn saveIn = MessageComposer::MessageSender::SaveInNone );
+                 MessageComposer::MessageSender::SaveIn saveIn = MessageComposer::MessageSender::SaveInNone,
+                 bool willSendItWithoutReediting = false);
 
     void doDelayedSend( MessageComposer::MessageSender::SendMethod method, MessageComposer::MessageSender::SaveIn saveIn );
openSUSE Build Service is sponsored by