aboutsummaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/session.cpp b/src/session.cpp
index 281e657..6d025dc 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -28,3 +28,28 @@ QJsonObject Session::toJsonObject(MainWindow *window)
return session;
}
+
+QJsonObject Session::toJsonObject(const QString &profile, const QStringList &urls)
+{
+ QJsonObject session;
+
+ QJsonArray subwindows;
+ {
+ QJsonObject window;
+ window.insert("profile", profile);
+
+ QJsonArray tabs;
+ for(const auto &url : urls) {
+ QJsonObject tab;
+ tab.insert("url", url);
+ tab.insert("profile", profile);
+ tabs.append(tab);
+ }
+ window.insert("tabs", tabs);
+
+ subwindows.append(window);
+ }
+ session.insert("subwindows", subwindows);
+
+ return session;
+}