Close Files in the KTextEditor
AbandonedPublic

Authored by rizzitello on May 4 2018, 1:23 AM.

Details

Summary

Remove file from m_openFiles on close

Close the files delete the document
TEST THIS ONE ALOT MAY STILL NEED SOME WORK .
Ment to be used with D12690 and D12687

Test Plan

Sometimes it does close right and it crashes when you open a new file or close one? it happened once in my testing..
Sometimes if more then one files is open they all close ?
@cullmann can you see if im closing the files correctly .

Diff Detail

Repository
R231 Atelier
Branch
closeFiles
Lint
No Linters Available
Unit
No Unit Test Coverage
rizzitello requested review of this revision.May 4 2018, 1:23 AM
rizzitello created this revision.
rizzitello edited the summary of this revision. (Show Details)May 4 2018, 1:26 AM
rizzitello edited the test plan for this revision. (Show Details)
rizzitello edited the test plan for this revision. (Show Details)
patrickelectric requested changes to this revision.May 4 2018, 2:29 AM
patrickelectric added inline comments.
src/mainwindow.cpp
173

File as reference.

This revision now requires changes to proceed.May 4 2018, 2:29 AM

Hmm, of example in the

connect(gcodeEditor, &GCodeEditorWidget::updateClientFactory, this, [this](KTextEditor::View* view){

    guiFactory()->removeClient(m_currEditorView);
    guiFactory()->addClient(view);
    m_currEditorView = view;
});

part: could m_currEditorView be there null at the start or later? must one guard that?

Beside that, I am not sure how you handle view deletes, isn't the current view pointer then dangling?

Hmm, of example in the

connect(gcodeEditor, &GCodeEditorWidget::updateClientFactory, this, [this](KTextEditor::View* view){
        guiFactory()->removeClient(m_currEditorView);
        guiFactory()->addClient(view);
        m_currEditorView = view;
    });

part: could m_currEditorView be there null at the start or later? must one guard that?

I think this is the reason for the crash on close if more then two files are opened..

rizzitello updated this revision to Diff 33616.EditedMay 4 2018, 10:38 AM
rizzitello edited the summary of this revision. (Show Details)
rizzitello edited the test plan for this revision. (Show Details)
  • File Ref
rizzitello updated this revision to Diff 33678.May 5 2018, 11:45 AM
  • close usl
rizzitello edited the summary of this revision. (Show Details)May 5 2018, 11:55 AM
rizzitello edited the test plan for this revision. (Show Details)
rizzitello planned changes to this revision.May 5 2018, 12:24 PM
rizzitello updated this revision to Diff 33679.May 5 2018, 12:28 PM
  • Debug info for testing . Disable creation of new file on no files
patrickelectric requested changes to this revision.May 5 2018, 12:29 PM
patrickelectric added inline comments.
src/mainwindow.cpp
161–171

&& view

This revision now requires changes to proceed.May 5 2018, 12:29 PM
rizzitello updated this revision to Diff 33687.May 5 2018, 5:51 PM
  • && view
rizzitello abandoned this revision.May 5 2018, 7:58 PM

This needs the D12690 to much so im going to add it to that diff