aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/engine-eds.cpp28
-rw-r--r--tests/CMakeLists.txt34
-rwxr-xr-xtests/run-eds-test.sh3
-rw-r--r--tests/test-eds-tasks-config-files/.local/share/evolution/tasks/system/tasks.ics18
4 files changed, 52 insertions, 31 deletions
diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp
index e1424d7..e662b3d 100644
--- a/src/engine-eds.cpp
+++ b/src/engine-eds.cpp
@@ -506,12 +506,24 @@ private:
const DateTime begin_dt { gtz, begin };
const DateTime end_dt { gtz, end };
- g_debug ("got appointment from %s to %s, uid %s status %d",
- begin_dt.format("%F %T %z").c_str(),
- end_dt.format("%F %T %z").c_str(),
+ g_debug ("got appointment from %zu (%s) to %zu (%s), uid %s status %d",
+ begin, begin_dt.format("%F %T %z").c_str(),
+ end, end_dt.format("%F %T %z").c_str(),
uid,
(int)status);
+e_cal_component_commit_sequence(component);
+g_debug("%s e_cal_component_commit_sequence: %s", G_STRLOC, e_cal_component_get_as_string(component)); // FIXME leaks
+ECalComponentDateTime eccdt;
+e_cal_component_get_dtstart(component, &eccdt);
+const bool is_floating_time = eccdt.tzid == nullptr;
+g_debug("%s is_floating_time is %d", G_STRLOC, (int)is_floating_time);
+g_debug("%s dtstart is %s", G_STRLOC, icaltime_as_ical_string(*(eccdt.value)));
+g_debug("%s icaltime_as_timet(dtstart) is %zu", G_STRLOC, icaltime_as_timet(*eccdt.value));
+g_debug("%s icaltime_as_timet_with_zone(dtstart, %s) is %zu", G_STRLOC, location, icaltime_as_timet_with_zone(*eccdt.value, subtask->default_timezone));
+g_debug("%s dtstart as a DateTime is %s", G_STRLOC, DateTime(gtz, icaltime_as_timet(*eccdt.value)).format("%F %T %z").c_str());
+
+
// look for the in-house tags
bool disabled = false;
Appointment::Type type = Appointment::EVENT;
@@ -542,7 +554,7 @@ private:
auto icc = e_cal_component_get_icalcomponent(component); // component owns icc
if (icc)
{
- g_debug("%s", icalcomponent_as_ical_string(icc)); // libical owns this string; no leak
+ g_debug("%s icalcomponent_as_ical_string: %s", G_STRLOC, icalcomponent_as_ical_string(icc)); // libical owns this string; no leak
auto icalprop = icalcomponent_get_first_property(icc, ICAL_X_PROPERTY);
while (icalprop)
@@ -571,7 +583,7 @@ private:
const_cast<ECalComponentAlarmAction*>(omit.data()),
e_cal_client_resolve_tzid_cb,
subtask->client,
- subtask->default_timezone);
+ is_floating_time ? nullptr : subtask->default_timezone);
std::map<DateTime,Alarm> alarms;
@@ -582,6 +594,12 @@ private:
auto ai = static_cast<ECalComponentAlarmInstance*>(l->data);
auto a = e_cal_component_get_alarm(component, ai->auid);
+g_debug("%s auid(%s), trigger(%zu), occur_start(%zu), occur_end(%zu)", G_STRLOC, ai->auid, ai->trigger, ai->occur_start, ai->occur_end);
+g_debug("%s trigger as a DateTime('%s',%zu) is %s", G_STRLOC, location, ai->trigger, DateTime(gtz, ai->trigger).format("%F %T %z").c_str());
+auto local = DateTime::Local(ai->trigger);
+g_debug("%s trigger as a DateTime::Local(%zu) is %s", G_STRLOC, ai->trigger, local.format("%F %T %z").c_str());
+g_debug("%s ..and then to_timezone('%s') is %s", G_STRLOC, location, local.to_timezone(location).format("%F %T %z").c_str());
+
if (a != nullptr)
{
const DateTime alarm_begin{gtz, ai->trigger};
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index cd68dbf..ecbda42 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -45,21 +45,21 @@ function(add_test_by_name name)
add_test (${TEST_NAME} ${TEST_NAME})
target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})
endfunction()
-add_test_by_name(test-datetime)
-add_test_by_name(test-snap)
-add_test_by_name(test-actions)
-add_test_by_name(test-alarm-queue)
-add_test(NAME dear-reader-the-next-test-takes-60-seconds COMMAND true)
-add_test_by_name(test-clock)
-add_test_by_name(test-exporter)
-add_test_by_name(test-formatter)
-add_test_by_name(test-live-actions)
-add_test_by_name(test-locations)
-add_test_by_name(test-menus)
-add_test_by_name(test-planner)
-add_test_by_name(test-settings)
-add_test_by_name(test-timezone-file)
-add_test_by_name(test-utils)
+#add_test_by_name(test-datetime)
+#add_test_by_name(test-snap)
+#add_test_by_name(test-actions)
+#add_test_by_name(test-alarm-queue)
+#add_test(NAME dear-reader-the-next-test-takes-60-seconds COMMAND true)
+#add_test_by_name(test-clock)
+#add_test_by_name(test-exporter)
+#add_test_by_name(test-formatter)
+#add_test_by_name(test-live-actions)
+#add_test_by_name(test-locations)
+#add_test_by_name(test-menus)
+#add_test_by_name(test-planner)
+#add_test_by_name(test-settings)
+#add_test_by_name(test-timezone-file)
+#add_test_by_name(test-utils)
set (TEST_NAME manual-test-snap)
add_executable (${TEST_NAME} ${TEST_NAME}.cpp)
@@ -93,8 +93,8 @@ function(add_eds_test_by_name name)
${GVFSD} # arg7: gvfsd exec
${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}-config-files) # arg8: canned config files
endfunction()
-#add_eds_test_by_name(test-eds-tasks)
-add_eds_test_by_name(test-eds-valarms)
+add_eds_test_by_name(test-eds-tasks)
+#add_eds_test_by_name(test-eds-valarms)
diff --git a/tests/run-eds-test.sh b/tests/run-eds-test.sh
index 0183350..a9eceed 100755
--- a/tests/run-eds-test.sh
+++ b/tests/run-eds-test.sh
@@ -32,6 +32,9 @@ export XDG_VIDEOS_DIR=${TEST_TMP_DIR}
export QORGANIZER_EDS_DEBUG=On
export GIO_USE_VFS=local # needed to ensure GVFS shuts down cleanly after the test is over
+export G_MESSAGES_DEBUG=all
+export G_DBUS_DEBUG=messages
+
echo HOMEDIR=${HOME}
rm -rf ${XDG_DATA_HOME}
diff --git a/tests/test-eds-tasks-config-files/.local/share/evolution/tasks/system/tasks.ics b/tests/test-eds-tasks-config-files/.local/share/evolution/tasks/system/tasks.ics
index efde5f7..1d6dc7a 100644
--- a/tests/test-eds-tasks-config-files/.local/share/evolution/tasks/system/tasks.ics
+++ b/tests/test-eds-tasks-config-files/.local/share/evolution/tasks/system/tasks.ics
@@ -2,24 +2,24 @@ BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Ximian//NONSGML Evolution Calendar//EN
VERSION:2.0
-X-EVOLUTION-DATA-REVISION:2015-05-07T21:14:49.315443Z(0)
+X-EVOLUTION-DATA-REVISION:2015-05-19T22:52:41.612439Z(53)
BEGIN:VTODO
-UID:20150507T211449Z-4262-32011-1418-1@ubuntu-phablet
-DTSTAMP:20150508T211449Z
-DTSTART:20150508T164000
-RRULE:FREQ=WEEKLY;BYDAY=FR
+UID:20150519T225233Z-3878-32011-1770-73@ubuntu-phablet
+DTSTAMP:20150519T225241Z
+DTSTART:20150520T120000
+RRULE:FREQ=DAILY
SUMMARY:Alarm
CATEGORIES:x-canonical-alarm
-CREATED:20150507T211449Z
-LAST-MODIFIED:20150507T211449Z
+SEQUENCE:1
+LAST-MODIFIED:20150519T225241Z
BEGIN:VALARM
-X-EVOLUTION-ALARM-UID:20150507T211449Z-4262-32011-1418-2@ubuntu-phablet
+X-EVOLUTION-ALARM-UID:20150519T225241Z-3878-32011-1770-78@ubuntu-phablet
ACTION:AUDIO
ATTACH:file:///usr/share/sounds/ubuntu/ringtones/Suru arpeggio.ogg
TRIGGER;VALUE=DURATION;RELATED=START:PT0S
END:VALARM
BEGIN:VALARM
-X-EVOLUTION-ALARM-UID:20150507T211449Z-4262-32011-1418-3@ubuntu-phablet
+X-EVOLUTION-ALARM-UID:20150519T225241Z-3878-32011-1770-79@ubuntu-phablet
ACTION:DISPLAY
DESCRIPTION:Alarm
TRIGGER;VALUE=DURATION;RELATED=START:PT0S