From: Felix Ernst Date: Tue, 15 Apr 2025 21:06:26 +0000 (+0200) Subject: Fix session restore X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/c0bf226aa1cc02c9bffff1ec05e07a255d8d2f6e 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 --- 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();