diff options
-rw-r--r-- | .build.yml | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | include/datetime/actions-live.h | 17 | ||||
-rw-r--r-- | include/datetime/actions.h | 12 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/actions-live.cpp | 126 | ||||
-rw-r--r-- | src/actions.cpp | 64 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/actions-mock.h | 44 | ||||
-rw-r--r-- | tests/test-actions.cpp | 16 | ||||
-rw-r--r-- | tests/test-live-actions.cpp | 23 |
13 files changed, 108 insertions, 214 deletions
@@ -41,7 +41,6 @@ requires: - libecal2.0-dev - libical-dev - libedataserver1.2-dev - - liblomiri-url-dispatcher-dev - libproperties-cpp-dev # for the test harness: - libgtest-dev @@ -74,7 +73,6 @@ requires: - libecal2.0-dev - libical-dev - libedataserver1.2-dev - - liblomiri-url-dispatcher-dev - libproperties-cpp-dev ubuntu:focal: diff --git a/CMakeLists.txt b/CMakeLists.txt index 8451544..5cbe59f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,17 +61,6 @@ pkg_check_modules (SERVICE_DEPS REQUIRED libaccounts-glib>=1.18) include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS}) -set(URL_DISPATCHER_REQUIRED_VERSION 0) -pkg_check_modules(URLDISPATCHER - lomiri-url-dispatcher>=${URL_DISPATCHER_REQUIRED_VERSION} -) -include_directories(${URLDISPATCHER_INCLUDE_DIRS}) - -# url-dispatcher support is optional... -if(URLDISPATCHER_FOUND) - add_definitions( -DHAS_URLDISPATCHER ) -endif() - # lomiri-app-launch pkg_check_modules(LOMIRIAPPLAUNCH lomiri-app-launch>=0) diff --git a/debian/control b/debian/control index 0ede198..a45596d 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,6 @@ Build-Depends: cmake, libical-dev (>= 1.0), libedataserver1.2-dev (>= 3.5), accountsservice-ubuntu-schemas | hello, - liblomiri-url-dispatcher-dev | hello, libproperties-cpp-dev, # for the test harness: libgtest-dev <!nocheck>, diff --git a/include/datetime/actions-live.h b/include/datetime/actions-live.h index 1f84659..1eb34ec 100644 --- a/include/datetime/actions-live.h +++ b/include/datetime/actions-live.h @@ -40,21 +40,16 @@ public: virtual ~LiveActions() =default; bool desktop_has_calendar_app() const override; - void desktop_open_alarm_app() override; - void desktop_open_appointment(const Appointment&, const DateTime&) override; - void desktop_open_calendar_app(const DateTime&) override; - void desktop_open_settings_app() override; - - void phone_open_alarm_app() override; - void phone_open_appointment(const Appointment&, const DateTime &) override; - void phone_open_calendar_app(const DateTime&) override; - void phone_open_settings_app() override; + void open_alarm_app() override; + void open_appointment(const Appointment&, const DateTime&) override; + void open_calendar_app(const DateTime&) override; + void open_settings_app() override; void set_location(const std::string& zone, const std::string& name) override; protected: - virtual void execute_command(const std::string& command); - virtual void dispatch_url(const std::string& url); + + void lomiri_open_appointment(const Appointment& appt, const DateTime& date); }; } // namespace datetime diff --git a/include/datetime/actions.h b/include/datetime/actions.h index ea163e4..d866b00 100644 --- a/include/datetime/actions.h +++ b/include/datetime/actions.h @@ -44,15 +44,11 @@ class Actions public: virtual bool desktop_has_calendar_app() const =0; - virtual void desktop_open_alarm_app() =0; - virtual void desktop_open_appointment(const Appointment&, const DateTime&) =0; - virtual void desktop_open_calendar_app(const DateTime&) =0; - virtual void desktop_open_settings_app() =0; - virtual void phone_open_alarm_app() =0; - virtual void phone_open_appointment(const Appointment&, const DateTime&) =0; - virtual void phone_open_calendar_app(const DateTime&) =0; - virtual void phone_open_settings_app() =0; + virtual void open_alarm_app() =0; + virtual void open_appointment(const Appointment&, const DateTime&) =0; + virtual void open_calendar_app(const DateTime&) =0; + virtual void open_settings_app() =0; virtual void set_location(const std::string& zone, const std::string& name)=0; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 96284fb..823a9b8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,5 +70,5 @@ link_directories (${SERVICE_DEPS_LIBRARY_DIRS}) add_executable (${SERVICE_EXEC} main.cpp) set_source_files_properties(${SERVICE_SOURCES} main.cpp PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -g -std=c++11") -target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${GCOV_LIBS} ${URLDISPATCHER_LIBRARIES}) +target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${GCOV_LIBS}) install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}) diff --git a/src/actions-live.cpp b/src/actions-live.cpp index e3237b7..11643cd 100644 --- a/src/actions-live.cpp +++ b/src/actions-live.cpp @@ -20,14 +20,15 @@ #include <datetime/dbus-shared.h> #include <datetime/actions-live.h> -#ifdef HAS_URLDISPATCHER -#include <lomiri-url-dispatcher.h> -#endif - #include <glib.h> #include <sstream> +extern "C" +{ + #include <ayatana/common/utils.h> +} + namespace ayatana { namespace indicator { namespace datetime { @@ -41,53 +42,55 @@ LiveActions::LiveActions(const std::shared_ptr<State>& state_in): { } -void LiveActions::execute_command(const std::string& cmdstr) -{ - const auto cmd = cmdstr.c_str(); - g_debug("Issuing command '%s'", cmd); +/*** +**** +***/ - GError* error = nullptr; - if (!g_spawn_command_line_async(cmd, &error)) +void LiveActions::open_alarm_app() +{ + if (ayatana_common_utils_is_lomiri()) { - g_warning("Unable to start \"%s\": %s", cmd, error->message); - g_error_free(error); + ayatana_common_utils_open_url("appid://com.lomiri.clock/clock/current-user-version"); + } + else + { + ayatana_common_utils_execute_command("evolution -c calendar"); } } -void LiveActions::dispatch_url(const std::string& url) +void LiveActions::open_calendar_app(const DateTime& dt) { - g_debug("Dispatching url '%s'", url.c_str()); -#ifdef HAS_URLDISPATCHER - lomiri_url_dispatch_send(url.c_str(), nullptr, nullptr); -#else - // FIXME: Deal with this, if we build without liburl-dispatcher... -#endif + if (ayatana_common_utils_is_lomiri()) + { + const auto utc = dt.to_timezone("UTC"); + auto cmd = utc.format("calendar://startdate=%Y-%m-%dT%H:%M:%S+00:00"); + ayatana_common_utils_open_url(cmd.c_str()); + } + else + { + const auto utc = dt.start_of_day().to_timezone("UTC"); + auto cmd = utc.format("evolution \"calendar:///?startdate=%Y%m%dT%H%M%SZ\""); + ayatana_common_utils_execute_command(cmd.c_str()); + } } -/*** -**** -***/ - -void LiveActions::desktop_open_settings_app() +void LiveActions::open_settings_app() { - if (g_getenv ("MIR_SOCKET") != nullptr) + if (ayatana_common_utils_is_lomiri()) + { + ayatana_common_utils_open_url("settings:///system/time-date"); + } + else if (ayatana_common_utils_is_unity()) { - dispatch_url("settings:///system/time-date"); + ayatana_common_utils_execute_command("unity-control-center datetime"); + } + else if (ayatana_common_utils_is_mate()) + { + ayatana_common_utils_execute_command("mate-time-admin"); } else { - if ((g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)) - { - execute_command("unity-control-center datetime"); - } - else if ((g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "MATE") == 0)) - { - execute_command("mate-time-admin"); - } - else - { - execute_command("gnome-control-center datetime"); - } + ayatana_common_utils_execute_command("gnome-control-center datetime"); } } @@ -123,64 +126,25 @@ bool LiveActions::desktop_has_calendar_app() const return have_calendar; } -void LiveActions::desktop_open_alarm_app() -{ - execute_command("evolution -c calendar"); -} - -void LiveActions::desktop_open_appointment(const Appointment&, const DateTime& date) -{ - desktop_open_calendar_app(date); -} - -void LiveActions::desktop_open_calendar_app(const DateTime& dt) -{ - const auto utc = dt.start_of_day().to_timezone("UTC"); - auto cmd = utc.format("evolution \"calendar:///?startdate=%Y%m%dT%H%M%SZ\""); - execute_command(cmd.c_str()); -} - -/*** -**** -***/ - -void LiveActions::phone_open_alarm_app() -{ - dispatch_url("appid://com.ubuntu.clock/clock/current-user-version"); -} - -void LiveActions::phone_open_appointment(const Appointment& appt, const DateTime& date) +void LiveActions::open_appointment(const Appointment& appt, const DateTime& date) { - if (!appt.activation_url.empty()) { - dispatch_url(appt.activation_url); + ayatana_common_utils_open_url(appt.activation_url.c_str()); } else switch (appt.type) { case Appointment::UBUNTU_ALARM: - phone_open_alarm_app(); + open_alarm_app(); break; case Appointment::EVENT: default: - phone_open_calendar_app(date); + open_calendar_app(date); break; } } -void LiveActions::phone_open_calendar_app(const DateTime& dt) -{ - const auto utc = dt.to_timezone("UTC"); - auto cmd = utc.format("calendar://startdate=%Y-%m-%dT%H:%M:%S+00:00"); - dispatch_url(cmd); -} - -void LiveActions::phone_open_settings_app() -{ - dispatch_url("settings:///system/time-date"); -} - /*** **** ***/ diff --git a/src/actions.cpp b/src/actions.cpp index ea68d3e..315340a 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -62,7 +62,7 @@ bool lookup_appointment_by_uid(const std::shared_ptr<State>& state, const gchar* return false; } -void on_desktop_appointment_activated (GSimpleAction*, GVariant *vdata, gpointer gself) +void on_appointment_activated (GSimpleAction*, GVariant *vdata, gpointer gself) { auto self = static_cast<Actions*>(gself); Appointment appt; @@ -70,44 +70,20 @@ void on_desktop_appointment_activated (GSimpleAction*, GVariant *vdata, gpointer gint64 time = 0; g_variant_get(vdata, "(&sx)", &uid, &time); if (lookup_appointment_by_uid(self->state(), uid, appt)) - self->desktop_open_appointment(appt, DateTime::Local(time)); + self->open_appointment(appt, DateTime::Local(time)); } -void on_desktop_alarm_activated (GSimpleAction*, GVariant*, gpointer gself) +void on_alarm_activated (GSimpleAction*, GVariant*, gpointer gself) { - static_cast<Actions*>(gself)->desktop_open_alarm_app(); + static_cast<Actions*>(gself)->open_alarm_app(); } -void on_desktop_calendar_activated (GSimpleAction*, GVariant* vt, gpointer gself) +void on_calendar_activated (GSimpleAction*, GVariant* vt, gpointer gself) { const auto dt = datetime_from_timet_variant(vt); - static_cast<Actions*>(gself)->desktop_open_calendar_app(dt); + static_cast<Actions*>(gself)->open_calendar_app(dt); } -void on_desktop_settings_activated (GSimpleAction*, GVariant*, gpointer gself) +void on_settings_activated (GSimpleAction*, GVariant*, gpointer gself) { - static_cast<Actions*>(gself)->desktop_open_settings_app(); -} - -void on_phone_appointment_activated (GSimpleAction*, GVariant *vdata, gpointer gself) -{ - auto self = static_cast<Actions*>(gself); - Appointment appt; - const gchar* uid = nullptr; - gint64 time = 0; - g_variant_get(vdata, "(&sx)", &uid, &time); - if (lookup_appointment_by_uid(self->state(), uid, appt)) - self->phone_open_appointment(appt, DateTime::Local(time)); -} -void on_phone_alarm_activated (GSimpleAction*, GVariant*, gpointer gself) -{ - static_cast<Actions*>(gself)->phone_open_alarm_app(); -} -void on_phone_calendar_activated (GSimpleAction*, GVariant* vt, gpointer gself) -{ - const auto dt = datetime_from_timet_variant(vt); - static_cast<Actions*>(gself)->phone_open_calendar_app(dt); -} -void on_phone_settings_activated (GSimpleAction*, GVariant*, gpointer gself) -{ - static_cast<Actions*>(gself)->phone_open_settings_app(); + static_cast<Actions*>(gself)->open_settings_app(); } void on_set_location(GSimpleAction * /*action*/, @@ -135,9 +111,9 @@ void on_calendar_active_changed(GSimpleAction * /*action*/, } } -void on_calendar_activated(GSimpleAction * /*action*/, - GVariant * state, - gpointer gself) +void on_calendar_date_activated(GSimpleAction * /*action*/, + GVariant * state, + gpointer gself) { const time_t t = g_variant_get_int64(state); @@ -199,15 +175,15 @@ Actions::Actions(const std::shared_ptr<State>& state): { GActionEntry entries[] = { - { "desktop.open-appointment", on_desktop_appointment_activated, "(sx)", nullptr }, - { "desktop.open-alarm-app", on_desktop_alarm_activated }, - { "desktop.open-calendar-app", on_desktop_calendar_activated, "x", nullptr }, - { "desktop.open-settings-app", on_desktop_settings_activated }, + { "desktop.open-appointment", on_appointment_activated, "(sx)", nullptr }, + { "desktop.open-alarm-app", on_alarm_activated }, + { "desktop.open-calendar-app", on_calendar_activated, "x", nullptr }, + { "desktop.open-settings-app", on_settings_activated }, - { "phone.open-appointment", on_phone_appointment_activated, "(sx)", nullptr }, - { "phone.open-alarm-app", on_phone_alarm_activated }, - { "phone.open-calendar-app", on_phone_calendar_activated, "x", nullptr }, - { "phone.open-settings-app", on_phone_settings_activated }, + { "phone.open-appointment", on_appointment_activated, "(sx)", nullptr }, + { "phone.open-alarm-app", on_alarm_activated }, + { "phone.open-calendar-app", on_calendar_activated, "x", nullptr }, + { "phone.open-settings-app", on_settings_activated }, { "calendar-active", nullptr, nullptr, "false", on_calendar_active_changed }, { "set-location", on_set_location, "s" } @@ -241,7 +217,7 @@ Actions::Actions(const std::shared_ptr<State>& state): v = create_calendar_state(state); a = g_simple_action_new_stateful("calendar", G_VARIANT_TYPE_INT64, v); g_action_map_add_action(gam, G_ACTION(a)); - g_signal_connect(a, "activate", G_CALLBACK(on_calendar_activated), this); + g_signal_connect(a, "activate", G_CALLBACK(on_calendar_date_activated), this); g_object_unref(a); /// diff --git a/src/main.cpp b/src/main.cpp index 729f0e5..034a5ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -157,7 +157,7 @@ main(int /*argc*/, char** /*argv*/) snooze_planner->add(appointment, alarm); }; auto on_ok = [actions](const Appointment& app, const Alarm&){ - actions->phone_open_appointment(app, app.begin); + actions->open_appointment(app, app.begin); }; auto on_alarm_reached = [&engine, &snap, &on_snooze, &on_ok](const Appointment& appointment, const Alarm& alarm) { (*snap)(appointment, alarm, on_snooze, on_ok); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4b9a804..5c44ba3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,7 +44,7 @@ function(add_test_by_name name) set (TEST_NAME ${name}) add_executable (${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled) add_test (${TEST_NAME} ${TEST_NAME}) - target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS} ${URLDISPATCHER_LIBRARIES}) + target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS}) endfunction() add_test_by_name(test-datetime) if(HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS) diff --git a/tests/actions-mock.h b/tests/actions-mock.h index 346a8f6..a02a7e2 100644 --- a/tests/actions-mock.h +++ b/tests/actions-mock.h @@ -34,14 +34,10 @@ public: explicit MockActions(const std::shared_ptr<State>& state_in): Actions(state_in) {} ~MockActions() =default; - enum Action { DesktopOpenAlarmApp, - DesktopOpenAppt, - DesktopOpenCalendarApp, - DesktopOpenSettingsApp, - PhoneOpenAlarmApp, - PhoneOpenAppt, - PhoneOpenCalendarApp, - PhoneOpenSettingsApp, + enum Action { OpenAlarmApp, + OpenAppt, + OpenCalendarApp, + OpenSettingsApp, SetLocation }; const std::vector<Action>& history() const { return m_history; } @@ -54,36 +50,20 @@ public: bool desktop_has_calendar_app() const { return m_desktop_has_calendar_app; } - void desktop_open_alarm_app() { - m_history.push_back(DesktopOpenAlarmApp); + void open_alarm_app() { + m_history.push_back(OpenAlarmApp); } - void desktop_open_appointment(const Appointment& appt, const DateTime& dt) { + void open_appointment(const Appointment& appt, const DateTime& dt) { m_appt = appt; m_date_time = dt; - m_history.push_back(DesktopOpenAppt); + m_history.push_back(OpenAppt); } - void desktop_open_calendar_app(const DateTime& dt) { + void open_calendar_app(const DateTime& dt) { m_date_time = dt; - m_history.push_back(DesktopOpenCalendarApp); + m_history.push_back(OpenCalendarApp); } - void desktop_open_settings_app() { - m_history.push_back(DesktopOpenSettingsApp); - } - - void phone_open_alarm_app() { - m_history.push_back(PhoneOpenAlarmApp); - } - void phone_open_appointment(const Appointment& appt, const DateTime& dt) { - m_appt = appt; - m_date_time = dt; - m_history.push_back(PhoneOpenAppt); - } - void phone_open_calendar_app(const DateTime& dt) { - m_date_time = dt; - m_history.push_back(PhoneOpenCalendarApp); - } - void phone_open_settings_app() { - m_history.push_back(PhoneOpenSettingsApp); + void open_settings_app() { + m_history.push_back(OpenSettingsApp); } void set_location(const std::string& zone_, const std::string& name_) { diff --git a/tests/test-actions.cpp b/tests/test-actions.cpp index 96da7cc..a01fb83 100644 --- a/tests/test-actions.cpp +++ b/tests/test-actions.cpp @@ -176,25 +176,25 @@ TEST_F(ActionsFixture, ActionsExist) TEST_F(ActionsFixture, DesktopOpenAlarmApp) { test_action_with_no_args("desktop.open-alarm-app", - MockActions::DesktopOpenAlarmApp); + MockActions::OpenAlarmApp); } TEST_F(ActionsFixture, DesktopOpenAppointment) { test_action_with_appt_arg("desktop.open-appointment", - MockActions::DesktopOpenAppt); + MockActions::OpenAppt); } TEST_F(ActionsFixture, DesktopOpenCalendarApp) { test_action_with_time_arg("desktop.open-calendar-app", - MockActions::DesktopOpenCalendarApp); + MockActions::OpenCalendarApp); } TEST_F(ActionsFixture, DesktopOpenSettingsApp) { test_action_with_no_args("desktop.open-settings-app", - MockActions::DesktopOpenSettingsApp); + MockActions::OpenSettingsApp); } /*** @@ -204,25 +204,25 @@ TEST_F(ActionsFixture, DesktopOpenSettingsApp) TEST_F(ActionsFixture, PhoneOpenAlarmApp) { test_action_with_no_args("phone.open-alarm-app", - MockActions::PhoneOpenAlarmApp); + MockActions::OpenAlarmApp); } TEST_F(ActionsFixture, PhoneOpenAppointment) { test_action_with_appt_arg("phone.open-appointment", - MockActions::PhoneOpenAppt); + MockActions::OpenAppt); } TEST_F(ActionsFixture, PhoneOpenCalendarApp) { test_action_with_time_arg("phone.open-calendar-app", - MockActions::PhoneOpenCalendarApp); + MockActions::OpenCalendarApp); } TEST_F(ActionsFixture, PhoneOpenSettingsApp) { test_action_with_no_args("phone.open-settings-app", - MockActions::PhoneOpenSettingsApp); + MockActions::OpenSettingsApp); } /*** diff --git a/tests/test-live-actions.cpp b/tests/test-live-actions.cpp index d38893f..12ef362 100644 --- a/tests/test-live-actions.cpp +++ b/tests/test-live-actions.cpp @@ -29,12 +29,9 @@ class MockLiveActions: public LiveActions public: std::string last_cmd; std::string last_url; + explicit MockLiveActions(const std::shared_ptr<State>& state_in): LiveActions(state_in) {} ~MockLiveActions() {} - -protected: - void dispatch_url(const std::string& url) override { last_url = url; } - void execute_command(const std::string& cmd) override { last_cmd = cmd; } }; class TestLiveActionsFixture: public TimedatedFixture @@ -112,7 +109,7 @@ TEST_F(TestLiveActionsFixture, SetLocation) TEST_F(TestLiveActionsFixture, DesktopOpenAlarmApp) { - m_actions->desktop_open_alarm_app(); + m_actions->open_alarm_app(); const std::string expected = "evolution -c calendar"; EXPECT_EQ(expected, m_live_actions->last_cmd); } @@ -122,21 +119,21 @@ TEST_F(TestLiveActionsFixture, DesktopOpenAppointment) Appointment a; a.uid = "some-uid"; a.begin = DateTime::NowLocal(); - m_actions->desktop_open_appointment(a, a.begin); + m_actions->open_appointment(a, a.begin); const std::string expected_substr = "evolution \"calendar:///?startdate="; EXPECT_NE(m_live_actions->last_cmd.find(expected_substr), std::string::npos); } TEST_F(TestLiveActionsFixture, DesktopOpenCalendarApp) { - m_actions->desktop_open_calendar_app(DateTime::NowLocal()); + m_actions->open_calendar_app(DateTime::NowLocal()); const std::string expected_substr = "evolution \"calendar:///?startdate="; EXPECT_NE(m_live_actions->last_cmd.find(expected_substr), std::string::npos); } TEST_F(TestLiveActionsFixture, DesktopOpenSettingsApp) { - m_actions->desktop_open_settings_app(); + m_actions->open_settings_app(); const std::string expected_substr = "control-center"; EXPECT_NE(m_live_actions->last_cmd.find(expected_substr), std::string::npos); } @@ -152,7 +149,7 @@ namespace TEST_F(TestLiveActionsFixture, PhoneOpenAlarmApp) { - m_actions->phone_open_alarm_app(); + m_actions->open_alarm_app(); EXPECT_EQ(clock_app_url, m_live_actions->last_url); } @@ -165,19 +162,19 @@ TEST_F(TestLiveActionsFixture, PhoneOpenAppointment) a.begin = DateTime::NowLocal(); a.type = Appointment::EVENT; auto ocurrenceDate = DateTime::Local(2014, 1, 1, 0, 0, 0); - m_actions->phone_open_appointment(a, ocurrenceDate); + m_actions->open_appointment(a, ocurrenceDate); const std::string appointment_app_url = ocurrenceDate.to_timezone("UTC").format("calendar://startdate=%Y-%m-%dT%H:%M:%S+00:00"); EXPECT_EQ(appointment_app_url, m_live_actions->last_url); a.type = Appointment::UBUNTU_ALARM; - m_actions->phone_open_appointment(a, a.begin); + m_actions->open_appointment(a, a.begin); EXPECT_EQ(clock_app_url, m_live_actions->last_url); } TEST_F(TestLiveActionsFixture, PhoneOpenCalendarApp) { auto now = DateTime::NowLocal(); - m_actions->phone_open_calendar_app(now); + m_actions->open_calendar_app(now); const std::string expected = now.to_timezone("UTC").format("calendar://startdate=%Y-%m-%dT%H:%M:%S+00:00"); EXPECT_EQ(expected, m_live_actions->last_url); } @@ -185,7 +182,7 @@ TEST_F(TestLiveActionsFixture, PhoneOpenCalendarApp) TEST_F(TestLiveActionsFixture, PhoneOpenSettingsApp) { - m_actions->phone_open_settings_app(); + m_actions->open_settings_app(); const std::string expected = "settings:///system/time-date"; EXPECT_EQ(expected, m_live_actions->last_url); } |