summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-24 01:01:48 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-24 01:01:48 (GMT)
commit2d9d29992c9a8fbc9ee8cb7896295c11026fa27f (patch)
treeb4b32442fa121254e25dc1f38a0bf0313d5037f4
parent13917d21f6126df9f4a051926a1f6ceeaa9887e5 (diff)
less view list iterations
-rw-r--r--kate/src/kateviewmanager.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/kate/src/kateviewmanager.cpp b/kate/src/kateviewmanager.cpp
index 47a1123..779e9ff 100644
--- a/kate/src/kateviewmanager.cpp
+++ b/kate/src/kateviewmanager.cpp
@@ -104,9 +104,12 @@ KateViewManager::KateViewManager(QWidget *parentW, KateMainWindow *parent)
KateViewManager::~KateViewManager()
{
- // make sure all xml gui clients are removed to avoid warnings on exit
- Q_FOREACH(KTextEditor::View * view, m_viewList)
- mainWindow()->guiFactory()->removeClient(view);
+ /**
+ * remove the single client that is registered at the factory, if any
+ */
+ if (guiMergedView) {
+ mainWindow()->guiFactory()->removeClient(guiMergedView);
+ }
}
void KateViewManager::setupActions()
@@ -435,7 +438,13 @@ bool KateViewManager::deleteView(KTextEditor::View *view)
viewspace->removeView(view);
- mainWindow()->guiFactory()->removeClient(view);
+ /**
+ * deregister if needed
+ */
+ if (guiMergedView == view) {
+ mainWindow()->guiFactory()->removeClient(guiMergedView);
+ guiMergedView = nullptr;
+ }
#ifdef KActivities_FOUND
m_activityResources.remove(view);