-rw-r--r-- | korganizer/kolistview.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index a1bf9ff..bbf83d9 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -71,99 +71,105 @@ class KOListViewWhatsThis :public QWhatsThis | |||
71 | { | 71 | { |
72 | public: | 72 | public: |
73 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 73 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; |
74 | 74 | ||
75 | protected: | 75 | protected: |
76 | virtual QString text( const QPoint& p) | 76 | virtual QString text( const QPoint& p) |
77 | { | 77 | { |
78 | return _view->getWhatsThisText(p) ; | 78 | return _view->getWhatsThisText(p) ; |
79 | } | 79 | } |
80 | private: | 80 | private: |
81 | QWidget* _wid; | 81 | QWidget* _wid; |
82 | KOListView * _view; | 82 | KOListView * _view; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | 85 | ||
86 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | 86 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) |
87 | { | 87 | { |
88 | mItem = item; | 88 | mItem = item; |
89 | mDate = date; | 89 | mDate = date; |
90 | } | 90 | } |
91 | 91 | ||
92 | ListItemVisitor::~ListItemVisitor() | 92 | ListItemVisitor::~ListItemVisitor() |
93 | { | 93 | { |
94 | } | 94 | } |
95 | 95 | ||
96 | bool ListItemVisitor::visit(Event *e) | 96 | bool ListItemVisitor::visit(Event *e) |
97 | { | 97 | { |
98 | bool ok = false; | 98 | bool ok = false; |
99 | QString start, end; | 99 | QString start, end; |
100 | QDate ds, de; | 100 | QDate ds, de; |
101 | if ( e->doesRecur() ) { | 101 | if ( e->doesRecur() ) { |
102 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); | 102 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); |
103 | if ( ok ) { | 103 | if ( ok ) { |
104 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); | 104 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); |
105 | start = KGlobal::locale()->formatDate(ds,true); | 105 | start = KGlobal::locale()->formatDate(ds,true); |
106 | de = ds.addDays( days); | 106 | de = ds.addDays( days); |
107 | end = KGlobal::locale()->formatDate(de,true); | 107 | end = KGlobal::locale()->formatDate(de,true); |
108 | } | 108 | } |
109 | 109 | ||
110 | } | 110 | } |
111 | if ( ! ok ) { | 111 | if ( ! ok ) { |
112 | start =e->dtStartDateStr(); | 112 | start =e->dtStartDateStr(); |
113 | end = e->dtEndDateStr(); | 113 | end = e->dtEndDateStr(); |
114 | ds = e->dtStart().date(); | 114 | ds = e->dtStart().date(); |
115 | de = e->dtEnd().date(); | 115 | de = e->dtEnd().date(); |
116 | } | 116 | } |
117 | mItem->setText(0,e->summary()); | 117 | mItem->setText(0,e->summary()); |
118 | mItem->setText(1,start); | 118 | mItem->setText(1,start); |
119 | mItem->setText(2,e->dtStartTimeStr()); | 119 | if ( e->doesFloat() ) |
120 | mItem->setText(2,"---"); | ||
121 | else | ||
122 | mItem->setText(2,e->dtStartTimeStr()); | ||
120 | mItem->setText(3,end); | 123 | mItem->setText(3,end); |
121 | mItem->setText(4,e->dtEndTimeStr()); | 124 | if ( e->doesFloat() ) |
125 | mItem->setText(4,"---"); | ||
126 | else | ||
127 | mItem->setText(4,e->dtEndTimeStr()); | ||
122 | if ( e->isAlarmEnabled() ) { | 128 | if ( e->isAlarmEnabled() ) { |
123 | mItem->setText(5,e->alarms().first()->offsetText() ); | 129 | mItem->setText(5,e->alarms().first()->offsetText() ); |
124 | } else { | 130 | } else { |
125 | mItem->setText(5, i18n("No")); | 131 | mItem->setText(5, i18n("No")); |
126 | } | 132 | } |
127 | mItem->setText(6, e->recurrence()->recurrenceText()); | 133 | mItem->setText(6, e->recurrence()->recurrenceText()); |
128 | if( ! e->doesRecur() ) | 134 | if( ! e->doesRecur() ) |
129 | mItem->setSortKey( 6, "-" ); | 135 | mItem->setSortKey( 6, "-" ); |
130 | mItem->setText(7,"---"); | 136 | mItem->setText(7,"---"); |
131 | mItem->setText(8,"---"); | 137 | mItem->setText(8,"---"); |
132 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 138 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
133 | mItem->setText(10,e->categoriesStr()); | 139 | mItem->setText(10,e->categoriesStr()); |
134 | 140 | ||
135 | QString key; | 141 | QString key; |
136 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 142 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
137 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 143 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
138 | mItem->setSortKey(1,key); | 144 | mItem->setSortKey(1,key); |
139 | 145 | ||
140 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 146 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
141 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 147 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
142 | mItem->setSortKey(3,key); | 148 | mItem->setSortKey(3,key); |
143 | return true; | 149 | return true; |
144 | } | 150 | } |
145 | 151 | ||
146 | bool ListItemVisitor::visit(Todo *t) | 152 | bool ListItemVisitor::visit(Todo *t) |
147 | { | 153 | { |
148 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); | 154 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); |
149 | if (t->hasStartDate()) { | 155 | if (t->hasStartDate()) { |
150 | mItem->setText(1,t->dtStartDateStr()); | 156 | mItem->setText(1,t->dtStartDateStr()); |
151 | if (t->doesFloat()) { | 157 | if (t->doesFloat()) { |
152 | mItem->setText(2,"---"); | 158 | mItem->setText(2,"---"); |
153 | } else { | 159 | } else { |
154 | mItem->setText(2,t->dtStartTimeStr()); | 160 | mItem->setText(2,t->dtStartTimeStr()); |
155 | } | 161 | } |
156 | } else { | 162 | } else { |
157 | mItem->setText(1,"---"); | 163 | mItem->setText(1,"---"); |
158 | mItem->setText(2,"---"); | 164 | mItem->setText(2,"---"); |
159 | } | 165 | } |
160 | mItem->setText(3,"---"); | 166 | mItem->setText(3,"---"); |
161 | mItem->setText(4,"---"); | 167 | mItem->setText(4,"---"); |
162 | if ( t->isAlarmEnabled() ) { | 168 | if ( t->isAlarmEnabled() ) { |
163 | mItem->setText(5,t->alarms().first()->offsetText() ); | 169 | mItem->setText(5,t->alarms().first()->offsetText() ); |
164 | } else { | 170 | } else { |
165 | mItem->setText(5, i18n("No")); | 171 | mItem->setText(5, i18n("No")); |
166 | } | 172 | } |
167 | mItem->setText(6, t->recurrence()->recurrenceText()); | 173 | mItem->setText(6, t->recurrence()->recurrenceText()); |
168 | if( ! t->doesRecur() ) | 174 | if( ! t->doesRecur() ) |
169 | mItem->setSortKey( 6, "-" ); | 175 | mItem->setSortKey( 6, "-" ); |