Commit 48d6f01a authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa

main: Simplify the session restoration logic.

Bail out earlier instead of nesting if checks and testing |window|'s
value in different places.
parent 42e4d9cd
......@@ -110,18 +110,14 @@ int main(int argc, char **argv)
//session restoring
if (application.isSessionRestored()) {
MainWindow* window = NULL;
if (KMainWindow::canBeRestored(1)) {
window = new MainWindow;
window->restore(1);
if (!window->loadPart()) {
delete window;
window = NULL;
}
if (!KMainWindow::canBeRestored(1)) {
return -1;
}
if (window == NULL) {
MainWindow* window = new MainWindow;
window->restore(1);
if (!window->loadPart()) {
delete window;
return -1;
}
} else { //new ark window (no restored session)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment