aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-29 20:07:33 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-29 20:07:33 +0200
commit6f0494dde874a4d77371b82b1485c32acb4ad470 (patch)
tree7fe9f658aa3ce94df96350a82876d137a6974d0d /src
parentAdd --session parameter to load a session json (diff)
downloadsmolbote-6f0494dde874a4d77371b82b1485c32acb4ad470.tar.xz
Add browser.session
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c2cc0a1..a419775 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -126,6 +126,16 @@ int main(int argc, char **argv)
if(sessionJson.open(QIODevice::ReadOnly | QIODevice::Text)) {
app.sendMessage(sessionJson.readAll());
sessionJson.close();
+ } else {
+ qWarning("Could not open session [%s].", qUtf8Printable(sessionJson.fileName()));
+ }
+ } else if(config->exists("browser.session")) {
+ QFile sessionJson(config->value<QString>("browser.session").value());
+ if(sessionJson.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ app.sendMessage(sessionJson.readAll());
+ sessionJson.close();
+ } else {
+ qWarning("Could not open browser.session [%s].", qUtf8Printable(sessionJson.fileName()));
}
} else
app.sendMessage(Session::toJsonObject(config->value<QString>("profile.default").value(), urls));
@@ -133,5 +143,5 @@ int main(int argc, char **argv)
if(isSingleInstance)
return app.exec();
else
- return 0;
+ return EXIT_SUCCESS;
}