-rw-r--r-- | korganizer/komonthview.cpp | 57 |
1 files changed, 16 insertions, 41 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 00e5a6f..aeb3974 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -280,19 +280,10 @@ void KNoScrollListBox::mousePressEvent(QMouseEvent *e) | |||
280 | 280 | ||
281 | MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) | 281 | MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s) |
282 | : QListBoxItem() | 282 | : QListBoxItem() |
283 | { | 283 | { |
284 | mDisplayHightlighted = false; | ||
285 | mblockRepaint = true; | 284 | mblockRepaint = true; |
286 | setText( s ); | ||
287 | mMultiday = 0; | ||
288 | mIncidence = incidence; | ||
289 | mDate = qd; | ||
290 | mRecur = false; | ||
291 | mAlarm = false; | ||
292 | mReply = false; | ||
293 | mInfo = false; | ||
294 | mdayPos = 0; | ||
295 | isWeekItem = KOPrefs::instance()->mMonthViewWeek; | 285 | isWeekItem = KOPrefs::instance()->mMonthViewWeek; |
286 | recycle( incidence, s ); | ||
296 | } | 287 | } |
297 | void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) | 288 | void MonthViewItem::recycle( Incidence *incidence, const QString & s) |
298 | { | 289 | { |
@@ -302,15 +293,2 @@ void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) | |||
302 | mIncidence = incidence; | 293 | mIncidence = incidence; |
303 | mDate = qd; | ||
304 | mRecur = false; | ||
305 | mAlarm = false; | ||
306 | mReply = false; | ||
307 | mInfo = false; | ||
308 | mdayPos = 0; | ||
309 | } | ||
310 | void MonthViewItem::clearData() | ||
311 | { | ||
312 | mDisplayHightlighted = false; | ||
313 | setText( "" ); | ||
314 | mMultiday = 0; | ||
315 | mIncidence = 0; | ||
316 | mRecur = false; | 294 | mRecur = false; |
@@ -321,2 +299,3 @@ void MonthViewItem::clearData() | |||
321 | } | 299 | } |
300 | |||
322 | bool MonthViewItem::setHighlightedFalse() | 301 | bool MonthViewItem::setHighlightedFalse() |
@@ -346,3 +325,3 @@ void MonthViewItem::paint(QPainter *p) | |||
346 | { | 325 | { |
347 | if ( mblockRepaint ) { | 326 | if ( mblockRepaint || !mIncidence ) { |
348 | return; | 327 | return; |
@@ -356,3 +335,3 @@ void MonthViewItem::paint(QPainter *p) | |||
356 | int x = 1; | 335 | int x = 1; |
357 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor || mDisplayHightlighted ) | 336 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor || mDisplayHightlighted || sel ) |
358 | { | 337 | { |
@@ -397,3 +376,3 @@ void MonthViewItem::paint(QPainter *p) | |||
397 | int sizeM = size+2; | 376 | int sizeM = size+2; |
398 | p->setBrush( QBrush::SolidPattern ); | 377 | p->setBrush( QBrush( p->pen().color() ) ); |
399 | p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; | 378 | p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; |
@@ -436,3 +415,3 @@ void MonthViewItem::paint(QPainter *p) | |||
436 | int val = td->percentComplete()/20; | 415 | int val = td->percentComplete()/20; |
437 | p->fillRect ( x+1, y-2, val ,size+4,Qt::black ); | 416 | p->fillRect ( x+1, y-2, val ,size+4,p->pen().color() ); |
438 | p->drawRect ( x, y-2,7,size+4); | 417 | p->drawRect ( x, y-2,7,size+4); |
@@ -670,3 +649,3 @@ void MonthViewCell::startUpdateCell() | |||
670 | //item->setHighlightedFalse(); | 649 | //item->setHighlightedFalse(); |
671 | item->clearData(); | 650 | item->recycle( 0, ""); |
672 | CurrentAvailItem = (MonthViewItem *)item->next(); | 651 | CurrentAvailItem = (MonthViewItem *)item->next(); |
@@ -766,5 +745,5 @@ int MonthViewCell::insertEvent(Event *event) | |||
766 | mAvailItemList.remove( item ); | 745 | mAvailItemList.remove( item ); |
767 | item->recycle( event, mDate, text ); | 746 | item->recycle( event, text ); |
768 | } else { | 747 | } else { |
769 | item = new MonthViewItem( event, mDate, text ); | 748 | item = new MonthViewItem( event, text ); |
770 | } | 749 | } |
@@ -796,2 +775,3 @@ int MonthViewCell::insertEvent(Event *event) | |||
796 | } | 775 | } |
776 | pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); | ||
797 | item->setPalette( pal ); | 777 | item->setPalette( pal ); |
@@ -855,5 +835,5 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
855 | mAvailItemList.remove( item ); | 835 | mAvailItemList.remove( item ); |
856 | item->recycle( todo, mDate, text ); | 836 | item->recycle( todo, text ); |
857 | } else { | 837 | } else { |
858 | item = new MonthViewItem( todo, mDate, text ); | 838 | item = new MonthViewItem( todo, text ); |
859 | } | 839 | } |
@@ -886,2 +866,3 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
886 | } | 866 | } |
867 | pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); | ||
887 | item->setPalette( pal ); | 868 | item->setPalette( pal ); |
@@ -1025,9 +1006,3 @@ QDate MonthViewCell::selectedIncidenceDate() | |||
1025 | if ( index < 0 ) return qd; | 1006 | if ( index < 0 ) return qd; |
1026 | 1007 | return mDate; | |
1027 | MonthViewItem *mitem = | ||
1028 | static_cast<MonthViewItem *>( item( index ) ); | ||
1029 | |||
1030 | if ( !mitem ) return qd; | ||
1031 | |||
1032 | return mitem->incidenceDate(); | ||
1033 | } | 1008 | } |