Changeset 3cd9fe6 in confclerk_git for src/mvc/event.h


Ignore:
Timestamp:
01/20/17 20:33:09 (6 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
ea8416e
Parents:
8cb2bc7
Message:

favourite is now tristate instead of bool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.h

    r8cb2bc7 r3cd9fe6  
    3636};
    3737
     38
     39enum Favourite {Favourite_no=0, Favourite_weak=2, Favourite_strong=1};
     40
     41
    3842class Event : public OrmRecord<Event>
    3943{
     
    6064    QString type() const { return value("type").toString(); }
    6165    QString language() const { return value("language").toString(); }
    62     bool isFavourite() const { return value("favourite").toBool(); }
     66    Favourite favourite() const { return static_cast<Favourite>(value("favourite").toInt()); }
     67    bool isFavourite() const { return favourite() > 0; } // deprecated
    6368    bool hasAlarm() const { return value("alarm").toBool(); }
    6469    bool hasTimeConflict() const;
     
    8287    void setType(const QString & type) { setValue("type", type); }
    8388    void setLanguage(const QString & language) { setValue("language", language); }
    84     void setFavourite(bool favourite) { setValue("favourite", (int)((favourite))); }
     89    void setFavourite(Favourite favourite) { setValue("favourite", (int) favourite); }
     90    void setFavourite(bool favourite) { setFavourite(favourite ? Favourite_strong : Favourite_no); } // deprecated
    8591    void setHasAlarm(bool alarm) { setValue("alarm", (int)((alarm))); }
    8692    void setTag(const QString& tag) { setValue("tag", tag); }
Note: See TracChangeset for help on using the changeset viewer.