Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 2826 Lines • ▼ Show 20 Line(s) | |||||
2827 | { | 2827 | { | ||
2828 | makeAttribs(); | 2828 | makeAttribs(); | ||
2829 | } | 2829 | } | ||
2830 | 2830 | | |||
2831 | void KTextEditor::DocumentPrivate::addView(KTextEditor::View *view) | 2831 | void KTextEditor::DocumentPrivate::addView(KTextEditor::View *view) | ||
2832 | { | 2832 | { | ||
2833 | Q_ASSERT (!m_views.contains(view)); | 2833 | Q_ASSERT (!m_views.contains(view)); | ||
2834 | m_views.insert(view, static_cast<KTextEditor::ViewPrivate *>(view)); | 2834 | m_views.insert(view, static_cast<KTextEditor::ViewPrivate *>(view)); | ||
2835 | m_viewsCache.append(view); | ||||
mwolff: just add the view, cf. the contains check above. no need to rebuild the full list here all the… | |||||
2835 | 2836 | | |||
2836 | // apply the view & renderer vars from the file type | 2837 | // apply the view & renderer vars from the file type | ||
2837 | if (!m_fileType.isEmpty()) { | 2838 | if (!m_fileType.isEmpty()) { | ||
2838 | readVariableLine(KTextEditor::EditorPrivate::self()->modeManager()->fileType(m_fileType).varLine, true); | 2839 | readVariableLine(KTextEditor::EditorPrivate::self()->modeManager()->fileType(m_fileType).varLine, true); | ||
2839 | } | 2840 | } | ||
2840 | 2841 | | |||
2841 | // apply the view & renderer vars from the file | 2842 | // apply the view & renderer vars from the file | ||
2842 | readVariables(true); | 2843 | readVariables(true); | ||
2843 | 2844 | | |||
2844 | setActiveView(view); | 2845 | setActiveView(view); | ||
2845 | } | 2846 | } | ||
2846 | 2847 | | |||
2847 | void KTextEditor::DocumentPrivate::removeView(KTextEditor::View *view) | 2848 | void KTextEditor::DocumentPrivate::removeView(KTextEditor::View *view) | ||
2848 | { | 2849 | { | ||
2849 | Q_ASSERT (m_views.contains(view)); | 2850 | Q_ASSERT (m_views.contains(view)); | ||
2850 | m_views.remove(view); | 2851 | m_views.remove(view); | ||
2852 | m_viewsCache.removeAll(view); | ||||
mwolff: dito, just remove | |||||
2851 | 2853 | | |||
2852 | if (activeView() == view) { | 2854 | if (activeView() == view) { | ||
2853 | setActiveView(nullptr); | 2855 | setActiveView(nullptr); | ||
2854 | } | 2856 | } | ||
2855 | } | 2857 | } | ||
2856 | 2858 | | |||
2857 | void KTextEditor::DocumentPrivate::setActiveView(KTextEditor::View *view) | 2859 | void KTextEditor::DocumentPrivate::setActiveView(KTextEditor::View *view) | ||
2858 | { | 2860 | { | ||
▲ Show 20 Lines • Show All 3161 Lines • Show Last 20 Lines |
just add the view, cf. the contains check above. no need to rebuild the full list here all the time