From 56455537635b154e9fd98be7b964f260c7111832 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 8 Nov 2012 22:58:03 +0100 Subject: [PATCH] Don't change change status when we just switch item --- configuredialog.cpp | 9 +++++++-- configuredialog_p.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configuredialog.cpp b/configuredialog.cpp index 04f812d9d..c1c6a82af 100644 --- a/configuredialog.cpp +++ b/configuredialog.cpp @@ -2934,6 +2934,7 @@ ComposerPageHeadersTab::ComposerPageHeadersTab( QWidget * parent ) QLabel *label; QPushButton *button; + mBlockSignal = false; vlay = new QVBoxLayout( this ); vlay->setSpacing( KDialog::spacingHint() ); vlay->setMargin( KDialog::marginHint() ); @@ -3022,6 +3023,7 @@ ComposerPageHeadersTab::ComposerPageHeadersTab( QWidget * parent ) void ComposerPage::HeadersTab::slotMimeHeaderSelectionChanged() { + mBlockSignal = true; QTreeWidgetItem * item = mTagList->currentItem(); if ( item ) { @@ -3036,6 +3038,7 @@ void ComposerPage::HeadersTab::slotMimeHeaderSelectionChanged() mTagValueEdit->setEnabled( item ); mTagNameLabel->setEnabled( item ); mTagValueLabel->setEnabled( item ); + mBlockSignal = false; } @@ -3046,7 +3049,8 @@ void ComposerPage::HeadersTab::slotMimeHeaderNameChanged( const QString & text ) QTreeWidgetItem * item = mTagList->currentItem(); if ( item ) item->setText( 0, text ); - emit changed( true ); + if(!mBlockSignal) + emit changed( true ); } @@ -3057,7 +3061,8 @@ void ComposerPage::HeadersTab::slotMimeHeaderValueChanged( const QString & text QTreeWidgetItem * item = mTagList->currentItem(); if ( item ) item->setText( 1, text ); - emit changed( true ); + if(!mBlockSignal) + emit changed( true ); } diff --git a/configuredialog_p.h b/configuredialog_p.h index 88a74514e..2062033cb 100644 --- a/configuredialog_p.h +++ b/configuredialog_p.h @@ -658,6 +658,7 @@ private: KLineEdit *mTagValueEdit; QLabel *mTagNameLabel; QLabel *mTagValueLabel; + bool mBlockSignal; }; class ComposerPageAttachmentsTab : public ConfigModuleTab {