From f1f9c9b90c6b27b58cddc021281c345de365685b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 30 Jun 2013 20:41:24 -0500 Subject: If a message is replied to from an incoming account, and an outgoing account is available with the same name, set that outgoing account as the default transport This resolves Bug 1239 --- kmail/kmcomposewin.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'kmail/kmcomposewin.cpp') diff --git a/kmail/kmcomposewin.cpp b/kmail/kmcomposewin.cpp index d7e96b26..27a76c72 100644 --- a/kmail/kmcomposewin.cpp +++ b/kmail/kmcomposewin.cpp @@ -1980,8 +1980,23 @@ void KMComposeWin::setMsg(KMMessage* newMsg, bool mayAutoSign, TQString transport = newMsg->headerField("X-KMail-Transport"); const bool stickyTransport = mBtnTransport->isChecked() && !mIgnoreStickyFields; - if (!stickyTransport && !transport.isEmpty()) + if (!stickyTransport && !transport.isEmpty()) { setTransport( transport ); + } + + // If we are using the default transport, and the originating account name of the original message matches the name of a valid transport, use setTransport() to set it + // See Bug 1239 + if (transport.isEmpty() && !mMsg->originatingAccountName().isEmpty()) { + TQString transportCandidate = mMsg->originatingAccountName(); + bool transportFound = false; + for ( int i = 0; i < mTransport->count(); ++i ) { + if ( mTransport->text(i) == transportCandidate ) { + transportFound = true; + setTransport(transportCandidate); + break; + } + } + } if (!mBtnFcc->isChecked()) { -- cgit v1.2.3