1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

ensured the window geometry is remembered on OS X

* ensured the window geometry is remembered on OS X

It was always starting based on:
int windowWidth = desktop->availableGeometry().width() / 1.3;
int windowHeight = desktop->availableGeometry().height() / 1.3;

because quitApp isn’t called on OS X.

* ensured the window geometry is remembered on OS X (v2)

* tweaked coding style
This commit is contained in:
ravas 2016-04-05 00:07:40 -07:00 committed by David Rosca
parent 209ba1f44c
commit effda91f7c
2 changed files with 8 additions and 19 deletions

View File

@ -1345,18 +1345,12 @@ void BrowserWindow::closeEvent(QCloseEvent* event)
} }
} }
#ifndef Q_OS_MAC saveSettings();
if (mApp->windowCount() == 1) {
if (quitApp()) {
event->accept();
}
else {
event->ignore();
}
return; #ifndef Q_OS_MAC
} if (mApp->windowCount() == 1)
#endif mApp->quitApplication();
#endif
event->accept(); event->accept();
} }
@ -1385,7 +1379,7 @@ void BrowserWindow::closeWindow()
} }
} }
bool BrowserWindow::quitApp() void BrowserWindow::saveSettings()
{ {
if (m_sideBar) { if (m_sideBar) {
saveSideBarWidth(); saveSideBarWidth();
@ -1399,15 +1393,10 @@ bool BrowserWindow::quitApp()
settings.setValue("WebSearchBarWidth", m_navigationToolbar->splitter()->sizes().at(1)); settings.setValue("WebSearchBarWidth", m_navigationToolbar->splitter()->sizes().at(1));
settings.setValue("SideBarWidth", m_sideBarWidth); settings.setValue("SideBarWidth", m_sideBarWidth);
settings.setValue("WebViewWidth", m_webViewWidth); settings.setValue("WebViewWidth", m_webViewWidth);
if (!isFullScreen())
if (!isFullScreen()) {
settings.setValue("WindowGeometry", saveGeometry()); settings.setValue("WindowGeometry", saveGeometry());
}
settings.endGroup(); settings.endGroup();
} }
mApp->quitApplication();
return true;
} }
void BrowserWindow::closeTab() void BrowserWindow::closeTab()

View File

@ -156,7 +156,7 @@ private slots:
void searchOnPage(); void searchOnPage();
void changeEncoding(); void changeEncoding();
bool quitApp(); void saveSettings();
void hideNavigationSlot(); void hideNavigationSlot();
private: private: