diff options
Diffstat (limited to 'src/mainwindow/window.cpp')
-rw-r--r-- | src/mainwindow/window.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mainwindow/window.cpp b/src/mainwindow/window.cpp index fb4eb07..055d945 100644 --- a/src/mainwindow/window.cpp +++ b/src/mainwindow/window.cpp @@ -152,6 +152,15 @@ void Window::restoreSession(const QJsonObject &sessionData) Q_ASSERT_X(sessionData.value("tabs") != QJsonValue::Undefined, "Window::restoreSession", "no tabs in json"); const QJsonArray tabs = sessionData.value("tabs").toArray(); + + if(tabs.count() == 0) { + // open a newtab + auto *view = new WebView(profile, this); + view->load(profile->newtab()); + tabWidget->addTab(view); + return; + } + for(const auto tab : tabs) { auto *view = new WebView(profile, this); view->load(QUrl::fromUserInput(tab.toString())); |