Commit c0bd761c authored by Lukáš Tinkl's avatar Lukáš Tinkl
Browse files

re-read the calendar on locale changes, fixes crash report in #299237

and a dozen of dupes

BUG: 299237
parent 7eea01fe
......@@ -101,6 +101,7 @@ class CalendarTablePrivate
delayedPopulationTimer->setInterval(0);
delayedPopulationTimer->setSingleShot(true);
QObject::connect(delayedPopulationTimer, SIGNAL(timeout()), q, SLOT(populateCalendar()));
QObject::connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), q, SLOT(settingsChanged(int)));
setDate(initialDate);
}
......@@ -362,6 +363,7 @@ class CalendarTablePrivate
void populateHolidays();
void populateEvents();
void populateCalendar();
void settingsChanged(int category);
CalendarTable *q;
QString calendarType;
......@@ -819,6 +821,17 @@ void CalendarTablePrivate::populateEvents()
delayedPopulationTimer->start();
}
void CalendarTablePrivate::settingsChanged(int category)
{
if (category != KGlobalSettings::SETTINGS_LOCALE) {
return;
}
calendar = KGlobal::locale()->calendar();
q->update();
}
void CalendarTable::dataUpdated(const QString &source, const Plasma::DataEngine::Data &data)
{
Q_UNUSED(source)
......
......@@ -127,6 +127,7 @@ private:
CalendarTablePrivate* const d;
Q_PRIVATE_SLOT(d, void populateCalendar())
Q_PRIVATE_SLOT(d, void settingsChanged(int category))
};
}
......
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