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

BrowserWindow: Don't restore first app window from postLaunch slot

Instead restore it immediately after creation from MainApplication
as all other window types.
This commit is contained in:
David Rosca 2018-01-02 18:12:21 +01:00
parent 6b08e17dcd
commit 1de32182c1
2 changed files with 6 additions and 5 deletions

View File

@ -282,8 +282,8 @@ void BrowserWindow::postLaunch()
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
m_tabWidget->addView(QUrl("falkon:restore"), Qz::NT_CleanSelectedTabAtTheEnd); m_tabWidget->addView(QUrl("falkon:restore"), Qz::NT_CleanSelectedTabAtTheEnd);
} }
else if ((mApp->afterLaunch() == MainApplication::SelectSession || mApp->afterLaunch() == MainApplication::RestoreSession) && mApp->restoreManager()) { else if (mApp->afterLaunch() == MainApplication::SelectSession || mApp->afterLaunch() == MainApplication::RestoreSession) {
addTab = !mApp->restoreSession(this, mApp->restoreManager()->restoreData()); addTab = m_tabWidget->count() <= 0;
} }
break; break;
@ -322,7 +322,7 @@ void BrowserWindow::postLaunch()
} }
// Something went really wrong .. add one tab // Something went really wrong .. add one tab
if (m_tabWidget->tabBar()->normalTabsCount() <= 0) { if (m_tabWidget->count() <= 0) {
m_tabWidget->addView(m_homepage, Qz::NT_SelectedTabAtTheEnd); m_tabWidget->addView(m_homepage, Qz::NT_SelectedTabAtTheEnd);
} }

View File

@ -308,7 +308,6 @@ MainApplication::MainApplication(int &argc, char** argv)
connect(this, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(onFocusChanged())); connect(this, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(onFocusChanged()));
if (!isPrivate()) { if (!isPrivate()) {
#ifndef DISABLE_CHECK_UPDATES #ifndef DISABLE_CHECK_UPDATES
Settings settings; Settings settings;
@ -323,7 +322,9 @@ MainApplication::MainApplication(int &argc, char** argv)
if (m_isStartingAfterCrash || afterLaunch() == RestoreSession) { if (m_isStartingAfterCrash || afterLaunch() == RestoreSession) {
m_restoreManager = new RestoreManager(sessionManager()->lastActiveSessionPath()); m_restoreManager = new RestoreManager(sessionManager()->lastActiveSessionPath());
if (!m_restoreManager->isValid()) { if (m_restoreManager->isValid()) {
restoreSession(window, m_restoreManager->restoreData());
} else {
destroyRestoreManager(); destroyRestoreManager();
} }
} }