! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Foreign files: watch for changes
Status:
CLOSED: FIXED
Severity:
enhancement

Comments

Description Colin Leroy 2007-03-26 15:10:45 CEST
Hi,

After experimenting with the Foreign files feature (from bug #2712), I have to say it works pretty well :)

Just one little nitpick: if the foreign file changes (an appointment is added/removed/changed in it during Orage's currently displayed month), the calendar days markings don't get updated. This happens both if the Orage calendar was shown or hidden; if Orage wasn't started, it works correctly :)
Comment 1 juha editbugs 2007-03-26 15:21:20 CEST
True. Orage does not know that the file has been changed. Alarms also do not get
refreshed. I would need to add some kind of file modification monitoring to fix
that....
Comment 2 Colin Leroy 2007-03-26 15:34:38 CEST
Hi,

Maybe using inotify or some thing like that would be a bit overkill for this feature (and would also require dependancies, I believe), but maybe a scanning function, fired intermittently by g_timeout and stat()ing the files, could be OK? I suppose a 30 or 60 second interval check would be enough, to avoid doing unnecessary context switches most of the time... If this second solution is ok with you, I can give a try to a patch if you want :)
Comment 3 juha editbugs 2007-03-26 17:09:49 CEST
Yes, I was planning also that scanner every minute or so.
If you have time to do the patch, I am happy to accept it. 
Your quality last time was great. But I doubt I can add it before the weekend...
Comment 4 Colin Leroy 2007-03-26 17:14:28 CEST
Ok, i'll look at it one of this week's evenings if everything goes well :)
Thanks!
Comment 5 Colin Leroy 2007-03-26 19:27:39 CEST
Created attachment 1062 
Patch to survey mtimes

Hi,

Here's a patch that checks ical files every minute for change. It relies on the mtime field to do so, this has the advantage of being a fast operation.

This patch doesn't solve the corner case of an added or removed foreign file: as it wasn't in the f_ical[] array before, or won't be anymore, the calendar isn't updated. This is the object of a second patch.
Comment 6 Colin Leroy 2007-03-26 19:29:35 CEST
Created attachment 1063 
Refresh after foreign file add/remove

This patch fixes the calendar update after adding/removing a foreign file.
Comment 7 juha editbugs 2007-03-26 21:20:43 CEST
Actually I think patch 2 is not needed; it should work already.
Everything goes through refresh_foreign_files and it calls orage_mark_appointments
but it misses xfical_alarm_build_list(FALSE); which I need to add.

But patch1 looks good and is very welcomed. You are fast! I will apply it soon.

Thanks a million!
Comment 8 juha editbugs 2007-03-26 21:28:04 CEST
and the second patch is needed also since it does nto work when file is
added from command line :)
Comment 9 Colin Leroy 2007-03-27 05:48:26 CEST
(In reply to comment #8)
> and the second patch is needed also since it does nto work when file is
> added from command line :)

Ah yes, that was my problem, you're right - it worked from the GUI only :)
Comment 10 Colin Leroy 2007-03-27 05:49:32 CEST
(In reply to comment #7)

> But patch1 looks good and is very welcomed. You are fast! I will apply it soon.

Wife got an unexpected best-friend-phone-call yesterday evening, I jumped on the chance ;-))
 
> Thanks a million!

Thank you!
Comment 11 juha editbugs 2007-03-27 21:53:25 CEST
Added these fixes into 4.5.9.1 (svn revision 25318).

There were similar issues with import and fixed those, too.
Comment 12 juha editbugs 2007-04-12 08:44:05 CEST
in 4.5.9

Bug #3061

Reported by:
Colin Leroy
Reported on: 2007-03-26
Last modified on: 2007-04-12

People

CC List:
0 users

Version

Version:
unspecified

Attachments

Patch to survey mtimes (3.03 KB, patch)
2007-03-26 19:27 CEST , Colin Leroy
no flags
Refresh after foreign file add/remove (735 bytes, patch)
2007-03-26 19:29 CEST , Colin Leroy
no flags

Additional information