summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 3d4acb7..f8bfc8b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -77,18 +77,22 @@ bool ListItemVisitor::visit(Event *e)
bool ok = false;
QString start, end;
+ QDate ds, de;
if ( e->doesRecur() ) {
- QDate d = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
+ ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
if ( ok ) {
int days = e->dtStart().date().daysTo(e->dtEnd().date() );
- start = KGlobal::locale()->formatDate(d,true);
- end = KGlobal::locale()->formatDate(d.addDays( days),true);
+ start = KGlobal::locale()->formatDate(ds,true);
+ de = ds.addDays( days);
+ end = KGlobal::locale()->formatDate(de,true);
}
}
if ( ! ok ) {
start =e->dtStartDateStr();
end = e->dtEndDateStr();
+ ds = e->dtStart().date();
+ de = e->dtEnd().date();
}
mItem->setText(0,e->summary());
mItem->setText(1,start);
@@ -103,14 +107,12 @@ bool ListItemVisitor::visit(Event *e)
mItem->setText(10,e->categoriesStr());
QString key;
- QDate d = e->dtStart().date();
QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time();
- key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute());
+ key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute());
mItem->setSortKey(1,key);
- d = e->dtEnd().date();
t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time();
- key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute());
+ key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute());
mItem->setSortKey(3,key);
return true;