Commit 8262a482 authored by Laurent Montel's avatar Laurent Montel 😁

Don't make active timer all the time. Just when text is changed

parent 8dced212
......@@ -424,13 +424,13 @@ KMComposeWin::KMComposeWin( const KMime::Message::Ptr &aMsg, bool lastSignState,
mAttachmentMissing = new AttachmentMissingWarning(this);
connect(mAttachmentMissing, SIGNAL(attachMissingFile()), this, SLOT(slotAttachMissingFile()));
connect(mAttachmentMissing, SIGNAL(closeAttachMissingFile()), this, SLOT(slotCloseAttachMissingFile()));
connect(mAttachmentMissing, SIGNAL(explicitClosedMissingAttachment()), this, SLOT(slotExplicitClosedMissingAttachment()));
v->addWidget(mAttachmentMissing);
if (GlobalSettings::self()->showForgottenAttachmentWarning()) {
m_verifyMissingAttachment = new QTimer(this);
m_verifyMissingAttachment->start(1000*5);
m_verifyMissingAttachment->setSingleShot(true);
m_verifyMissingAttachment->setInterval(1000*5);
connect( m_verifyMissingAttachment, SIGNAL(timeout()), this, SLOT(slotVerifyMissingAttachmentTimeout()) );
}
connect( attachmentController, SIGNAL(fileAttached()), mAttachmentMissing, SLOT(slotFileAttached()) );
......@@ -524,6 +524,9 @@ void KMComposeWin::slotEditorTextChanged()
mFindNextText->setEnabled( textIsNotEmpty );
mReplaceText->setEnabled( textIsNotEmpty );
mSelectAll->setEnabled( textIsNotEmpty );
if (m_verifyMissingAttachment && !m_verifyMissingAttachment->isActive()) {
m_verifyMissingAttachment->start();
}
}
//-----------------------------------------------------------------------------
......@@ -3567,19 +3570,10 @@ void KMComposeWin::slotAttachMissingFile()
mComposerBase->attachmentController()->showAddAttachmentDialog();
}
void KMComposeWin::slotCloseAttachMissingFile()
{
if(m_verifyMissingAttachment) {
m_verifyMissingAttachment->start();
}
}
void KMComposeWin::slotVerifyMissingAttachmentTimeout()
{
if( mComposerBase->hasMissingAttachments( GlobalSettings::self()->attachmentKeywords() )) {
mAttachmentMissing->animatedShow();
} else {
m_verifyMissingAttachment->start();
}
}
......
......@@ -438,7 +438,6 @@ private slots:
void slotCreateAddressBookContact();
void slotAttachMissingFile();
void slotCloseAttachMissingFile();
void slotExplicitClosedMissingAttachment();
void slotVerifyMissingAttachmentTimeout();
void slotCheckSendNow();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment