Commit 9aeb0331 authored by David Faure's avatar David Faure
Browse files

Save calendar colors immediately rather than on exit.

Summary: They were lost if the app would crash on exit...

Test Plan: changing a calendar color and watching ~/.config/eventviewsrc be updated immediately

Reviewers: smartins, mlaurent

Reviewed By: mlaurent

Subscribers: mlaurent, dkurz, #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D7387
parent 17568b52
...@@ -759,6 +759,7 @@ void AkonadiCollectionView::assignColor() ...@@ -759,6 +759,7 @@ void AkonadiCollectionView::assignColor()
myColor = QColorDialog::getColor(defaultColor); myColor = QColorDialog::getColor(defaultColor);
if (myColor.isValid() && myColor != defaultColor) { if (myColor.isValid() && myColor != defaultColor) {
KOPrefs::instance()->setResourceColor(identifier, myColor); KOPrefs::instance()->setResourceColor(identifier, myColor);
KOPrefs::instance()->eventViewsPreferences()->writeConfig();
Q_EMIT colorsChanged(); Q_EMIT colorsChanged();
updateMenu(); updateMenu();
updateView(); updateView();
...@@ -773,6 +774,7 @@ void AkonadiCollectionView::disableColor() ...@@ -773,6 +774,7 @@ void AkonadiCollectionView::disableColor()
Q_ASSERT(collection.isValid()); Q_ASSERT(collection.isValid());
const QString identifier = QString::number(collection.id()); const QString identifier = QString::number(collection.id());
KOPrefs::instance()->setResourceColor(identifier, QColor()); KOPrefs::instance()->setResourceColor(identifier, QColor());
KOPrefs::instance()->eventViewsPreferences()->writeConfig();
updateMenu(); updateMenu();
updateView(); updateView();
Q_EMIT colorsChanged(); Q_EMIT colorsChanged();
......
Markdown is supported
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