diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 93f033b..c2cc0a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -121,7 +121,15 @@ int main(int argc, char **argv) QObject::connect(&app, &Browser::messageAvailable, &app, &Browser::createSession); } - app.sendMessage(Session::toJsonObject(config->value<QString>("profile.default").value(), urls)); + if(config->exists("session")) { + QFile sessionJson(config->value<QString>("session").value()); + if(sessionJson.open(QIODevice::ReadOnly | QIODevice::Text)) { + app.sendMessage(sessionJson.readAll()); + sessionJson.close(); + } + } else + app.sendMessage(Session::toJsonObject(config->value<QString>("profile.default").value(), urls)); + if(isSingleInstance) return app.exec(); else |