Commit c7814acf authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 299289 - "Replace smileys by emoticons" causes another message

to be displayed
It was a bug when we saved aggregation combobox it reloaded config
=> reload last selected item.
Now save it before when we apply config so it avoid to select last saved
item.

FIXED-IN: 4.8.4
BUG: 299289
parent 4048b47c
......@@ -1397,8 +1397,7 @@ AppearancePageHeadersTab::AppearancePageHeadersTab( QWidget * parent )
mCustomDateFormatEdit->setWhatsThis( mCustomDateWhatsThis );
radio->setWhatsThis( mCustomDateWhatsThis );
gvlay->addWidget( hbox );
}
} // end for loop populating mDateDisplay
} } // end for loop populating mDateDisplay
vlay->addWidget( mDateDisplay );
connect( mDateDisplay, SIGNAL(clicked(int)),
......@@ -1500,6 +1499,7 @@ void AppearancePage::HeadersTab::save()
MessageList::Core::Settings::self()->
setTabsHaveCloseButton( mTabsHaveCloseButton->isChecked() );
KMKernel::self()->savePaneSelection();
// "Aggregation"
mAggregationComboBox->writeDefaultConfig();
......
......@@ -1926,4 +1926,12 @@ void KMKernel::slotInstanceRemoved(const Akonadi::AgentInstance& instance)
}
}
void KMKernel::savePaneSelection()
{
KMMainWidget *widget = getKMMainWidget();
if ( widget ) {
widget->savePaneSelection();
}
}
#include "kmkernel.moc"
......@@ -411,6 +411,8 @@ public:
const QAbstractItemModel* treeviewModelSelection();
void savePaneSelection();
protected:
void agentInstanceBroken( const Akonadi::AgentInstance& instance );
......
......@@ -4606,3 +4606,9 @@ void KMMainWidget::slotServerSideSubscription()
}
}
void KMMainWidget::savePaneSelection()
{
if(mMessagePane) {
mMessagePane->saveCurrentSelection();
}
}
......@@ -189,6 +189,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget
KMail::FolderShortcutActionManager *folderShortcutActionManager() const {
return mFolderShortcutActionManager;
}
void savePaneSelection();
public slots:
// Moving messages around
......
......@@ -385,11 +385,8 @@ void Widget::Private::setDefaultSortOrderForStorageModel( const StorageModel * s
checkSortOrder( storageModel );
}
void Widget::setStorageModel( StorageModel * storageModel, PreSelectionMode preSelectionMode )
void Widget::saveCurrentSelection()
{
if ( storageModel == d->mStorageModel )
return; // nuthin to do here
if ( d->mStorageModel )
{
// Save the current selection
......@@ -399,7 +396,14 @@ void Widget::setStorageModel( StorageModel * storageModel, PreSelectionMode preS
lastSelectedMessageItem ? lastSelectedMessageItem->uniqueId() : 0
);
}
}
void Widget::setStorageModel( StorageModel * storageModel, PreSelectionMode preSelectionMode )
{
if ( storageModel == d->mStorageModel )
return; // nuthin to do here
saveCurrentSelection();
d->setDefaultAggregationForStorageModel( storageModel );
d->setDefaultThemeForStorageModel( storageModel );
d->setDefaultSortOrderForStorageModel( storageModel );
......
......@@ -130,6 +130,8 @@ public:
*/
void setCurrentFolder( const Akonadi::Collection &collection );
void saveCurrentSelection();
public slots:
/**
......
......@@ -900,5 +900,11 @@ void Pane::setPreferEmptyTab( bool emptyTab )
d->mPreferEmptyTab = emptyTab;
}
void Pane::saveCurrentSelection()
{
for ( int i=0; i<count(); i++ ) {
Widget *w = qobject_cast<Widget *>( widget( i ) );
w->saveCurrentSelection();
}
}
#include "pane.moc"
......@@ -373,6 +373,8 @@ public:
void updateTabIconText( const Akonadi::Collection &collection, const QString&label, const QIcon& icon );
void saveCurrentSelection();
public slots:
/**
* Selects all the items in the current folder.
......
Supports Markdown
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