Ignore:
Timestamp:
05/05/10 15:58:23 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
525448c
Parents:
0d995ed
Message:

do not draw showmap button for event is there is no map for its room

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/delegate.cpp

    r0d995ed r508de33  
    2424#include <QPainter>
    2525
     26#include "room.h"
     27
    2628const int RADIUS = 10;
    2729const int SPACER = 10;
     
    6163    {
    6264        int aux = option.rect.height() - mControls[FavouriteControlOn]->drawPoint().y() - mControls[FavouriteControlOn]->image()->height();
     65        Event *event = static_cast<Event*>(index.internalPointer());
    6366        // font SMALL
    6467        QFont fontSmall = option.font;
     
    8487
    8588        //Time conflicts are colored differently
    86         if(static_cast<Event*>(index.internalPointer())->hasTimeConflict())
     89        if(event->hasTimeConflict())
    8790            bkgrColor = conflictColor;
    8891
     
    130133        // draw Controls
    131134        // favourite
    132         if(static_cast<Event*>(index.internalPointer())->isFavourite())
     135        if(event->isFavourite())
    133136            painter->drawImage(mControls[FavouriteControlOn]->drawPoint(option.rect),*mControls[FavouriteControlOn]->image());
    134137        else
     
    136139#ifdef MAEMO
    137140        // alarm
    138         if(static_cast<Event*>(index.internalPointer())->hasAlarm())
     141        if(event->hasAlarm())
    139142            painter->drawImage(mControls[AlarmControlOn]->drawPoint(option.rect),*mControls[AlarmControlOn]->image());
    140143        else
     
    142145#endif
    143146        // map
    144         painter->drawImage(mControls[MapControl]->drawPoint(option.rect),*mControls[MapControl]->image());
     147        if (event->room()->hasMap()) {
     148            painter->drawImage(mControls[MapControl]->drawPoint(option.rect),*mControls[MapControl]->image());
     149        }
    145150        // Time conflict
    146         if(static_cast<Event*>(index.internalPointer())->hasTimeConflict())
     151        if(event->hasTimeConflict())
    147152            painter->drawImage(mControls[WarningControl]->drawPoint(option.rect),*mControls[WarningControl]->image());
    148153
    149154        // draw texts
    150         Event *event = static_cast<Event*>(index.internalPointer());
    151155        QPointF titlePointF(mControls[FavouriteControlOn]->drawPoint(option.rect));
    152156        titlePointF.setX(option.rect.x()+SPACER);
Note: See TracChangeset for help on using the changeset viewer.