MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / resetEditor

Method resetEditor

src/plugins/codeeditor/statusbar/statusinfomanager.cpp:47–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void StatusInfoManagerPrivate::resetEditor(TextEditor *edit)
48{
49 if (currentEditor == edit)
50 return;
51
52 if (currentEditor) {
53 currentEditor->disconnect(this);
54 currentEditor->disconnect(statusBar);
55 }
56
57 currentEditor = edit;
58 statusBar->setVisible(true);
59 connect(edit, &TextEditor::destroyed, this, [this] {
60 statusBar->setVisible(false);
61 currentEditor = nullptr;
62 });
63 connect(currentEditor, &TextEditor::cursorPositionChanged, statusBar, &EditorStatusBar::updateCursor);
64 connect(currentEditor, &TextEditor::cursorModeChanged, this, &StatusInfoManagerPrivate::updateEditorCursorMode);
65 updateStatusBar();
66}
67
68void StatusInfoManagerPrivate::updateStatusBar()
69{

Callers

nothing calls this directly

Calls 3

connectFunction · 0.85
setVisibleMethod · 0.80
disconnectMethod · 0.45

Tested by

no test coverage detected