[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/utils/charm
From: Mirko Boehm <mirko () kde ! org>
Date: 2009-05-13 19:06:55
Message-ID: 1242241615.067189.6418.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 967698 by mirko:
r57269@cutiepie: mirko | 2009-05-13 17:31:22 +0200
- adjust all events that are exported in a time sheet to midnight UTC
without changing the duration
- this should fix the problem that events end on on the wrong day on
the server for people located to the east of lotsofcake
_M . (directory)
M +10 -0 branches/charm-1.3/Charm/Reports/WeeklyTimeSheet3.cpp
M +2 -2 branches/charm-1.3/Core/Event.cpp
M +1 -0 branches/charm-1.3/Core/SqlStorage.cpp
--- trunk/playground/utils/charm/branches/charm-1.3/Charm/Reports/WeeklyTimeSheet3.cpp \
#967697:967698 @@ -631,6 +631,16 @@
}
// create elements:
Q_FOREACH( Event event, events ) {
+ // event.dump();
+ const int duration = event.duration();
+ const QDate start = event.startDateTime().date();
+ const QDateTime localMidnight( QDate( start.year(), start.month(), \
start.day() ) ); + const QDateTime utcMidnight( QDate( start.year(), \
start.month(), start.day() ), QTime(), Qt::UTC ); + const int utcDelta \
= localMidnight.secsTo( utcMidnight ); + event.setStartDateTime( \
event.startDateTime( Qt::UTC ).addSecs( utcDelta ) ); + \
event.setEndDateTime( event.startDateTime( Qt::UTC ).addSecs( duration ) ); + \
Q_ASSERT( duration == event.duration() ); + // event.dump();
effort.appendChild( event.toXml( document ) );
}
}
--- trunk/playground/utils/charm/branches/charm-1.3/Core/Event.cpp #967697:967698
@@ -129,8 +129,8 @@
{
qDebug() << "[Event" << id() << "] - task "
<< taskId()
- << " - start: " << startDateTime()
- << " - end: " << endDateTime()
+ << " - start (UTC): " << startDateTime( Qt::UTC )
+ << " - end (UTC): " << endDateTime( Qt::UTC )
<< " - duration: " << duration()
<< "seconds - comment:" << comment();
}
--- trunk/playground/utils/charm/branches/charm-1.3/Core/SqlStorage.cpp \
#967697:967698 @@ -300,6 +300,7 @@
return Event();
}
}
+
bool SqlStorage::modifyEvent(const Event& event)
{
QSqlQuery query(database());
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic