Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ set (PACKAGE ${CMAKE_PROJECT_NAME})
option(ENABLE_TESTS "Enable all tests and checks" OFF)
option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF)
option(ENABLE_WERROR "Treat all build warnings as errors" OFF)
option(ENABLE_LOMIRI_FEATURES "Build with Lomiri-specific libraries, schemas, media and backend" OFF)
option(ENABLE_LOMIRI_FEATURES "Build with Lomiri-specific libraries, schemas, media" OFF)
option(ENABLE_MKCAL "Use mkcal (libmkcal-qt5) instead of Evolution Data Server backend ( default )" OFF)


if(ENABLE_COVERAGE)
set(ENABLE_TESTS ON)
Expand Down Expand Up @@ -76,7 +78,6 @@ if (ENABLE_LOMIRI_FEATURES)
lomiri-url-dispatcher>=0
lomiri-sounds
lomiri-schemas
libmkcal-qt5
)

pkg_get_variable(ALARM_DEFAULT_SOUND lomiri-sounds alarm_default_sound)
Expand All @@ -89,25 +90,38 @@ if (ENABLE_LOMIRI_FEATURES)
-DALARM_DEFAULT_SOUND="${ALARM_DEFAULT_SOUND}"
-DCALENDAR_DEFAULT_SOUND="${CALENDAR_DEFAULT_SOUND}"
)
else ()

add_definitions (
-DALARM_DEFAULT_SOUND="dummy"
-DCALENDAR_DEFAULT_SOUND="dummy"
)

set (ALARM_DEFAULT_SOUND "dummy")
endif ()

if (ENABLE_MKCAL)
list (
APPEND
SERVICE_DEPS
libmkcal-qt5
)
find_package (ECM REQUIRED NO_MODULE)
list (APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
find_package (KF5 COMPONENTS CalendarCore REQUIRED)
add_definitions (
-DHAS_MKCAL
)

else ()
# default is EDS
list (
APPEND
SERVICE_DEPS
libecal-2.0>=3.16
libedataserver-1.2>=3.5
libical>=0.48
)

add_definitions (
-DALARM_DEFAULT_SOUND="dummy"
-DCALENDAR_DEFAULT_SOUND="dummy"
)

set (ALARM_DEFAULT_SOUND "dummy")
endif ()

pkg_check_modules (SERVICE_DEPS REQUIRED ${SERVICE_DEPS})
Expand Down
6 changes: 3 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Build-Depends: cmake,
libgstreamer1.0-dev,
libmessaging-menu-dev,
uuid-dev,
# for non-Lomiri ICS data storage backend
# for EDS data storage backend
libecal2.0-dev (>= 3.16),
libical-dev (>= 1.0),
libedataserver1.2-dev (>= 3.5),
# for Lomiri ICS data storage backend
# for mkcal data storage backend
libkf5calendarcore-dev,
libmkcal-qt5-dev,
# more Lomiri features
Expand Down Expand Up @@ -91,7 +91,7 @@ Description: Lomiri Indicator providing clock and calendar
Lomiri, this indicator supports phone devices.
.
This variant of the datetime indicator has been built for using
msyncd (mkcal) as ICS data storage backend.
evolution-data-server as ICS data storage backend.

Package: ayatana-indicator-datetime-common
Architecture: any
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set (SERVICE_CXX_SOURCES
wakeup-timer-mainloop.cpp
wakeup-timer-powerd.cpp)

if (ENABLE_LOMIRI_FEATURES)
if (ENABLE_MKCAL)
list (APPEND SERVICE_CXX_SOURCES engine-mkcal.cpp)
else ()
list (APPEND SERVICE_CXX_SOURCES engine-eds.cpp)
Expand Down Expand Up @@ -80,7 +80,7 @@ endif()
include_directories (${CMAKE_SOURCE_DIR})
link_directories (${SERVICE_DEPS_LIBRARY_DIRS})

if (ENABLE_LOMIRI_FEATURES)
if (ENABLE_MKCAL)
set_source_files_properties (engine-mkcal.cpp PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
target_link_libraries (${SERVICE_LIB} KF5::CalendarCore)
target_compile_definitions (${SERVICE_LIB} PRIVATE -DQT_DEBUG -DQT_MESSAGELOGCONTEXT)
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ target_link_libraries (${TEST_NAME} indicatordatetimeservice ${SERVICE_DEPS_LIBR

find_program(DBUS_RUNNER dbus-test-runner)

if (ENABLE_LOMIRI_FEATURES)
if (ENABLE_MKCAL)
function(add_eds_ics_test_by_name name)
set (TEST_NAME ${name})
set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE)
Expand Down
4 changes: 2 additions & 2 deletions tests/test-eds-ics-all-day-events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)

// what we expect to get...
Appointment expected_appt;
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
expected_appt.uid = "20150521T111538Z-7449-1000-3572-0@ghidorah";
#else
expected_appt.uid = "51340540-a924-468e-b3ee-0c0f222cd0f8";
Expand All @@ -102,7 +102,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)
EXPECT_PRED3([](auto sColourIn, auto sColourExpected1, auto sColourExpected2)
{
return sColourIn == sColourExpected1 || sColourIn == sColourExpected2;
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
}, appt.color, "#becedd", "#62a0ea");
#else
}, appt.color, "#0000FF", "");
Expand Down
8 changes: 4 additions & 4 deletions tests/test-eds-ics-missing-trigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TEST_F(VAlarmFixture, MissingTriggers)
std::vector<Appointment> expected1;
Appointment a1;
a1.type = Appointment::ALARM;
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
a1.uid = "20150617T211838Z-6217-32011-2036-1@lomiri-phablet";
a1.color = "#becedd";
#else
Expand All @@ -99,7 +99,7 @@ TEST_F(VAlarmFixture, MissingTriggers)
expected1.push_back(a1);

// build expected: recurring alarm 1
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
a1.uid = "20150617T211913Z-6217-32011-2036-5@lomiri-phablet";
#else
a1.uid = "3b45cbc9-d5c3-49a4-ad29-acc776818259";
Expand Down Expand Up @@ -130,7 +130,7 @@ TEST_F(VAlarmFixture, MissingTriggers)
std::vector<Appointment> expected2;
Appointment a2;
a2.type = Appointment::ALARM;
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
a2.uid = "20150617T211838Z-6217-32011-2036-1@lomiri-phablet";
a2.color = "#62a0ea";
#else
Expand All @@ -147,7 +147,7 @@ TEST_F(VAlarmFixture, MissingTriggers)
expected2.push_back(a2);

// build expected: recurring alarm 2
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
a2.uid = "20150617T211913Z-6217-32011-2036-5@lomiri-phablet";
#else
a2.uid = "3b45cbc9-d5c3-49a4-ad29-acc776818259";
Expand Down
4 changes: 2 additions & 2 deletions tests/test-eds-ics-nonrepeating-events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)

// what we expect to get...
Appointment expected_appt;
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
expected_appt.uid = "20150520T000726Z-3878-32011-1770-81@lomiri-phablet";
#else
expected_appt.uid = "d7aeb192-8b2c-4427-834f-f30388e9e73c";
Expand All @@ -103,7 +103,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)
EXPECT_PRED3([](auto sColourIn, auto sColourExpected1, auto sColourExpected2)
{
return sColourIn == sColourExpected1 || sColourIn == sColourExpected2;
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
}, appt.color, "#becedd", "#62a0ea");
#else
}, appt.color, "#0000FF", "");
Expand Down
4 changes: 2 additions & 2 deletions tests/test-eds-ics-repeating-events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)

// what we expect to get...
Appointment expected_appt;
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
expected_appt.uid = "20150507T211449Z-4262-32011-1418-1@lomiri-phablet";
#else
expected_appt.uid = "840ab899-1b0e-4697-9514-dcd336a5e125";
Expand Down Expand Up @@ -110,7 +110,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)
EXPECT_PRED3([](auto sColourIn, auto sColourExpected1, auto sColourExpected2)
{
return sColourIn == sColourExpected1 || sColourIn == sColourExpected2;
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
}, appt.color, "#becedd", "#62a0ea");
#else
}, appt.color, "#0000FF", "");
Expand Down
4 changes: 2 additions & 2 deletions tests/test-eds-ics-tzids-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)
// what we expect to get...
std::array<Appointment,1> expected_appts1;
auto appt1 = &expected_appts1[0];
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
appt1->uid = "109264742";
appt1->color = "#becedd";
#else
Expand All @@ -95,7 +95,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)

std::array<Appointment,1> expected_appts2;
auto appt2 = &expected_appts2[0];
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
appt2->uid = "109264742";
appt2->color = "#62a0ea";
#else
Expand Down
4 changes: 2 additions & 2 deletions tests/test-eds-ics-tzids-utc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TEST_F(VAlarmFixture, UTCAppointments)
// what we expect to get...
std::array<Appointment,1> expected_appts1;
auto appt1 = &expected_appts1[0];
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
appt1->uid = "20160322T132738Z";
appt1->color = "#becedd";
#else
Expand All @@ -95,7 +95,7 @@ TEST_F(VAlarmFixture, UTCAppointments)

std::array<Appointment,1> expected_appts2;
auto appt2 = &expected_appts2[0];
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
appt2->uid = "20160322T132738Z";
appt2->color = "#62a0ea";
#else
Expand Down
4 changes: 2 additions & 2 deletions tests/test-eds-ics-tzids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)
// what we expect to get...
std::array<Appointment,1> expected_appts1;
auto appt1 = &expected_appts1[0];
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
appt1->uid = "[email protected]";
appt1->color = "#becedd";
#else
Expand All @@ -94,7 +94,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)

std::array<Appointment,1> expected_appts2;
auto appt2 = &expected_appts2[0];
#ifndef LOMIRI_FEATURES_ENABLED
#ifndef HAS_MKCAL
appt2->uid = "[email protected]";
appt2->color = "#62a0ea";
#else
Expand Down