From 3cdb4c26dfd06de5f714115c8c1973265abb2124 Mon Sep 17 00:00:00 2001 From: nowrep Date: Fri, 25 Jan 2013 23:36:50 +0100 Subject: [PATCH] Fixed setting current tab after recovering crash. It set currentIndex - 1 before. --- src/lib/app/mainapplication.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 467dadd76..924fecd93 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -970,7 +970,13 @@ bool MainApplication::restoreStateSlot(QupZilla* window, RestoreData recoveryDat newWin->restoreWindowState(recoveryData.takeFirst()); } else { - window->restoreWindowState(recoveryData.takeFirst()); + // QTabWidget::count() - count of tabs is not updated after closing + // recovery tab ... + int tabCount = window->tabWidget()->count(); + RestoreManager::WindowData data = recoveryData.takeFirst(); + data.currentTab += tabCount; + + window->restoreWindowState(data); } foreach(const RestoreManager::WindowData & data, recoveryData) {