[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace] libs/plasmaclock: re-read the calendar on locale changes, fixes crash report in #299
From:       Lukas Tinkl <lukas () kde ! org>
Date:       2012-05-02 16:25:59
Message-ID: 20120502162559.F04DDA60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 88a52f1387dfed731c5eae5a95281f33d7a07d72 by Lukas Tinkl.
Committed on 02/05/2012 at 18:21.
Pushed by lukas into branch 'master'.

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/88a52f1387dfed731c5eae5a95281f33d7a07d72

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