Kate – GSoC Summary

Hello planet,

As Google Summer of Code is now finished and I have successfully passed the final evaluation, I would like to give a brief description of my project.

Kate is now able to recover (most of) what was written after last save in case of a crash or power failure. A swap file is created after the first editing action on a document that was successfully saved. If the user closes the document normally or saves its content, the swap file is deleted, otherwise, if Kate crashes, it remains on the disk. On load, Kate searches for the swap file, and if it exists, a warning bar pops from the top and provides the user with three possibilities: recover the lost data, discard the swap file or view differences between the original data and the recovered one. If the user chooses to restore the lost data, the editing actions from the swap file are replayed over the current content of the document. If somehow the swap file is not valid, for example a finishEditing statement is missing, the recovery is done, but the user is warned that it might be incomplete.

Only the core feature for swap file is implemented at the moment. I know I could have done more, but things went slow at the beginning, as I was new to Qt and KDE development and also had a demanding exam period. But this has a positive aspect, too, as will motivate me to continue my work at this project.

This has been a great summer for me as I was accepted into GSoC program and got a chance to do what I like and get paid for it. I want to thank Christoph, my mentor, for having patience with me and helping me with all the problems I have encountered. I also want to thank the whole Kate team, KDE community and Google :).

8 thoughts on “Kate – GSoC Summary”

  1. This is very useful, thanks for your work!
    I don’t use Kate myself, but I wish there were such a functionality eg. i OpenOffice.org which crashes quite often with me, making me swear like a sailor for the lost work of the last minutes.

  2. Sounds great! Thanks for your work!

    Do you think more applications could benefit from your work? Kile, Kdevelop come to my mind. IIRC kdevelop also has a way to recover data in case of crash. However, using a common framework has the usual advantages (e.g. maintenance). And a recovery framework in kdelibs(?) might also be beneficial for koffice applications, too (though they need to implement their own diff view).

  3. One thing which annoys me a lot in Vim is that it asks whether I want to recover a file even when the recovered file is identical to the file currently on disk. Does your feature detect that the final file will be the same as the original and just silently delete the swap file?

  4. dianat Wrote:
    “I also want to thank the whole Kate team, KDE community and Google”

    And I, as an end-user, would like to to thank you for a very useful contribution! Good work, I hope you keep on contributing to Kate.

  5. Thank you for this feature! I was wondering why Kate doesn’t have autosave and finally found your article and tested the feature out. This is actually better, becaue sometimes you don’t want the program saving a change you made esp when programming or scripting, but by saving the sawp file in case of a crash, it gives the user the chance to recover lost data. Now I just have to remember to save the file in the first place… : /

Leave a Reply