Closing program gracefully on receiving signal & version control on config files.

Gunter Schelfhout gunter.schelfhout at
Wed Dec 17 08:39:46 GMT 2008

Op Saturday 13 December 2008 18:00:49 schreef Thiago Macieira:
> Gunter Schelfhout wrote:
> >Wouldn't it be a good thing that any program which has an open file in a
> >dirty state to close gracefully upon receiving a certain and well
> > documented signal?
> >Kspread, Kword, Kate, or any other program should then save the file to
> > a default destination directory and set an option so the program knows
> > upon next start that there was a saving of the document after receiving
> > a signal and closing the application. (dirty bit/option)
> We already have KAutoSave file, which is written so that, at next
> startup, the program will notice that there were unsaved changes.
> Obviously, it's up to each application to write the code to support that.

In a discussion elsewhere, somebody gave me this quote about Vista:
"Restart Manager: 
Using the
Application Recovery and Restart APIs in conjunction with the Restart
Manager enables applications to control what actions are taken on their
behalf by the system when they fail or crash such as recovering unsaved
data or documents, restarting the application, and diagnosing and
reporting the problem using Windows Error Reporting."

Now, in my opinion, this is something good they did.
It would be nice to have the same functionality in de core libs of KDE so 
the application developers can make use of it.
When it is integrated in the core, the developers don't have to code it 
themself and it is consistent for all applications which make or want to 
make use of it.

It has always been bad when one loses some unsaved data, but it is worse 
when a well consistent developed and advanced desktop like KDE doesn't have 
something to prevent that. And it is not only about unsaved files, but any 
For example, if knode is crashing, all the postings which are marked as 
read, will lose this status upon next start.

It would make KDE so much more mature and hardened.

> However, none of those applications react to signals. We could do that
> via D-Bus for instance, including properly saving the file if that's what
> you wanted, or discard completely.
> So I don't think Unix signals are the best option.

I'm not a developer (just an amateur admin), but a user should be able to 
trigger the same via ordinary signals via the normal sysadmin tools.
Maybe some core proces (kdeinit?) should be able to achieve this via the 
D-bus, but there should also be some 'thing' which catches certain signals 
to trigger the same behaviour.
After all, a crash is noted via the signals as well, no?

Thanks for the response. 
As I said, I'm not a developer, so I cannot code it, but it doesn't hurt to 
give my opinion or ideas.


Gunter Schelfhout

More information about the kde-core-devel mailing list