diff options
author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2016-03-30 21:41:08 -0300 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-07-05 00:44:12 +0200 |
commit | 05564ab71ebdadbb100ffac690d278c9982224f5 (patch) | |
tree | fd061edc7a7e548d845ba1a731e5ca04d42e9f04 | |
parent | 031e8a963225ca2ab560224944c7636668a70838 (diff) | |
download | ayatana-indicator-datetime-05564ab71ebdadbb100ffac690d278c9982224f5.tar.gz ayatana-indicator-datetime-05564ab71ebdadbb100ffac690d278c9982224f5.tar.bz2 ayatana-indicator-datetime-05564ab71ebdadbb100ffac690d278c9982224f5.zip |
Create a constructor for Alarm class.
-rw-r--r-- | include/datetime/appointment.h | 9 | ||||
-rw-r--r-- | src/appointment.cpp | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index 5b4c27e..14adb5d 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -42,7 +42,14 @@ struct Alarm std::string text; std::string audio_url; DateTime time; - int type; + int type = TEXT; + + Alarm(const std::string &text_, const std::string &audio_url_, const DateTime & time_, int type_ = TEXT) + : text(text_), audio_url(audio_url_), time(time_), type(type_) + {} + + Alarm() + {} bool operator== (const Alarm& that) const; bool has_sound() const; diff --git a/src/appointment.cpp b/src/appointment.cpp index ebd5a47..a6800dd 100644 --- a/src/appointment.cpp +++ b/src/appointment.cpp @@ -29,7 +29,8 @@ namespace datetime { bool Alarm::operator==(const Alarm& that) const { - return (text==that.text) + return (type==that.type) + && (text==that.text) && (audio_url==that.audio_url) && (this->time==that.time); } |