Don't signal that tags changed everytime you use the configure dialog.

Check if the user modified them first.

Saves some MessageList::Core::Model::setFilter() calls, and makes
bug 261645 reproducible in less use cases.

CCBUG:261645
wilder-work
Sergio Martins 15 years ago
parent baff879790
commit bba1f17d7d
  1. 19
      configuredialog.cpp
  2. 3
      configuredialog_p.h

@ -1976,12 +1976,31 @@ void AppearancePage::MessageTagTab::doLoadFromGlobalSettings()
slotUpdateTagSettingWidgets( -1 );
//Needed since the previous function doesn't affect add button
mTagAddButton->setEnabled( false );
// Save the original list
mOriginalMsgTagList.clear();
foreach( const KMail::TagPtr &tag, mMsgTagList ) {
mOriginalMsgTagList.append( KMail::TagPtr( new KMail::Tag( *tag ) ) );
}
}
void AppearancePage::MessageTagTab::save()
{
slotRecordTagSettings( mTagListBox->currentRow() );
if ( mOriginalMsgTagList.count() == mMsgTagList.count() ) {
bool nothingChanged = true;
for ( int i=0; i<mMsgTagList.count(); ++i ) {
if ( *(mMsgTagList[i]) != *(mOriginalMsgTagList[i]) ) {
nothingChanged = false;
break;
}
}
if ( nothingChanged ) {
return;
}
}
foreach( const KMail::Tag::Ptr &tag, mMsgTagList ) {
tag->priority = mMsgTagList.indexOf( tag );

@ -484,6 +484,9 @@ private: // data
// List of all Tags currently in the list
QList<KMail::TagPtr> mMsgTagList;
// So we can compare to mMsgTagList and see if the user changed tags
QList<KMail::TagPtr> mOriginalMsgTagList;
/*Used to safely call slotRecordTagSettings when the selection in
list box changes*/
int mPreviousTag;

Loading…
Cancel
Save