1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Fixed showing duplicated (Private browsing) in window title

- also don't save window geometry in private mode
This commit is contained in:
nowrep 2012-07-04 19:13:44 +02:00
parent b4c3c1b9b1
commit 9ff76a5911

View File

@ -205,7 +205,7 @@ void QupZilla::postLaunch()
emit startingCompleted(); emit startingCompleted();
m_isStarting = false; m_isStarting = false;
setWindowTitle(m_lastWindowTitle); QMainWindow::setWindowTitle(m_lastWindowTitle);
setUpdatesEnabled(true); setUpdatesEnabled(true);
} }
@ -1736,30 +1736,32 @@ bool QupZilla::quitApp()
saveSideBarWidth(); saveSideBarWidth();
} }
Settings settings; if (!mApp->isPrivateSession()) {
int afterLaunch = settings.value("Web-URL-Settings/afterLaunch", 1).toInt(); Settings settings;
bool askOnClose = settings.value("Browser-Tabs-Settings/AskOnClosing", true).toBool(); int afterLaunch = settings.value("Web-URL-Settings/afterLaunch", 1).toInt();
bool askOnClose = settings.value("Browser-Tabs-Settings/AskOnClosing", true).toBool();
settings.beginGroup("Browser-View-Settings"); settings.beginGroup("Browser-View-Settings");
settings.setValue("WindowMaximised", windowState().testFlag(Qt::WindowMaximized)); settings.setValue("WindowMaximised", windowState().testFlag(Qt::WindowMaximized));
settings.setValue("WindowGeometry", saveGeometry()); settings.setValue("WindowGeometry", saveGeometry());
settings.setValue("LocationBarWidth", m_navigationBar->splitter()->sizes().at(0)); settings.setValue("LocationBarWidth", m_navigationBar->splitter()->sizes().at(0));
settings.setValue("WebSearchBarWidth", m_navigationBar->splitter()->sizes().at(1)); settings.setValue("WebSearchBarWidth", m_navigationBar->splitter()->sizes().at(1));
settings.setValue("SideBarWidth", m_sideBarWidth); settings.setValue("SideBarWidth", m_sideBarWidth);
settings.setValue("WebViewWidth", m_webViewWidth); settings.setValue("WebViewWidth", m_webViewWidth);
settings.endGroup(); settings.endGroup();
if (askOnClose && afterLaunch != 3 && m_tabWidget->count() > 1) { if (askOnClose && afterLaunch != 3 && m_tabWidget->count() > 1) {
CheckBoxDialog dialog(QDialogButtonBox::Yes | QDialogButtonBox::No, this); CheckBoxDialog dialog(QDialogButtonBox::Yes | QDialogButtonBox::No, this);
dialog.setText(tr("There are still %1 open tabs and your session won't be stored. \nAre you sure to quit QupZilla?").arg(m_tabWidget->count())); dialog.setText(tr("There are still %1 open tabs and your session won't be stored. \nAre you sure to quit QupZilla?").arg(m_tabWidget->count()));
dialog.setCheckBoxText(tr("Don't ask again")); dialog.setCheckBoxText(tr("Don't ask again"));
dialog.setWindowTitle(tr("There are still open tabs")); dialog.setWindowTitle(tr("There are still open tabs"));
dialog.setIcon(qIconProvider->standardIcon(QStyle::SP_MessageBoxWarning)); dialog.setIcon(qIconProvider->standardIcon(QStyle::SP_MessageBoxWarning));
if (dialog.exec() != QDialog::Accepted) { if (dialog.exec() != QDialog::Accepted) {
return false; return false;
} }
if (dialog.isChecked()) { if (dialog.isChecked()) {
settings.setValue("Browser-Tabs-Settings/AskOnClosing", false); settings.setValue("Browser-Tabs-Settings/AskOnClosing", false);
}
} }
} }