aboutsummaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/session.cpp b/src/session.cpp
index 6d025dc..0cbb0e8 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -11,6 +11,8 @@
#include "mainwindow/subwindow.h"
#include <QJsonObject>
#include <QJsonArray>
+#include "webengine/webview.h"
+#include "profilemanager.h"
Session::Session(QObject *parent) : QObject(parent)
{
@@ -22,7 +24,19 @@ QJsonObject Session::toJsonObject(MainWindow *window)
QJsonArray subwindows;
for(const SubWindow *subwindow : window->subWindows()) {
- subwindows.append(subwindow->session());
+ QJsonObject window;
+ window.insert("profile", ProfileManager::id(subwindow->profile()));
+
+ QJsonArray tabs;
+ for(int i = 0; i < subwindow->tabCount(); ++i) {
+ QJsonObject tab;
+ tab.insert("url", subwindow->view(i)->url().toString());
+ tab.insert("profile", ProfileManager::id(subwindow->view(i)->profile()));
+ tabs.append(tab);
+ }
+ window.insert("tabs", tabs);
+
+ subwindows.append(window);
}
session.insert("subwindows", subwindows);