From e81526f15e8c1e9c82b27009dbe512f78cf1dc0f Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 24 Jun 2018 17:27:44 +0200 Subject: Add Session class --- src/mainwindow/subwindow.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/mainwindow/subwindow.cpp') diff --git a/src/mainwindow/subwindow.cpp b/src/mainwindow/subwindow.cpp index 2b9cd48..cbfe46a 100644 --- a/src/mainwindow/subwindow.cpp +++ b/src/mainwindow/subwindow.cpp @@ -52,19 +52,6 @@ SubWindow::SubWindow(const QHash &config, QWidget *parent, Qt: profileName_action->setText(tr("Profile: %1").arg(name)); }); } - -#ifdef QT_DEBUG - menu->addSeparator(); - menu->addAction(tr("Debug menu"))->setEnabled(false); - auto *saveSession_action = menu->addAction(tr("Save session")); - menu->addAction(tr("Load session"))->setEnabled(false); - setSystemMenu(menu); - - connect(saveSession_action, &QAction::triggered, [this]() { - QJsonDocument doc(session()); - qDebug("%s", qUtf8Printable(doc.toJson())); - }); -#endif } // new tab button @@ -162,13 +149,15 @@ void SubWindow::setCurrentTab(int index) QJsonObject SubWindow::session() const { QJsonObject obj; - obj.insert("profile", QJsonValue("")); + obj.insert("profile", profile->id()); QJsonArray tabs; for(int i = 0; i < tabWidget->count(); ++i) { auto *view = qobject_cast(tabWidget->widget(i)); if(view) { - tabs.append(view->url().toString()); + QJsonObject tab; + tab.insert(view->url().toString(), view->profile()->id()); + tabs.append(tab); } } obj.insert("tabs", tabs); -- cgit v1.2.1