DCOP broadcasting

Alexander Kellett lypanov at kde.org
Mon Oct 13 20:04:10 BST 2003


On Mon, Oct 13, 2003 at 07:00:57PM +0300, Andras Mantia wrote:
> Thanks for the answer. Actually what we are trying to solve is the crash 
> recovery in Quanta. Quanta creates from time to time a backup file for every 
> opened and modified file. If for some reason Quanta or the system crashes 
> these files may have your latest unsaved content. The problem arises when 
> multiple instances of Quanta are running and the same file was opened in more 
> than one instance. If one instance has crashed and a new one is started we 
> should find out somehow if the created backups belong to a running instance 
> (in which case we don't care about them) or not (in which case it means that 
> the instance which created has crashed and the backup needs to be used). My 
> original idea was to add the PID to each backup file name and just check if 
> there is a quanta process with that PID running or not. But a DCOP solution 
> might be more elegant and this is why I was asking this. Maybe we really need 
> to go the PID way, as that works in more cases (also when using multiple 
> sessions) or I will look at the file locking, if the file gets unlocked when 
> the locking application crashes or not. 
> BTW, a similar crash recovery might be useful in many applications, like in 
> the whole KOffice. Is there something similar implemented? 

konqueror already has one. see the code in
kdelibs/kio/bookmarks/kbookmarkimporter_crash.cc
it uses a custom addition to the konqi dcop interface
to find out if an open konqi is using the crash report 
file. (note the crash logging itself is in konqi)
guess you could just reuse the same sort of thing.

mvg,
Alex




More information about the kde-core-devel mailing list