From f5eab8be26007f9ba7b651a015454a048f1b9b07 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 20 Oct 2022 12:44:45 +0500 Subject: [PATCH] Remove empty viewspaces after restoring config - Open anon session - Create two viewspaces with views in both - Close Kate - Restart Kate - Kate opens with 2 viewspaces but one is empty --- apps/lib/kateviewmanager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/lib/kateviewmanager.cpp b/apps/lib/kateviewmanager.cpp index 59505aef3a..7c31728b94 100644 --- a/apps/lib/kateviewmanager.cpp +++ b/apps/lib/kateviewmanager.cpp @@ -1422,6 +1422,15 @@ void KateViewManager::restoreViewConfiguration(const KConfigGroup &config) addWidget(vs); vs->setActive(true); m_viewSpaceList.push_back(vs); + } else { + // remove any empty viewspaces + // use a copy, m_viewSpaceList wil be modified + const auto copy = m_viewSpaceList; + for (auto *vs : copy) { + if (vs->documentList().isEmpty()) { + onViewSpaceEmptied(vs); + } + } } updateViewSpaceActions(); -- GitLab