diff options
Diffstat (limited to 'lib-common')
-rw-r--r-- | lib-common/inc/Common/Model/Alarm.h | 6 | ||||
-rw-r--r-- | lib-common/src/Common/Model/Alarm.cpp | 12 | ||||
-rw-r--r-- | lib-common/src/Common/Model/AlarmBuilder.cpp | 2 |
3 files changed, 4 insertions, 16 deletions
diff --git a/lib-common/inc/Common/Model/Alarm.h b/lib-common/inc/Common/Model/Alarm.h index 8c62520..e0561a2 100644 --- a/lib-common/inc/Common/Model/Alarm.h +++ b/lib-common/inc/Common/Model/Alarm.h @@ -44,11 +44,6 @@ namespace Common Alarm &operator=(const Alarm &that); /** - * @return Database ID. - */ - int getId() const; - - /** * @return Alarm time and date. */ const tm &getDate() const; @@ -125,7 +120,6 @@ namespace Common void onDataCallbackAdded(data_control_h provider, data_control_error_e result, int callbackId); - int m_Id; tm m_Date; int m_Repeat; bool m_IsEnabled; diff --git a/lib-common/src/Common/Model/Alarm.cpp b/lib-common/src/Common/Model/Alarm.cpp index 282a0db..cf023de 100644 --- a/lib-common/src/Common/Model/Alarm.cpp +++ b/lib-common/src/Common/Model/Alarm.cpp @@ -30,9 +30,8 @@ using namespace Common::Model; Alarm::Alarm() - : m_Id(0), m_Repeat(0), m_IsEnabled(true), - m_SnoozeDate{0}, m_SnoozeCount(0), m_IsSnoozed(false), - m_ChangeCallbackId(0) + : m_Repeat(0), m_IsEnabled(true), m_SnoozeDate{0}, + m_SnoozeCount(0), m_IsSnoozed(false), m_ChangeCallbackId(0) { setTime(DEFAULT_TIME); } @@ -50,7 +49,7 @@ Alarm::Alarm(const Alarm &that) Alarm &Alarm::operator=(const Alarm &that) { if (this != &that) { - m_Id = that.m_Id; + setId(that.getId()); m_Date = that.m_Date; m_Repeat = that.m_Repeat; m_IsEnabled = that.m_IsEnabled; @@ -63,11 +62,6 @@ Alarm &Alarm::operator=(const Alarm &that) return *this; } -int Alarm::getId() const -{ - return m_Id; -} - const tm &Alarm::getDate() const { return m_Date; diff --git a/lib-common/src/Common/Model/AlarmBuilder.cpp b/lib-common/src/Common/Model/AlarmBuilder.cpp index b65aff6..12655d3 100644 --- a/lib-common/src/Common/Model/AlarmBuilder.cpp +++ b/lib-common/src/Common/Model/AlarmBuilder.cpp @@ -53,7 +53,7 @@ Alarm *AlarmBuilder::createAlarm(result_set_cursor cursor) data_control_sql_get_int_data(cursor, i, &value); if (strcmp(name, COLUMN_ID) == 0) { - alarm->m_Id = value; + alarm->setId(value); } else if (strcmp(name, COLUMN_DATE) == 0) { alarm->m_Date = *localtime((time_t *) &value); } else if (strcmp(name, COLUMN_REPEAT) == 0) { |