autosave

Jens Dagerbo jens.dagerbo at gmail.com
Wed Apr 4 13:19:20 UTC 2007


On 4/4/07, Kris Wong <wongk at seapine.com> wrote:
> > Here's a quick stab at autosave for KDevelop3.
> >
> > The implementation is straightforward and the only curious thing is
> probably
> > the m_isSaving flag. It's needed to weed out a corner case where if a
> file
> > has been externally modified and the autosave kicks in, KDevelop will
> show a
> > messagebox asking the user for confirmation. Without this flag to keep
> track
> > of this state, the messagebox will be launched again and again (for
> every
> > autosave) and this is potentially really bad.
> >
> > I put the configuration in Settings -> Configure KDevelop -> Editor.
> >
> > Opinions? Worth applying?
>
> W/o having applied the patch yet, I can think of a few times when I
> wished KDevelop had this feature.  Seems fairly isolated, not much
> chance of a regression.  It get's my vote. =]
>

The one thing I'm cautious of.. there are probably moments when it's
not safe to call the saveAll action. If they exist they could be
triggered manually as well, but the likelihood of a bad coincidence
probably increases with an automatic action like this one.

I'm thinking of cases including processEvents() ("Make Member") or the
times we intentionally return to the UI thread during a lenghty
operation (many examples). What if autosave kicks in during project
load or unload? Disabling/Enabling autosave for these cases isn't
really realistic, since they could be based anywhere in the code.

Unlikely corner cases for sure, but still...

// jens




More information about the KDevelop-devel mailing list