summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
authorzautrix <zautrix>2005-03-21 12:34:49 (UTC)
committer zautrix <zautrix>2005-03-21 12:34:49 (UTC)
commit3b7ba9f46c78816bae8c4b30a455e261d7da9f4a (patch) (unidiff)
treedb85cf3f0520828c358aadc3867705a95fcb9d88 /korganizer/kodaymatrix.cpp
parentb40a7cc0a8cf0bd06b0f404f58e89980d1291beb (diff)
downloadkdepimpi-3b7ba9f46c78816bae8c4b30a455e261d7da9f4a.zip
kdepimpi-3b7ba9f46c78816bae8c4b30a455e261d7da9f4a.tar.gz
kdepimpi-3b7ba9f46c78816bae8c4b30a455e261d7da9f4a.tar.bz2
fixes
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 5133519..9c1f5f3 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -177,12 +177,13 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
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 qDebug("event->isMultiDay() %s", event->summary().latin1() );
183 text = time + event->summary(); 184 text = time + event->summary();
184 mToolTipText += prefix + text; 185 mToolTipText += prefix + text;
185 } else { 186 } else {
186 if (event->doesFloat()) { 187 if (event->doesFloat()) {
187 text = event->summary(); 188 text = event->summary();
188 mToolTipText += text; 189 mToolTipText += text;
@@ -190,15 +191,29 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
190 else { 191 else {
191 text = KGlobal::locale()->formatTime(event->dtStart().time()); 192 text = KGlobal::locale()->formatTime(event->dtStart().time());
192 text += " " + event->summary(); 193 text += " " + event->summary();
193 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); 194 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
194 } 195 }
195 } 196 }
197 if ( !event->location().isEmpty() )
198 mToolTipText += " (" + event->location() + ")";
199#if QT_VERSION >= 0x030000
200 mToolTipText.replace( '<' , "&lt;" );
201 mToolTipText.replace( '>' , "&gt;" );
202#else
203 if ( mToolTipText.find ('<') > 0 ) {
204 mToolTipText.replace( QRegExp("<") , "&lt;" );
205 }
206 if ( mToolTipText.find ('>') > 0 ) {
207 mToolTipText.replace( QRegExp(">") , "&gt;" );
208 }
209#endif
196 mToolTip.append( mToolTipText ); 210 mToolTip.append( mToolTipText );
197 } 211 }
198 mToolTip.sort(); 212 mToolTip.sort();
213 qDebug("%s ", mToolTip.join("<br>").latin1());
199 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); 214 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>");
200} 215}
201void KODayMatrix::setCalendar( Calendar *cal ) 216void KODayMatrix::setCalendar( Calendar *cal )
202{ 217{
203 mCalendar = cal; 218 mCalendar = cal;
204 219
@@ -220,13 +235,13 @@ QColor KODayMatrix::getShadedColor(QColor color)
220 235
221 return shaded; 236 return shaded;
222} 237}
223 238
224KODayMatrix::~KODayMatrix() 239KODayMatrix::~KODayMatrix()
225{ 240{
226 delete mKODaymatrixWhatsThis; 241 // delete mKODaymatrixWhatsThis;
227 delete [] days; 242 delete [] days;
228 delete [] daylbls; 243 delete [] daylbls;
229 delete [] events; 244 delete [] events;
230 delete mToolTip; 245 delete mToolTip;
231} 246}
232 247
@@ -334,17 +349,21 @@ void KODayMatrix::updateViewTimed()
334 numEvents--; 349 numEvents--;
335 } 350 }
336 if ( event->categories().contains( i18n("Holiday") ) || event->categories().contains( "Holiday" )) { 351 if ( event->categories().contains( i18n("Holiday") ) || event->categories().contains( "Holiday" )) {
337 if ( !holiStr.isEmpty() ) 352 if ( !holiStr.isEmpty() )
338 holiStr += "\n"; 353 holiStr += "\n";
339 holiStr += event->summary(); 354 holiStr += event->summary();
355 if ( !event->location().isEmpty() )
356 holiStr += " (" + event->location() + ")";
340 } 357 }
341 if ( event->categories().contains( i18n("Birthday") ) || event->categories().contains( "Birthday" )) { 358 if ( event->categories().contains( i18n("Birthday") ) || event->categories().contains( "Birthday" )) {
342 if ( !holiStr.isEmpty() ) 359 if ( !holiStr.isEmpty() )
343 holiStr += "\n"; 360 holiStr += "\n";
344 holiStr += event->summary(); 361 holiStr += i18n("Birthday") + ": "+event->summary();
362 if ( !event->location().isEmpty() )
363 holiStr += " (" + event->location() + ")";
345 bDays.setBit(i); 364 bDays.setBit(i);
346 } 365 }
347 } 366 }
348 events[i] = numEvents; 367 events[i] = numEvents;
349 //if it is a holy day then draw it red. Sundays are consider holidays, too 368 //if it is a holy day then draw it red. Sundays are consider holidays, too
350 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || 369 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) ||