From b1031b1de834f246bba806cd51bfbb22f5c15b16 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Thu, 31 Mar 2016 15:51:29 -0300 Subject: Remove type property from Alarm. --- src/appointment.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/appointment.cpp') diff --git a/src/appointment.cpp b/src/appointment.cpp index e014a85..ebd5a47 100644 --- a/src/appointment.cpp +++ b/src/appointment.cpp @@ -27,22 +27,21 @@ namespace datetime { ***** ****/ -Alarm::Alarm() - : type(Alarm::None) +bool Alarm::operator==(const Alarm& that) const { + return (text==that.text) + && (audio_url==that.audio_url) + && (this->time==that.time); } -Alarm::Alarm(int type_, const std::string &text_, const std::string& audio_url_, const DateTime &time_) - : type(type_), text(text_), audio_url(audio_url_), time(time_) +bool Alarm::has_sound() const { + return !audio_url.empty(); } -bool Alarm::operator==(const Alarm& that) const +bool Alarm::has_text() const { - return (type==that.type) - && (text==that.text) - && (audio_url==that.audio_url) - && (this->time==that.time); + return !text.empty(); } bool Appointment::operator==(const Appointment& that) const -- cgit v1.2.3