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
20 changes: 11 additions & 9 deletions io.elementary.tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@
],
"config-opts": [
"-DCMAKE_BUILD_TYPE=RelWithDebInfo",
"-DBUILD_SHARED_LIBS=ON",
"-DICAL_GLIB=true",
"-DICAL_GLIB_VAPI=true",
"-DGOBJECT_INTROSPECTION=true",
"-DICAL_BUILD_DOCS=false"
"-DCMAKE_INSTALL_LIBDIR=/app/lib",
"-DLIBICAL_CXX_BINDINGS=false",
"-DLIBICAL_JAVA_BINDINGS=false",
"-DLIBICAL_GOBJECT_INTROSPECTION=true",
"-DLIBICAL_BUILD_DOCS=false",
"-DLIBICAL_GLIB_VAPI=true",
"-DLIBICAL_BUILD_TESTING=false"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/libical/libical/releases/download/v3.0.20/libical-3.0.20.tar.gz",
"sha256": "e73de92f5a6ce84c1b00306446b290a2b08cdf0a80988eca0a2c9d5c3510b4c2"
"url": "https://github.com/libical/libical/releases/download/v4.0.5/libical-4.0.5.tar.gz",
"sha256": "cc09a3ac41d60e6144e644bd3fcf97d47106d659c4a0b8965102581401e67c9c"
}
]
},
Expand Down Expand Up @@ -74,8 +76,8 @@
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/evolution-data-server/3.56/evolution-data-server-3.56.2.tar.xz",
"sha256": "df4ec29950f29a76eac6fbe0f814c48d2cef7d3fdb905002a4a883dd761ce93c"
"url": "https://download.gnome.org/sources/evolution-data-server/3.62/evolution-data-server-3.62.0.tar.xz",
"sha256": "78be88e9a511f5afe7ff2e363eade84b622dd0282647fc576edb2d4ff2962cba"
}
],
"modules": [
Expand Down
7 changes: 6 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ config_file = configure_file(
)

libecal_dep = dependency('libecal-2.0')
libical_dep = dependency('libical-glib')

tasks_deps = [
dependency('glib-2.0', version: '>=2.68'),
Expand All @@ -37,7 +38,7 @@ tasks_deps = [
dependency('libedataserver-1.2'),
dependency('libgeoclue-2.0'),
dependency('shumate-1.0'),
dependency('libical-glib'),
libical_dep,
dependency('libportal'),
dependency('libportal-gtk4')
]
Expand All @@ -56,6 +57,10 @@ else
tasks_deps += meson.get_compiler('vala').find_library('libecal-2.0-fixes', dirs: meson.current_source_dir() / 'vapi')
endif

if libical_dep.version().version_compare('>=4.0.0')
add_project_arguments('--define=HAS_I_CAL_4_0_0', language: 'vala')
endif

executable(
meson.project_name(),
config_file,
Expand Down
4 changes: 4 additions & 0 deletions src/TaskModel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,11 @@ public class Tasks.TaskModel : Object {
if (today.compare (start) > 0) {
start = today;
}
#if HAS_I_CAL_4_0_0
var end = ICal.Duration.extend (start, duration);
#else
var end = start.add (duration);
#endif /* HAS_I_CAL_4_0_0 */

ECal.RecurInstanceCb recur_instance_callback = (instance_comp, instance_start_timet, instance_end_timet, cancellable) => {

Expand Down
4 changes: 4 additions & 0 deletions src/Util.vala
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ namespace Tasks.Util {
* order of tasks like we have on iOS devices.
*/
public ICal.Duration get_apple_sortorder_default_value (ECal.Component ecalcomponent) {
#if HAS_I_CAL_4_0_0
return ICal.Duration.from_times (ecalcomponent.get_created (), new ICal.Time.from_string ("20010101T000000Z"));
#else
return ecalcomponent.get_created ().subtract (new ICal.Time.from_string ("20010101T000000Z"));
#endif /* HAS_I_CAL_4_0_0 */
}


Expand Down
8 changes: 8 additions & 0 deletions src/Views/ListView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,20 @@ public class Tasks.ListView : Granite.Bin {
} else {
var apple_sortorder_a = Util.get_apple_sortorder_property_value (row_a.task);
if (apple_sortorder_a == null) {
#if HAS_I_CAL_4_0_0
apple_sortorder_a = Util.get_apple_sortorder_default_value (row_a.task).as_seconds ().to_string ();
#else
apple_sortorder_a = Util.get_apple_sortorder_default_value (row_a.task).as_int ().to_string ();
#endif /* HAS_I_CAL_4_0_0 */
}

var apple_sortorder_b = Util.get_apple_sortorder_property_value (row_b.task);
if (apple_sortorder_b == null) {
#if HAS_I_CAL_4_0_0
apple_sortorder_b = Util.get_apple_sortorder_default_value (row_b.task).as_seconds ().to_string ();
#else
apple_sortorder_b = Util.get_apple_sortorder_default_value (row_b.task).as_int ().to_string ();
#endif /* HAS_I_CAL_4_0_0 */
}

return apple_sortorder_a.collate (apple_sortorder_b);
Expand Down