Clock applet multiple data sources#1565
Conversation
Replace the monolithic EDS-only calendar-sources.c with an extensible provider architecture: - Add CalendarProvider abstract base class with virtual vtable and signals (appointments-changed, tasks-changed) - Add CalendarEDSProvider: absorbs all EDS/calendar-sources logic, guarded by HAVE_EDS - Add CalendarVdirProvider: reads vdir collections (vdirsyncer format), expands recurrences via libical-glib, watches directories with GFileMonitor, guarded by HAVE_LIBICAL - Rewrite CalendarClient as a thin aggregator over a list of providers - Auto-discover vdirsyncer default path (~/.local/share/vdirsyncer/) and allow extra paths via new GSettings key vdir-calendar-paths - Add HAVE_LIBICAL autoconf check for libical-glib >= 3.0 (independent of EDS; EDS implies it) - Update calendar-window.c guards from HAVE_EDS to HAVE_EDS || HAVE_LIBICAL so vdir events show without EDS Remove calendar-sources.c/h (functionality absorbed into calendar-eds-provider.c). Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
- Update #ifdef HAVE_EDS guards in clock.c to #if defined(HAVE_EDS) || defined(HAVE_LIBICAL) so the calendar client is created and passed to the calendar window when only libical is available (no EDS) - Fix calendar_vdir_discover() to recurse one level into subdirectories that are not themselves vdir collections, matching vdirsyncer's layout: <base>/<pair-name>/<collection-name>/ Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
Add applets/clock/README.md describing both calendar backends: - Evolution Data Server integration (appointments and tasks) - vdir/vdirsyncer support: auto-discovery, extra paths via GSettings, setup instructions, recurring events, and collection metadata Add optional dependency entries for EDS and libical-glib to the top-level README. Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
- Add libecal2.0-dev, libedataserver1.2-dev, libical-glib-dev to Debian/Ubuntu dependency list - Add evolution-data-server, libical to Arch dependency list - Add -DHAVE_EDS, -DHAVE_LIBICAL, -DLIBICAL_GLIB_UNSTABLE_API to cppcheck defines so the new calendar provider code paths are analysed - Add libecal-2.0 and libical-glib to cppcheck pkg-config packages for correct include paths Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
meeting titles were displayed as <b>event title</b> in the tooltip. Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
e_source_get_display_name is the correct method. Previously,
the code showd the protocol type ("caldav", "local", etc.)
Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
i_cal_time_subtract() and i_cal_duration_as_int() were removed in newer
libical-glib (as shipped on Arch Linux). Replace them with:
- direct i_cal_time_as_timet() subtraction for DTEND − DTSTART
- a portable ical_duration_as_secs() helper built from the individual
i_cal_duration_get_{weeks,days,hours,minutes,seconds}() accessors
Property getter functions (i_cal_property_get_dtstart etc.) changed
their parameter from ICalProperty * to const ICalProperty * in newer
releases, making them incompatible as function-pointer arguments on both
old and new versions simultaneously. Add thin prop_get_dt{start,end}/
prop_get_{due,completed} wrappers typed as ICalTime *(*)(ICalProperty *)
so the call sites compile cleanly against either API.
Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
lukefromdc
left a comment
There was a problem hiding this comment.
I do not know how to use vdirsyncer, I normally use text files on the desktop to manage events (primitive but hard to forget) so without a gui option to invoke it from the clock, I was unable to test that functionally. Didn't interfere with Evolution, though I have an empty calendar so obscure problems might not show up.
The line
password = "yourpassword"
in the example config file is a security hazard if users are supposed to store their login password (which gives ROOT access if they have sudo allowed!) in it!
Without it, on running
vdirsyncer discover my_calendar
I get
Discovering collections for pair my_calendar
my_local:
warning: Failed to discover collections for my_remote, use `-vdebug` to see the full traceback.
error: Unknown error occurred: Cannot connect to host your-caldav-server:443 ssl:default [Name or service not known]
error: Use `-vdebug` to see the full traceback.
luke@ubuntu:~$ vdirsyncer discover my_calendar -vdebug
Usage: vdirsyncer discover [OPTIONS] [PAIRS]...
Try 'vdirsyncer discover -h' for help.
vdirsyncer sync asks me to run the previous command, and no change seen anywhere in the calendar.
|
Thanks for testing! Then in the configuration: It replicates vdirsyncher documentation in here, but it's going to spare a few minutes for users of mate desktop and make it more secure. I can add it too. |
|
For test purposes, is there any way to set this up to run without calling the user's
password at all? If not, being able to prompt for it and not retain it should be
enough BUT it remains an unnecessary risk. No guarantee I will be able to
test this for function given the complexity of doing so.
After all, if the calendar is sensitive the whole /home directory
needs to be encrypted.
|
Building on top of the work for getting events from EDS, I added the option to read events from vdir.
This is useful for people who don't want to install evolution just for getting calendar events shown in the applet. Also, it requires less RAM (no background process, as vdirsyncher can be launched using cron or a systemd user unit files).
This is my 3rd attempt to implement this feature (previous attempts not published), I hope this time I got it right,