[Fwd: Re: [gedit-list] file monitoring]



[I inadvertitely omitted gedit-list, forwarding since someone else may
be interested]
--- Begin Message ---
Il giorno mer, 20/07/2005 alle 00.17 +0200, Stefan Seegel ha scritto:
> Hi everyone !
> 
> There is a feature i would like to see in gedit: file monitoring.
> When a file changes in the filesystem while it's opened by gedit, i
> would like to have a nedit-like "reload?"-dialog.
> At first the right way to add this feature seemed to me to be a plugin.
> Since a plugin has access to the filename, it's simple to set up a
> gnome-vfs monitor.

Yes, file monitoring is a feature that we've been considering for quite
some time. In fact there is a report about in bugzilla and if I recall
correctly it even contains a patch, albeit probably old.
The problem is that using gnome-vfs monitor leads to some headaches and
that's why the feature never went in. In particular there are problems
with monitoring when the file is not local or is on a removeble media
(these may have improved recently with gamin and inotify). Beside
special care must be taken during save since "saving" actually works by
creating a new file and switching it to old name.

There are also UI problems to be considered: getting a dialog with the
notification of the change of a file which isn't in the current tab is
annoying.

> But file saving is a problem, hence my question: is it possible for a
> plugin to get to know about file saves (wich result in change-events) ?
> Or has this feature to be implemented in gedit itself ?
> I don't want to be asked to reload files i've just saved ;-)
> 

It should be possible to track the saving by connecting to GeditDocument
saving signal, but if it is implemented I think it should go in gedit
itself not in a plugin.
If you want to give it a try and you need some pointers to orientate in
the codebase, just ask me (here on irc). In that case working on the
new_mdi branch (our developement branch) may be a better idea.

Anyway as I said above we are not sure that file-monitoring is reliable
enough... an alternative is checking the mtime when a tab is raised and
compare it with the one of the file and if needed notify the user: this
solution doesn't need monitoring and solves the UI issue pointed out
above.


ciao
	Paolo

> Thanks in advance,
> Stefan Seegel
> 
> _______________________________________________
> gedit-list mailing list
> gedit-list gnome org
> http://mail.gnome.org/mailman/listinfo/gedit-list

--- End Message ---


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]