aboutsummaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/session.cpp b/src/session.cpp
index 9c69088..70e1deb 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -15,26 +15,22 @@
#include <web/profilemanager.h>
-QJsonObject JsonSession::session(QVector<MainWindow *> windows)
+QJsonObject Session::session(QVector<MainWindow *> windows)
{
QJsonObject obj;
QJsonArray windowsArray;
for(const MainWindow *window : windows) {
- windowsArray.append(Session::toJsonObject(window));
+ windowsArray.append(Session::window(window));
}
obj.insert("windows", windowsArray);
return obj;
}
-Session::Session(QObject *parent) : QObject(parent)
+QJsonObject Session::window(const MainWindow *window)
{
-}
-
-QJsonObject Session::toJsonObject(const MainWindow *window)
-{
- QJsonObject session;
+ QJsonObject obj;
QJsonArray subwindows;
for(const SubWindow *subwindow : window->subWindows()) {
@@ -52,12 +48,12 @@ QJsonObject Session::toJsonObject(const MainWindow *window)
subwindows.append(window);
}
- session.insert("subwindows", subwindows);
+ obj.insert("subwindows", subwindows);
- return session;
+ return obj;
}
-QJsonObject Session::toJsonObject(const QString &profile, const QStringList &urls)
+QJsonObject Session::window(const QString &profile, const QStringList &urls)
{
QJsonObject session;