summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Unidiff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 493382d..a776cb6 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -154,103 +154,104 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
154 QString text; 154 QString text;
155 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day 155 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
156 if (event->isMultiDay()) { 156 if (event->isMultiDay()) {
157 QString prefix = "<->";multiday = 2; 157 QString prefix = "<->";multiday = 2;
158 QString time; 158 QString time;
159 if ( event->doesRecur() ) { 159 if ( event->doesRecur() ) {
160 if ( event->recursOn( mDate) ) { 160 if ( event->recursOn( mDate) ) {
161 prefix ="->" ;multiday = 1; 161 prefix ="->" ;multiday = 1;
162 } 162 }
163 else { 163 else {
164 int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); 164 int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
165 if ( event->recursOn( mDate.addDays( -days)) ) { 165 if ( event->recursOn( mDate.addDays( -days)) ) {
166 prefix ="<-" ;multiday = 3; 166 prefix ="<-" ;multiday = 3;
167 } 167 }
168 } 168 }
169 } else { 169 } else {
170 if (mDate == event->dtStart().date()) { 170 if (mDate == event->dtStart().date()) {
171 prefix ="->" ;multiday = 1; 171 prefix ="->" ;multiday = 1;
172 } else if (mDate == event->dtEnd().date()) { 172 } else if (mDate == event->dtEnd().date()) {
173 prefix ="<-" ;multiday = 3; 173 prefix ="<-" ;multiday = 3;
174 } 174 }
175 } 175 }
176 if ( !event->doesFloat() ) { 176 if ( !event->doesFloat() ) {
177 if ( mDate == event->dtStart().date () ) 177 if ( mDate == event->dtStart().date () )
178 time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; 178 time = KGlobal::locale()->formatTime(event->dtStart().time())+" ";
179 else if ( mDate == event->dtEnd().date () ) 179 else if ( mDate == event->dtEnd().date () )
180 time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; 180 time = KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
181 181
182 } 182 }
183 text = time + event->summary(); 183 text = time + event->summary();
184 mToolTipText += prefix + text; 184 mToolTipText += prefix + text;
185 } else { 185 } else {
186 if (event->doesFloat()) { 186 if (event->doesFloat()) {
187 text = event->summary(); 187 text = event->summary();
188 mToolTipText += text; 188 mToolTipText += text;
189 } 189 }
190 else { 190 else {
191 text = KGlobal::locale()->formatTime(event->dtStart().time()); 191 text = KGlobal::locale()->formatTime(event->dtStart().time());
192 text += " " + event->summary(); 192 text += " " + event->summary();
193 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); 193 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
194 } 194 }
195 } 195 }
196 if ( !event->location().isEmpty() ) 196 if ( !event->location().isEmpty() )
197 mToolTipText += " (" + event->location() + ")"; 197 mToolTipText += " (" + event->location() + ")";
198#if QT_VERSION >= 0x030000 198#if QT_VERSION >= 0x030000
199 mToolTipText.replace( '<' , "&lt;" ); 199 mToolTipText.replace( '<' , "&lt;" );
200 mToolTipText.replace( '>' , "&gt;" ); 200 mToolTipText.replace( '>' , "&gt;" );
201#else 201#else
202 if ( mToolTipText.find ('<') > 0 ) { 202 if ( mToolTipText.find ('<') >= 0 ) {
203 mToolTipText.replace( QRegExp("<") , "&lt;" ); 203 mToolTipText.replace( QRegExp("<") , "&lt;" );
204 } 204 }
205 if ( mToolTipText.find ('>') > 0 ) { 205 if ( mToolTipText.find ('>') >= 0 ) {
206 mToolTipText.replace( QRegExp(">") , "&gt;" ); 206 mToolTipText.replace( QRegExp(">") , "&gt;" );
207 } 207 }
208#endif 208#endif
209 //qDebug("TTT: %s ", mToolTipText.latin1());
209 mToolTip.append( mToolTipText ); 210 mToolTip.append( mToolTipText );
210 } 211 }
211 mToolTip.sort(); 212 mToolTip.sort();
212 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); 213 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>");
213} 214}
214void KODayMatrix::setCalendar( Calendar *cal ) 215void KODayMatrix::setCalendar( Calendar *cal )
215{ 216{
216 mCalendar = cal; 217 mCalendar = cal;
217 218
218 setAcceptDrops( mCalendar ); 219 setAcceptDrops( mCalendar );
219 220
220 updateEvents(); 221 updateEvents();
221} 222}
222 223
223QColor KODayMatrix::getShadedColor(QColor color) 224QColor KODayMatrix::getShadedColor(QColor color)
224{ 225{
225 QColor shaded; 226 QColor shaded;
226 int h=0; 227 int h=0;
227 int s=0; 228 int s=0;
228 int v=0; 229 int v=0;
229 color.hsv(&h,&s,&v); 230 color.hsv(&h,&s,&v);
230 s = s/4; 231 s = s/4;
231 v = 192+v/4; 232 v = 192+v/4;
232 shaded.setHsv(h,s,v); 233 shaded.setHsv(h,s,v);
233 234
234 return shaded; 235 return shaded;
235} 236}
236 237
237KODayMatrix::~KODayMatrix() 238KODayMatrix::~KODayMatrix()
238{ 239{
239 // delete mKODaymatrixWhatsThis; 240 // delete mKODaymatrixWhatsThis;
240 delete [] days; 241 delete [] days;
241 delete [] daylbls; 242 delete [] daylbls;
242 delete [] events; 243 delete [] events;
243 delete mToolTip; 244 delete mToolTip;
244} 245}
245 246
246/* 247/*
247void KODayMatrix::setStartDate(QDate start) 248void KODayMatrix::setStartDate(QDate start)
248{ 249{
249 updateView(start); 250 updateView(start);
250} 251}
251*/ 252*/
252 253
253void KODayMatrix::addSelectedDaysTo(DateList& selDays) 254void KODayMatrix::addSelectedDaysTo(DateList& selDays)
254{ 255{
255 256
256 if (mSelStart == NOSELECTION) { 257 if (mSelStart == NOSELECTION) {