From 0ddab7a51fe69661698eb41db221d7752c110c06 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 12 Feb 2015 13:20:33 +0100 Subject: [PATCH] Save when necessary --- configuredialog/configurecomposerpage.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/configuredialog/configurecomposerpage.cpp b/configuredialog/configurecomposerpage.cpp index 097d5df72..a3b1b6edc 100644 --- a/configuredialog/configurecomposerpage.cpp +++ b/configuredialog/configurecomposerpage.cpp @@ -620,13 +620,15 @@ void ComposerPage::GeneralTab::slotConfigureRecentAddresses() MessageViewer::AutoQPointer dlg( new KPIM::RecentAddressDialog( this ) ); dlg->setAddresses( RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->addresses() ); if ( dlg->exec() && dlg ) { - RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->clear(); - const QStringList &addrList = dlg->addresses(); - QStringList::ConstIterator it; - QStringList::ConstIterator end( addrList.constEnd() ); - - for ( it = addrList.constBegin(); it != end; ++it ) - RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->add( *it ); + if (dlg->wasChanged()) { + RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->clear(); + const QStringList &addrList = dlg->addresses(); + QStringList::ConstIterator it; + QStringList::ConstIterator end( addrList.constEnd() ); + + for ( it = addrList.constBegin(); it != end; ++it ) + RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->add( *it ); + } } }