|
| 1 | +From 6032b78512685dc7d6cc3754d536823d428525c4 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Felix Ernst <felixernst@zohomail.eu> |
| 3 | +Date: Wed, 16 Apr 2025 13:50:05 +0000 |
| 4 | +Subject: [PATCH] Fix session restore |
| 5 | + |
| 6 | +Since https://commits.kde.org/kxmlgui/8c9fb02a1d37672b26a03a9dd9e8675743deb269 |
| 7 | +KXmlGui only triggers a session restore for a window when the |
| 8 | +session config contains a "NumberOfWindows" key with a value >= 1. |
| 9 | +This commit adds such a key to the Dolphin session config, which |
| 10 | +fixes the Dolphin main window restore for KXmlGui versions |
| 11 | +containing that commit. |
| 12 | + |
| 13 | +BUG: 502770 |
| 14 | + |
| 15 | + |
| 16 | +(cherry picked from commit c0bf226aa1cc02c9bffff1ec05e07a255d8d2f6e) |
| 17 | + |
| 18 | +Co-authored-by: Felix Ernst <felixernst@zohomail.eu> |
| 19 | +--- |
| 20 | + src/dolphinmainwindow.cpp | 2 ++ |
| 21 | + 1 file changed, 2 insertions(+) |
| 22 | + |
| 23 | +diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp |
| 24 | +index 8a6c99ce57..391fe81a8c 100644 |
| 25 | +--- a/src/dolphinmainwindow.cpp |
| 26 | ++++ b/src/dolphinmainwindow.cpp |
| 27 | +@@ -757,6 +757,8 @@ void DolphinMainWindow::slotSaveSession() |
| 28 | + KConfig *config = KConfigGui::sessionConfig(); |
| 29 | + saveGlobalProperties(config); |
| 30 | + savePropertiesInternal(config, 1); |
| 31 | ++ KConfigGroup group = config->group(QStringLiteral("Number")); |
| 32 | ++ group.writeEntry("NumberOfWindows", 1); // Makes session restore aware that there is a window to restore. |
| 33 | + |
| 34 | + auto future = QtConcurrent::run([config]() { |
| 35 | + config->sync(); |
| 36 | +-- |
| 37 | +GitLab |
| 38 | + |
0 commit comments