aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-01-30 13:00:22 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-01-30 13:00:22 -0600
commitcc2ad2ad457313cb87e4483bf0278f670a5a5cea (patch)
treeed969267604bf802dc2b22e8c04835cd1ae83708 /src
parentd2caa37e18191c31d866dd3042b676c135bae50d (diff)
downloadayatana-indicator-datetime-cc2ad2ad457313cb87e4483bf0278f670a5a5cea.tar.gz
ayatana-indicator-datetime-cc2ad2ad457313cb87e4483bf0278f670a5a5cea.tar.bz2
ayatana-indicator-datetime-cc2ad2ad457313cb87e4483bf0278f670a5a5cea.zip
as per review, don't inline unless there are performance issues
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/actions-live.cpp5
-rw-r--r--src/appointment.cpp48
-rw-r--r--src/date-time.cpp17
-rw-r--r--src/locations.cpp8
-rw-r--r--src/menu.cpp6
-rw-r--r--src/timezone-file.cpp14
7 files changed, 99 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index eb716d4..d5236ad 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -15,6 +15,7 @@ endif ()
add_library (${SERVICE_LIB} STATIC
actions.cpp
actions-live.cpp
+ appointment.cpp
clock.cpp
clock-live.cpp
date-time.cpp
diff --git a/src/actions-live.cpp b/src/actions-live.cpp
index afd83f4..c0fd8ff 100644
--- a/src/actions-live.cpp
+++ b/src/actions-live.cpp
@@ -31,6 +31,11 @@ namespace datetime {
****
***/
+LiveActions::LiveActions(const std::shared_ptr<State>& state_in):
+ Actions(state_in)
+{
+}
+
void LiveActions::execute_command(const std::string& cmdstr)
{
const auto cmd = cmdstr.c_str();
diff --git a/src/appointment.cpp b/src/appointment.cpp
new file mode 100644
index 0000000..6e742c3
--- /dev/null
+++ b/src/appointment.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 3, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranties of
+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Charles Kerr <charles.kerr@canonical.com>
+ */
+
+#include <datetime/appointment.h>
+
+namespace unity {
+namespace indicator {
+namespace datetime {
+
+/****
+*****
+****/
+
+bool Appointment::operator==(const Appointment& that) const
+{
+ return (color==that.color)
+ && (summary==that.summary)
+ && (url==that.url)
+ && (uid==that.uid)
+ && (is_event==that.is_event)
+ && (has_alarms==that.has_alarms)
+ && (begin==that.begin)
+ && (end==that.end);
+}
+
+/****
+*****
+****/
+
+} // namespace datetime
+} // namespace indicator
+} // namespace unity
diff --git a/src/date-time.cpp b/src/date-time.cpp
index 40c638f..a634c5e 100644
--- a/src/date-time.cpp
+++ b/src/date-time.cpp
@@ -27,6 +27,23 @@ namespace datetime {
****
***/
+DateTime::DateTime(GDateTime* gdt)
+{
+ reset(gdt);
+}
+
+DateTime& DateTime::operator=(GDateTime* gdt)
+{
+ reset(gdt);
+ return *this;
+}
+
+DateTime& DateTime::operator=(const DateTime& that)
+{
+ m_dt = that.m_dt;
+ return *this;
+}
+
DateTime::DateTime(time_t t)
{
GDateTime * gdt = g_date_time_new_from_unix_local(t);
diff --git a/src/locations.cpp b/src/locations.cpp
index 8d1a086..c59f988 100644
--- a/src/locations.cpp
+++ b/src/locations.cpp
@@ -35,6 +35,14 @@ const std::string& Location::name() const
return m_name;
}
+bool Location::operator== (const Location& that) const
+{
+ return (m_name == that.m_name)
+ && (m_zone == that.m_zone)
+ && (m_offset == that.m_offset);
+}
+
+
Location::Location(const std::string& zone_, const std::string& name_):
m_zone(zone_),
m_name(name_)
diff --git a/src/menu.cpp b/src/menu.cpp
index 4bb4fb6..b263520 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -35,6 +35,12 @@ namespace datetime {
*****
****/
+Menu::Menu (Profile profile_in, const std::string& name_in):
+ m_profile(profile_in),
+ m_name(name_in)
+{
+}
+
const std::string& Menu::name() const
{
return m_name;
diff --git a/src/timezone-file.cpp b/src/timezone-file.cpp
index 3a0c240..76737b4 100644
--- a/src/timezone-file.cpp
+++ b/src/timezone-file.cpp
@@ -23,6 +23,20 @@ namespace unity {
namespace indicator {
namespace datetime {
+FileTimezone::FileTimezone()
+{
+}
+
+FileTimezone::FileTimezone(const std::string& filename)
+{
+ setFilename(filename);
+}
+
+FileTimezone::~FileTimezone()
+{
+ clear();
+}
+
void
FileTimezone::clear()
{