There is no confirmation window about data lose.
Screenshot:
FEATURE: 406305
FIXED-IN: 19.08
cullmann | |
dhaumann |
Kate | |
Frameworks |
There is no confirmation window about data lose.
Screenshot:
FEATURE: 406305
FIXED-IN: 19.08
Manually tested
No Linters Available |
No Unit Test Coverage |
Buildable 10751 | |
Build 10769: arc lint + arc unit |
There is still a confirmation dialog afterwards currently.
I might be in favor of removing it.
+1, once you've made the decision to close the deleted file, the confirmation dialog is unnecessary and annoying.
I might do it in a next review, since that needs some editing in kate as well to keep things small and clean.
src/dialogs/katedialogs.cpp | ||
---|---|---|
1296 | file discarding -> file, discarding |
Looks good to me.
src/dialogs/katedialogs.cpp | ||
---|---|---|
1298 ↗ | (On Diff #55999) | Could you switch this to new style signal slot syntax? In a separate review request would also be fine. |
The patch does not work properly for kwrite : in kwrite currently the close button has no effect.
If you really want to close the document aka removing it from the application's document list, you need the interface.
If you just want to set it back to "untitled document" you can use closeUrl
That's what we want for kate.
If you just want to set it back to "untitled document" you can use closeUrl
That would be the path to use for kwrite.
Is there a proper way to differentiate between the two ?
I would like also to remove the confirmation dialog about loosing data.
ReadWritePart has a closeUrl(bool prompt) that could be of use.
I'd rather avoid extending the interface.
One could try to first do a closeUrl and just do the closeDocumentInApplication() in addition afterwards.
Great suggestion !
I have tested the current code with success in KWrite and Kate.
I have disabled the data loss confirmation as I intended using a trick with m_fileChangedDialogsActivated.
I am not too fond of this solution, so I would happily use feedback.
Maybe add a boolean parameter to closeUrl like closeUrl(prompt = true) ?
I think the solution with the bool setting is good enough.
If nobody else disagrees, I would accept this later.
Hm, the correct fix is to implement this function for KWrite.
And: There is also KDevelop and Kile...
Having only a half-working solution sounds suboptimal to me.
The current implementation at least closes the file, in all applications.
It just doesn't remove in in all of them from the document list.
I think that is ok enough, more can't be done in KTextEditor.
Extra reviews for extending the applications are welcome.
kdevelop supports this interface already https://cgit.kde.org/kdevelop.git/tree/shell/ktexteditorpluginintegration.h?id=e2bcd581bb8a9bb0005a9fcdce3167fc6be77e40#n56
But not kile as far as greping kile source for KTextEditor::Application has shown.
I think this should go in.
For application supporting the interface, the document is removed.
For application not supporting the interface, at least the file is closed and you have a empty document again.
Actually for KWrite that is the wanted case, you don't want to end the application.