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:
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);
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(; const QString identifier = QString::number(;
KOPrefs::instance()->setResourceColor(identifier, QColor()); KOPrefs::instance()->setResourceColor(identifier, QColor());
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