[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.2/kdebase/workspace/plasma/applets/calendar
From: Andrius Štikonas <stikonas () gmail ! com>
Date: 2009-04-10 10:21:08
Message-ID: 1239358868.452773.16387.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 951827 by stikonas:
Backport r950373 to fix bug #187699 in calendar applet.
M +2 -11 calendar.cpp
M +1 -5 calendar.h
--- branches/KDE/4.2/kdebase/workspace/plasma/applets/calendar/calendar.cpp \
#951826:951827 @@ -19,6 +19,7 @@
#include <QGraphicsLayout>
#include <QPainter>
+#include <QTimer>
#include <KDebug>
#include <KIcon>
@@ -35,7 +36,6 @@
m_calendarDialog(0),
m_theme(0),
m_date(0),
- m_updateTimerId(0)
{
setAspectRatioMode(Plasma::IgnoreAspectRatio);
setCacheMode(DeviceCoordinateCache);
@@ -116,18 +116,9 @@
QDateTime d = QDateTime::currentDateTime();
m_date = d.date().day();
int updateIn = (24 * 60 * 60) - (d.toTime_t() + \
KSystemTimeZones::local().currentOffset()) % (24 * 60 * 60);
- m_updateTimerId = startTimer(updateIn * 1000);
+ QTimer::singleShot(updateIn * 1000, this, SLOT(updateDate()));
constraintsEvent(Plasma::FormFactorConstraint);
}
-void CalendarTest::timerEvent(QTimerEvent *event)
-{
- if (event->timerId() != m_updateTimerId) {
- return;
- }
- killTimer(m_updateTimerId);
- updateDate();
-}
-
#include "calendar.moc"
--- branches/KDE/4.2/kdebase/workspace/plasma/applets/calendar/calendar.h \
#951826:951827 @@ -45,12 +45,9 @@
*/
QGraphicsWidget *graphicsWidget();
- protected:
- void updateDate();
- void timerEvent(QTimerEvent *event);
-
protected slots:
void configAccepted();
+ void updateDate();
private:
void paintIcon();
@@ -58,7 +55,6 @@
Plasma::Calendar *m_calendarDialog;
Plasma::Svg *m_theme;
int m_date;
- int m_updateTimerId;
};
K_EXPORT_PLASMA_APPLET(calendar, CalendarTest)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic