Bug 299611 - opening a new instance warns about unsaved changes, when there is an autosave of new not yet saved but changed document
Summary: opening a new instance warns about unsaved changes, when there is an autosave...
Status: RESOLVED FIXED
Alias: None
Product: calligracommon
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-08 09:54 UTC by Franz Trischberger
Modified: 2012-05-10 15:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Franz Trischberger 2012-05-08 09:54:29 UTC
This behaviour is common to all calligra apps. To reproduce:
* open (e.g.) calligra sheets
* create a new document
* do some changes - don't save
* wait for at least the timeout set for autosave (in calligra sheets you can change the timeout - change it to 1 minute to not have to wait for so long)
* open another instance of calligra sheets
-> Warning:
An autosaved file for an unnamed document exists in /home/franz/.sheets.autosave.
This file is dated 08.05.12 11:32
Do you want to open it?

I am currently trying to migrate a friend from libreoffice to calligra (mainly DE-integration, compilation time and performance), and he is collecting information in different instances of words/sheets, until he starts to actually write his texts. Having this dialog pop up on every new instance is quite disturbing and unnecessary, because one actually knows about the unsaved documents (closing them will trigger a warning about the unsaved state, too).

Already saved documents with unsaved changes don't trigger this warning on a new instance.

Reproducible: Always
Comment 1 Halla Rempt 2012-05-08 10:08:35 UTC
Hi Franz,

Thanks for the report. This is going to be a bit tricky. We need to figure out whether an unnamed document is open in another instance/process.
Comment 2 Halla Rempt 2012-05-09 14:56:17 UTC
Phew... 

https://git.reviewboard.kde.org/r/104892/ has a patch that fixes most of these issues. It took two days, but the result is, I think, worth it :-).
Comment 3 Halla Rempt 2012-05-10 15:01:17 UTC
Git commit c9b214eca4039debb8d97304cac2857f9f0c95f7 by Boudewijn Rempt.
Committed on 10/05/2012 at 10:53.
Pushed by rempt into branch 'master'.

Fix issues with recovering autosave files

1) X-KDE-NativeExtension can be empty, in that case take mime->mainExtension.

Otherwise our autosave files are called .autosave, and that's not something
the filter's mime detection can handle

2) don't overwrite autosave files when running multiple unnamed modified
documents

3) tag the autosave files with the pid and use dbus to check which processes
that have autosave files are still active; don't offer to recover those

4) show the autosave files in a nice dialog with the ora/odf thumbnail
as a preview, and offer to recover them all.

REVIEW:104892

M  +18   -18   krita/image/kis_group_layer.cc
M  +1    -0    libs/main/CMakeLists.txt
M  +118  -20   libs/main/KoApplication.cpp
A  +254  -0    libs/main/KoAutoSaveRecoveryDialog.cpp     [License: LGPL (v2+)]
A  +51   -0    libs/main/KoAutoSaveRecoveryDialog.h     [License: LGPL (v2+)]
M  +18   -41   libs/main/KoDocument.cpp
M  +7    -7    libs/main/KoDocument.h
M  +1    -4    libs/main/KoMainWindow.cpp

http://commits.kde.org/calligra/c9b214eca4039debb8d97304cac2857f9f0c95f7