aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-24 01:05:18 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-24 01:05:18 (GMT)
commitc6cfde60c590b3a5a058d5cbafe3ee65ab5cb1e3 (patch)
treebafd52a30dcd00885e04600161d9d95dc17e8dce
parent2d9d29992c9a8fbc9ee8cb7896295c11026fa27f (diff)
less view list iterations
-rw-r--r--kate/src/kateviewmanager.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/kate/src/kateviewmanager.cpp b/kate/src/kateviewmanager.cpp
index 779e9ff..e0c59d3 100644
--- a/kate/src/kateviewmanager.cpp
+++ b/kate/src/kateviewmanager.cpp
@@ -109,6 +109,7 @@ KateViewManager::~KateViewManager()
*/
if (guiMergedView) {
mainWindow()->guiFactory()->removeClient(guiMergedView);
+ guiMergedView = nullptr;
}
}
@@ -594,12 +595,13 @@ void KateViewManager::activateView(KTextEditor::View *view)
if (guiMergedView) {
mainWindow()->guiFactory()->removeClient(guiMergedView);
+ guiMergedView = nullptr;
}
- guiMergedView = view;
if (!m_blockViewCreationAndActivation) {
mainWindow()->guiFactory()->addClient(view);
+ guiMergedView = view;
}
if (toolbarVisible) {
@@ -921,9 +923,12 @@ void KateViewManager::saveViewConfiguration(KConfigGroup &config)
void KateViewManager::restoreViewConfiguration(const KConfigGroup &config)
{
- // remove all views and viewspaces + remove their xml gui clients
- for (int i = 0; i < m_viewList.count(); ++i) {
- mainWindow()->guiFactory()->removeClient(m_viewList.at(i));
+ /**
+ * remove the single client that is registered at the factory, if any
+ */
+ if (guiMergedView) {
+ mainWindow()->guiFactory()->removeClient(guiMergedView);
+ guiMergedView = nullptr;
}
qDeleteAll(m_viewList);