From c0bf226aa1cc02c9bffff1ec05e07a255d8d2f6e Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Tue, 15 Apr 2025 23:06:26 +0200 Subject: [PATCH] Fix session restore Since https://commits.kde.org/kxmlgui/8c9fb02a1d37672b26a03a9dd9e8675743deb269 KXmlGui only triggers a session restore for a window when the session config contains a "NumberOfWindows" key with a value >= 1. This commit adds such a key to the Dolphin session config, which fixes the Dolphin main window restore for KXmlGui versions containing that commit. BUG: 502770 --- src/dolphinmainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 106f0e44b..67db2c5e9 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -760,6 +760,8 @@ void DolphinMainWindow::slotSaveSession() KConfig *config = KConfigGui::sessionConfig(); saveGlobalProperties(config); savePropertiesInternal(config, 1); + KConfigGroup group = config->group(QStringLiteral("Number")); + group.writeEntry("NumberOfWindows", 1); // Makes session restore aware that there is a window to restore. auto future = QtConcurrent::run([config]() { config->sync(); -- 2.47.3