summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (show 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)
77 77
78 bool ok = false; 78 bool ok = false;
79 QString start, end; 79 QString start, end;
80 QDate ds, de;
80 if ( e->doesRecur() ) { 81 if ( e->doesRecur() ) {
81 QDate d = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); 82 ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
82 if ( ok ) { 83 if ( ok ) {
83 int days = e->dtStart().date().daysTo(e->dtEnd().date() ); 84 int days = e->dtStart().date().daysTo(e->dtEnd().date() );
84 start = KGlobal::locale()->formatDate(d,true); 85 start = KGlobal::locale()->formatDate(ds,true);
85 end = KGlobal::locale()->formatDate(d.addDays( days),true); 86 de = ds.addDays( days);
87 end = KGlobal::locale()->formatDate(de,true);
86 } 88 }
87 89
88 } 90 }
89 if ( ! ok ) { 91 if ( ! ok ) {
90 start =e->dtStartDateStr(); 92 start =e->dtStartDateStr();
91 end = e->dtEndDateStr(); 93 end = e->dtEndDateStr();
94 ds = e->dtStart().date();
95 de = e->dtEnd().date();
92 } 96 }
93 mItem->setText(0,e->summary()); 97 mItem->setText(0,e->summary());
94 mItem->setText(1,start); 98 mItem->setText(1,start);
@@ -103,14 +107,12 @@ bool ListItemVisitor::visit(Event *e)
103 mItem->setText(10,e->categoriesStr()); 107 mItem->setText(10,e->categoriesStr());
104 108
105 QString key; 109 QString key;
106 QDate d = e->dtStart().date();
107 QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); 110 QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time();
108 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute()); 111 key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute());
109 mItem->setSortKey(1,key); 112 mItem->setSortKey(1,key);
110 113
111 d = e->dtEnd().date();
112 t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); 114 t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time();
113 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute()); 115 key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute());
114 mItem->setSortKey(3,key); 116 mItem->setSortKey(3,key);
115 117
116 return true; 118 return true;