From 5298dc985746670bd01863a03eea2f37ad655a4f Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 1 Dec 2016 23:11:07 +0100 Subject: [PATCH] RecoveryPage: Fix displaying list of windows and tabs --- src/lib/data/html/restore.html | 17 ++++++++--------- src/lib/session/recoveryjsobject.h | 4 +++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/lib/data/html/restore.html b/src/lib/data/html/restore.html index 22945f244..e3677eb69 100644 --- a/src/lib/data/html/restore.html +++ b/src/lib/data/html/restore.html @@ -260,16 +260,15 @@ function addTab(winId, tabId, icon, title) function init() { - external.recovery.restoreData(function(data) { - for (var i = 0; i < data.length; ++i) { - var win = data[i]; - addWindow(win.window); - for (var j = 0; j < win.tabs.length; ++j) { - var tab = win.tabs[j]; - addTab(win.window, tab.tab, tab.icon, tab.title); - } + var data = external.recovery.restoreData; + for (var i = 0; i < data.length; ++i) { + var win = data[i]; + addWindow(win.window); + for (var j = 0; j < win.tabs.length; ++j) { + var tab = win.tabs[j]; + addTab(win.window, tab.tab, tab.icon, tab.title); } - }); + } } // Initialize diff --git a/src/lib/session/recoveryjsobject.h b/src/lib/session/recoveryjsobject.h index 64134ccb1..8b1c92683 100644 --- a/src/lib/session/recoveryjsobject.h +++ b/src/lib/session/recoveryjsobject.h @@ -29,14 +29,16 @@ class RestoreManager; class RecoveryJsObject : public QObject { Q_OBJECT + Q_PROPERTY(QJsonArray restoreData READ restoreData CONSTANT) + public: explicit RecoveryJsObject(RestoreManager *manager); void setPage(WebPage *page); -public slots: QJsonArray restoreData() const; +public slots: void startNewSession(); void restoreSession(const QStringList &excludeWin, const QStringList &excludeTab);