From 3e4a618eab6ed946283483fe0154235ccc964d71 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 3 Jan 2013 15:45:36 +0100 Subject: [PATCH] Apply patch from Torsten Grote "Currently, the AttachmentMissingWarning at the bottom of the compose window is only closed when attaching a file with its own button, but not when attaching files by other means. I made showAddAttachmentDialog() emit a fileAttached() signal which in turn deactivates the warning. Maybe there is a better place to emit this signal e.g. when a file has successfully been attached." REVIEW: 107916 --- attachmentmissingwarning.cpp | 5 +++++ attachmentmissingwarning.h | 1 + kmcomposewin.cpp | 9 ++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/attachmentmissingwarning.cpp b/attachmentmissingwarning.cpp index 0cf480dc5..c89a09327 100644 --- a/attachmentmissingwarning.cpp +++ b/attachmentmissingwarning.cpp @@ -48,7 +48,12 @@ AttachmentMissingWarning::~AttachmentMissingWarning() void AttachmentMissingWarning::slotAttachFile() { Q_EMIT attachMissingFile(); +} + +void AttachmentMissingWarning::slotFileAttached() +{ setVisible(false); + Q_EMIT closeAttachMissingFile(); } void AttachmentMissingWarning::explicitlyClosed() diff --git a/attachmentmissingwarning.h b/attachmentmissingwarning.h index 37db94814..663a8cd05 100644 --- a/attachmentmissingwarning.h +++ b/attachmentmissingwarning.h @@ -28,6 +28,7 @@ public: private Q_SLOTS: void explicitlyClosed(); void slotAttachFile(); + void slotFileAttached(); Q_SIGNALS: void attachMissingFile(); void closeAttachMissingFile(); diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index d5ebd0e19..827a304b7 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -430,6 +430,7 @@ KMComposeWin::KMComposeWin( const KMime::Message::Ptr &aMsg, bool lastSignState, m_verifyMissingAttachment = new QTimer(this); m_verifyMissingAttachment->start(1000*30); connect( m_verifyMissingAttachment, SIGNAL(timeout()), this, SLOT(slotVerifyMissingAttachmentTimeout()) ); + connect( attachmentController, SIGNAL( fileAttached() ), mAttachmentMissing, SLOT(slotFileAttached()) ); readConfig(); setupStatusBar(attachmentView->widget()); @@ -3429,9 +3430,11 @@ void KMComposeWin::slotAttachMissingFile() void KMComposeWin::slotCloseAttachMissingFile() { - m_verifyMissingAttachment->stop(); - delete m_verifyMissingAttachment; - m_verifyMissingAttachment = 0; + if(m_verifyMissingAttachment) { + m_verifyMissingAttachment->stop(); + delete m_verifyMissingAttachment; + m_verifyMissingAttachment = 0; + } } void KMComposeWin::slotVerifyMissingAttachmentTimeout()