Bug 359441 - "Deleted by another program" -> "Close" option doesn't.
Summary: "Deleted by another program" -> "Close" option doesn't.
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: general (show other bugs)
Version: git master
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-15 17:56 UTC by Francis Herne
Modified: 2016-09-05 19:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Herne 2016-02-15 17:56:57 UTC
When a file being edited is changed on-disk by another program, a popup is displayed with the following options:
 - Save File As
 - Ignore Changes
 - Close
 - Cancel

The third option should close the file in question. This works in Kate 15.12, but not in KDevelop 4.90.91; instead, the file remains open and the warning icon disappears from the tab.

This causes that file to appear as normal in the UI, with no changed-on-disk or unsaved-changes indicator, but 'disappear' on exit unless new changes are made and saved (in which case the file is silently recreated).

Reproducible: Always

Steps to Reproduce:
1. Create and save a file.
2. Using another program, delete or move that file on-disk while keeping it open in KDevelop.
3. When returning to the file in KDevelop, select 'Close'.

Actual Results:  
 - The file remains open in apparently-normal state.
 - The file remains deleted on disk if no further changes are made.
 - The fIle is silently recreated if new changes are made and saved.

Expected Results:  
The file (or the tab showing it) is closed.
Comment 1 Francis Herne 2016-02-16 17:08:42 UTC
Correction: "is changed on-disk" should be "is moved or deleted". Changing it in place leads to a slightly different dialog, which works fine.
Comment 2 Kevin Funk 2016-02-16 17:17:13 UTC
This is a KTextEditor bug -> moving
Comment 3 Kevin Funk 2016-02-16 17:20:22 UTC
Hm, I missed the "This works in Kate 15.12, but not in KDevelop 4.90.91" part -- not entirely sure if this is KTextEditor bug then. We'll have a look at the issue anyway.
Comment 4 Christoph Cullmann 2016-09-05 16:04:53 UTC
Looked at it with Kevin, KDevPlatform will need to implement some more functions for the KTextEditor::Application interface, e.g. closeDocument
Comment 5 Kevin Funk 2016-09-05 19:02:34 UTC
Git commit e2bcd581bb8a9bb0005a9fcdce3167fc6be77e40 by Kevin Funk.
Committed on 05/09/2016 at 19:01.
Pushed by kfunk into branch '5.0'.

Close editor view when asked to

We need to mimic the interface of KTextEditor::Application here;
closeDocument is called by KTextEditor when trying to close a document
which has been deleted before.
FIXED-IN: 5.0.1

M  +3    -2    shell/documentcontroller.cpp
M  +1    -1    shell/documentcontroller.h
M  +7    -0    shell/ktexteditorpluginintegration.cpp
M  +6    -0    shell/ktexteditorpluginintegration.h

http://commits.kde.org/kdevplatform/e2bcd581bb8a9bb0005a9fcdce3167fc6be77e40