Commit aaecbfa8 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
(cherry picked from commit c7814acf)

Conflicts:

	kmail/kmmainwidget.cpp
	messagelist/core/widgetbase.h
parent 5f477f43
......@@ -1366,8 +1366,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)),
......@@ -1450,6 +1449,7 @@ void AppearancePage::HeadersTab::save()
MessageList::Core::Settings::self()->setMessageToolTipEnabled( mDisplayMessageToolTips->isChecked() );
MessageList::Core::Settings::self()->setAutoHideTabBarWithSingleTab( mHideTabBarWithSingleTab->isChecked() );
KMKernel::self()->savePaneSelection();
// "Aggregation"
mAggregationComboBox->writeDefaultConfig();
......
......@@ -1899,4 +1899,12 @@ void KMKernel::slotInstanceRemoved(const Akonadi::AgentInstance& instance)
}
}
void KMKernel::savePaneSelection()
{
KMMainWidget *widget = getKMMainWidget();
if ( widget ) {
widget->savePaneSelection();
}
}
#include "kmkernel.moc"
......@@ -410,6 +410,8 @@ public:
const QAbstractItemModel* treeviewModelSelection();
void savePaneSelection();
protected:
void agentInstanceBroken( const Akonadi::AgentInstance& instance );
......
......@@ -4532,3 +4532,9 @@ void KMMainWidget::slotCollectionPropertiesContinued( KJob* job )
dlg->show();
}
void KMMainWidget::savePaneSelection()
{
if(mMessagePane) {
mMessagePane->saveCurrentSelection();
}
}
......@@ -190,6 +190,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget
KMail::FolderShortcutActionManager *folderShortcutActionManager() const {
return mFolderShortcutActionManager;
}
void savePaneSelection();
public slots:
// Moving messages around
......
......@@ -368,11 +368,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
......@@ -382,7 +379,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 );
......
......@@ -124,6 +124,8 @@ public:
*/
bool selectionEmpty() const;
void saveCurrentSelection();
public slots:
/**
......
......@@ -890,5 +890,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