Makes the Code Editor Widget tabs closable.
ClosedPublic

Authored by fernandorodrigues on Oct 6 2018, 8:24 PM.

Details

Summary

Making the code editor widget tabs closable by creating a
method that receives a signal from the tabCloseRequest, closing the
specified tab and removing it's code document properly.

Diff Detail

Repository
R73 Rocs
Branch
makingEditorTabsClosable
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3555
Build 3573: arc lint + arc unit
Restricted Application added a project: KDE Edu. · View Herald TranscriptOct 6 2018, 8:24 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
fernandorodrigues requested review of this revision.Oct 6 2018, 8:24 PM
tcanabrava added inline comments.Oct 6 2018, 8:53 PM
src/ui/codeeditorwidget.cpp
44

Unrelated

Removing functionality unrelated to the last commit.

Closing the source file directly leads to deleting the whole code document. IMO that is a too big operation to connect to the small [X] icon, which one could accidentally press, even when switching documents.
Either there should be a confirmation dialog that the source code really shall be deleted. Or there should be a code file deletion option that is only provided in a menu to avoid accidental code deletion.

tcanabrava requested changes to this revision.Oct 7 2018, 10:37 AM

Closing the source file directly leads to deleting the whole code document. IMO that is a too big operation to connect to the small [X] icon, which one could accidentally press, even when switching documents.
Either there should be a confirmation dialog that the source code really shall be deleted. Or there should be a code file deletion option that is only provided in a menu to avoid accidental code deletion.

Agreed.

This revision now requires changes to proceed.Oct 7 2018, 10:37 AM

Fixing last commit using a confirmation dialog before closing the specified tab.

tcanabrava requested changes to this revision.Oct 8 2018, 3:06 PM
tcanabrava added inline comments.
src/project/project.cpp
256 ↗(On Diff #43135)

code style, return in the next line.

src/ui/codeeditorwidget.cpp
27

stray include.

111

While this removeCodeDocument will not remove if the KTextDocument says that it will not close, this is not obvious.
can you rename to tryToRemoveCodeDocument?

This revision now requires changes to proceed.Oct 8 2018, 3:06 PM

Removing stray include, renaming method and fixing line according to correct code style.

tcanabrava accepted this revision.Oct 9 2018, 8:04 AM
This revision is now accepted and ready to land.Oct 9 2018, 8:04 AM
rizzitello closed this revision.Oct 10 2018, 10:50 PM