Bug 351932 - The 'File Was Deleted on Disk' dialogues don't make sense
Summary: The 'File Was Deleted on Disk' dialogues don't make sense
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 5.0.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on: 117283
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-29 11:44 UTC by Bauke
Modified: 2016-09-07 20:34 UTC (History)
0 users

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 Bauke 2015-08-29 11:44:32 UTC
When a file that is open in kate is deleted, a dialogue pops up telling that it was deleted. The provided choices don't make much sense. It is unclear what 'ignore changes' does. Luckily a warning dialogue pops up explaining that option once chosen, however, the explanation doesn't make sense either as it talks about overwriting the file. The other option 'save as', would allow me to recreate the file under a different file name. Recreating makes sense, however it is unlikely that this should happen using a different file name. Lastly, an option to just close the file is missing.

When a file that is open in kate is renamed, a dialogue pops up telling that it was deleted. It would be nice if kate was smart enough to distinguish moving from deletion and provide the user with the option to follow the file to its new location.

Reproducible: Always

Steps to Reproduce:
1. Open a file in kate.
2. Delete that file on disk. 
3. Then go back to that file in kate.
4. Click cancel
5. Try saving the document
6. Click cancel.
7. Edit the document
8. Try saving the document again
9. Click cancel.
10. Open another file in kate.
11. Rename that file on disk.
12. Go back to that file in kate.
13. Click ignore changes.

Actual Results:  
After step 3:
A dialogue appears telling that the file was deleted.
The dialogue has the buttons 'save file as', 'ignore changes' and 'cancel'.
After step 5:
A dialogue appears telling that the save operation could overwrite the file on disk.
After step 8: 
A dialogue appears telling that the file on disk was changed and saving could cause data loss.
After step 12:
A dialogue appears telling that the file was deleted.
The dialogue has the buttons 'save file as', 'ignore changes' and 'cancel'.
After step 13:
A dialogue appears telling that if you save you will overwrite the file on disk.

Expected Results:  
After step 3: 
A dialogue appears telling that the file was moved.
The dialogue has the buttons 'edit as new', (which causes the 'save as' dialogue to appear when saving with the location defaulting to the file's original location; and furthermore causes the document modified flag to be set), 'recreate and save' (which tries to recreate the file and save it), 'close file' (which closes the document), and 'cancel'. 
After step 5:
If the file was recreated outside kate, create a dialogue telling that saving would cause the created file to be overwritten. Otherwise, a dialogue appears telling that the save operation would recreate the file on disk. (In the race condition that the file was recreated outside kate prior to the user choosing that recreation is ok: show the other recreation dialog.)
After step 8:
The same dialogue as in step 5.
After step 12: 
A dialogue appears telling that the file was moved.
The dialogue has the buttons 'edit as new', (see step 3), 'follow' (update the file location, such that save will save the file at the new location), and 'cancel'. 


Bug depends on: https://bugs.kde.org/show_bug.cgi?id=117283.
Comment 1 Dominik Haumann 2016-09-07 20:34:17 UTC
Git commit 0e299055c5c89f76a2301a2dde41214216e6066a by Dominik Haumann.
Committed on 07/09/2016 at 20:34.
Pushed by dhaumann into branch 'master'.

Use non-modal message widget for externally modified file notifications

No more modal dialogs for externally modified changes that can
acidentally be pressed while typing.

For Kate, nothing changes if you have "[x] Warn about files modified
by foreign processes" enabled.

Differential Revision: D2700

Fixed-In: KDE Frameworks 5.27
Related: bug 309493, bug 353712

M  +0    -1    src/CMakeLists.txt
M  +47   -123  src/dialogs/katedialogs.cpp
M  +12   -12   src/dialogs/katedialogs.h
M  +62   -70   src/document/katedocument.cpp
M  +9    -5    src/document/katedocument.h
M  +0    -8    src/view/kateviewinternal.cpp

http://commits.kde.org/ktexteditor/0e299055c5c89f76a2301a2dde41214216e6066a