Skip to content

Fix KMainWindow::canBeRestored to return false in the right times

Right now if there is a session config but it has no data in it, KMainWindow::canBeRestored() will return true if you call it with the number 1 as an argument. This is because it will try to read the NumberOfWindows key, see that it does not exist, and fall back to the number 1 as the default value, which will be identical to the number you called the function with.

Instead let's set the default value to 0, which will fix this and also be more accurate too (there really are zero windows saved).

This fixes the issue Albert found with my Okular MR in graphics/okular!247 (comment 93064)

Edited by Nate Graham

Merge request reports