Changeset 1343ea4 for src/mvc/event.cpp


Ignore:
Timestamp:
01/20/17 23:04:17 (5 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
81d87d7
Parents:
ec7fa22
Message:

Now the conflict severity is drawn.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    rec7fa22 r1343ea4  
    193193}
    194194
    195 bool Event::hasTimeConflict() const
    196 {
    197     if(favourite() == Favourite_no) // if it's not favourite, it can't have time-conflict
    198         return false;
    199 
    200     return conflictEvents(id(),conferenceId()).count() > 0;
     195Favourite Event::timeConflict() const {
     196    if (favourite() == Favourite_no) // if it's not favourite, it can't have time-conflict
     197        return Favourite_no;
     198
     199    QList<Event> events = conflictEvents(id(),conferenceId());
     200
     201    // find "strongest" conflict
     202    Favourite f = Favourite_no;
     203    for (int i = 0; i != events.size(); ++i) {
     204        switch (events[i].favourite()) {
     205        case Favourite_strong: f = Favourite_strong; break;
     206        case Favourite_weak: if (f == Favourite_no) f = Favourite_weak; break;
     207        case Favourite_no: break;
     208        }
     209    }
     210    return f;
     211
    201212}
    202213
Note: See TracChangeset for help on using the changeset viewer.