Summary: | Identity signature added twice | ||
---|---|---|---|
Product: | [Unmaintained] KMail Mobile | Reporter: | Sabine Faure <sabine> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | CLOSED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Identity signature inserted twice when selecting an identity from the composer. |
Description
Sabine Faure
2010-12-22 23:51:07 UTC
Created attachment 55175 [details]
Identity signature inserted twice when selecting an identity from the composer.
The signature should only be inserted once.
N900, 4:4.6~20101222.1208531-1maemo1.1208558
commit 7075946cef95a33ec2df67743ab08cec9a388dd1 branch master Author: Tobias Koenig <tokoe@kde.org> Date: Thu Dec 23 10:25:44 2010 +0100 Do not trigger signature replacement twice Both, the signature controller and the ComposerView::identityChanged slot will update the signature if the identity has been changed. To prevent this disable identity tracking in signature controller (via suspend()) and let Message::ComposerViewBase::identityChanged handle the signature update. BUG: 261016 diff --git a/mobile/mail/composerview.cpp b/mobile/mail/composerview.cpp index 2308402..c1d19f5 100644 --- a/mobile/mail/composerview.cpp +++ b/mobile/mail/composerview.cpp @@ -61,6 +61,7 @@ #include <KCMultiDialog> #include <KNotification> +#include <QtCore/QTimer> #include <qdeclarativecontext.h> #include <qdeclarativeengine.h> @@ -264,9 +265,17 @@ void ComposerView::qmlLoaded ( QDeclarativeView::Status status ) Message::SignatureController *signatureController = new Message::SignatureController( this ); signatureController->setEditor( m_composerBase->editor() ); signatureController->setIdentityCombo( m_composerBase->identityCombo() ); - signatureController->applyCurrentSignature(); + signatureController->suspend(); // ComposerView::identityChanged will update the signature m_composerBase->setSignatureController( signatureController ); + if ( MessageComposer::MessageComposerSettings::self()->autoTextSignature() == QLatin1String( "auto" ) ) { + if ( MessageComposer::MessageComposerSettings::self()->prependSignature() ) { + QTimer::singleShot( 0, m_composerBase->signatureController(), SLOT( prependSignature() ) ); + } else { + QTimer::singleShot( 0, m_composerBase->signatureController(), SLOT( appendSignature() ) ); + } + } + connect( actionCollection()->action( "composer_clean_spaces" ), SIGNAL(triggered(bool)), signatureController, SLOT( cleanSpace() ) ); connect( actionCollection()->action( "composer_append_signature" ), SIGNAL(triggered(bool)), signatureController, SLOT( appendSignature() ) ); connect( actionCollection()->action( "composer_prepend_signature" ), SIGNAL(triggered(bool)), signatureController, SLOT( prependSignature() ) ); It is corrected now. The signature is only added once now, both when not using and using html formatting so I am closing this bug. N900, 4:4.6~.20101223.2034.git9cc0c3e-1maemo1.120883 |