1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 02:52:12 +01:00

Don't close additionally opened tabs when restoring session

- if user opens app after crash, he will get 1 tab asking him
  about restoring a session
  if user opens another tabs and later decides to restore session,
  new opened tabs won't be closed

Patch by Franz Fellner
This commit is contained in:
nowrep 2012-08-22 13:45:03 +02:00
parent 80e89b2644
commit c6445513e0
2 changed files with 9 additions and 6 deletions

View File

@ -864,7 +864,7 @@ bool MainApplication::saveStateSlot()
return true; return true;
} }
bool MainApplication::restoreStateSlot(QupZilla* window, const RestoreData &recoveryData) bool MainApplication::restoreStateSlot(QupZilla* win, const RestoreData &recoveryData)
{ {
if (m_isPrivateSession) { if (m_isPrivateSession) {
return false; return false;
@ -878,6 +878,14 @@ bool MainApplication::restoreStateSlot(QupZilla* window, const RestoreData &reco
return false; return false;
} }
QupZilla* window = win;
if (window->tabWidget()->count() > 1) {
window = new QupZilla(Qz::BW_OtherRestoredWindow);
m_mainWindows.append(window);
}
win->tabWidget()->closeTab(window->tabWidget()->currentIndex(), true);
int windowCount = recoveryData.size(); int windowCount = recoveryData.size();
int currentWindow = 0; int currentWindow = 0;

View File

@ -784,11 +784,6 @@ bool TabWidget::restoreState(const QList<WebTab::SavedTab> &tabs, int currentTab
{ {
m_isRestoringState = true; m_isRestoringState = true;
foreach(WebTab * tab, allTabs()) {
int tabIndex = tab->tabIndex();
closeTab(tabIndex, true);
}
for (int i = 0; i < tabs.size(); ++i) { for (int i = 0; i < tabs.size(); ++i) {
WebTab::SavedTab tab = tabs.at(i); WebTab::SavedTab tab = tabs.at(i);