summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <kurt.hindenburg@gmail.com>2016-08-28 13:08:02 (GMT)
committerKurt Hindenburg <kurt.hindenburg@gmail.com>2016-08-28 13:08:02 (GMT)
commit5b11fd593b954504343bdb418c54a8e7913d9c7c (patch)
tree621bf60b70c446889898b45538940f321afbdbcd
parent392ee33cf8ffec54d41d342d7cba8fe82a13adc0 (diff)
Prevent 2 windows from opening upon session restore
Session management would start 2 konsole windows upon login. Thanks John Stanley (jpsinthemix gmail com) for patch BUG: 367447
-rw-r--r--src/main.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c7d797c..2b70aff 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -158,7 +158,9 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])
// of Konsole is started.
QObject::connect(&dbusService, &KDBusService::activateRequested, &konsoleApp, &Application::slotActivateRequested);
- if (!konsoleApp.newInstance()) {
+ if (app->isSessionRestored()) {
+ restoreSession(konsoleApp);
+ } else if (!konsoleApp.newInstance()) {
// Do not finish starting Konsole
// 1. An argument was given to just printed info
// 2. An invalid situation ocurred
@@ -166,9 +168,6 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])
return 0;
}
- if (app->isSessionRestored())
- restoreSession(konsoleApp);
-
// Since we've allocated the QApplication on the heap for the KDBusService workaround,
// we need to delete it manually before returning from main().
int ret = app->exec();