[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kde-workspace/KDE/4.8] libs/plasmaclock: re-read the calendar on locale changes, fixes crash report
From: Lukas Tinkl <lukas () kde ! org>
Date: 2012-05-02 16:24:06
Message-ID: 20120502162406.D9F43A60A9 () git ! kde ! org
[Download RAW message or body]
Git commit c0bd761c5d1663995f028d05ac317e492b90ea48 by Lukas Tinkl.
Committed on 02/05/2012 at 18:21.
Pushed by lukas into branch 'KDE/4.8'.
re-read the calendar on locale changes, fixes crash report in #299237
and a dozen of dupes
BUG: 299237
M +13 -0 libs/plasmaclock/calendartable.cpp
M +1 -0 libs/plasmaclock/calendartable.h
http://commits.kde.org/kde-workspace/c0bd761c5d1663995f028d05ac317e492b90ea48
diff --git a/libs/plasmaclock/calendartable.cpp b/libs/plasmaclock/calendartable.cpp
index 47ffd9d..745e92f 100644
--- a/libs/plasmaclock/calendartable.cpp
+++ b/libs/plasmaclock/calendartable.cpp
@@ -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)
diff --git a/libs/plasmaclock/calendartable.h b/libs/plasmaclock/calendartable.h
index 969e4fc..8678593 100644
--- a/libs/plasmaclock/calendartable.h
+++ b/libs/plasmaclock/calendartable.h
@@ -127,6 +127,7 @@ private:
CalendarTablePrivate* const d;
Q_PRIVATE_SLOT(d, void populateCalendar())
+ Q_PRIVATE_SLOT(d, void settingsChanged(int category))
};
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic