diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-06-30 20:41:24 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-06-30 20:41:24 -0500 |
commit | f1f9c9b90c6b27b58cddc021281c345de365685b (patch) | |
tree | c1aeef2eb9fd6ab58d6d7a323067617398c6c8bf /kmail/kmcomposewin.cpp | |
parent | e4cc0ead9fb403ee429406eaaacda0afae5dd006 (diff) | |
download | tdepim-f1f9c9b90c6b27b58cddc021281c345de365685b.tar.gz tdepim-f1f9c9b90c6b27b58cddc021281c345de365685b.zip |
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
Diffstat (limited to 'kmail/kmcomposewin.cpp')
-rw-r--r-- | kmail/kmcomposewin.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/kmail/kmcomposewin.cpp b/kmail/kmcomposewin.cpp index d7e96b26a..27a76c727 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()) { |