| 45 | } |
| 46 | |
| 47 | void 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 | |
| 68 | void StatusInfoManagerPrivate::updateStatusBar() |
| 69 | { |
nothing calls this directly
no test coverage detected