From 9ff76a5911d51667020593c199a5c3459d36b8f3 Mon Sep 17 00:00:00 2001 From: nowrep Date: Wed, 4 Jul 2012 19:13:44 +0200 Subject: [PATCH] Fixed showing duplicated (Private browsing) in window title - also don't save window geometry in private mode --- src/lib/app/qupzilla.cpp | 48 +++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 8e35f2d40..16d1ff7a7 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -205,7 +205,7 @@ void QupZilla::postLaunch() emit startingCompleted(); m_isStarting = false; - setWindowTitle(m_lastWindowTitle); + QMainWindow::setWindowTitle(m_lastWindowTitle); setUpdatesEnabled(true); } @@ -1736,30 +1736,32 @@ bool QupZilla::quitApp() saveSideBarWidth(); } - Settings settings; - int afterLaunch = settings.value("Web-URL-Settings/afterLaunch", 1).toInt(); - bool askOnClose = settings.value("Browser-Tabs-Settings/AskOnClosing", true).toBool(); + if (!mApp->isPrivateSession()) { + Settings settings; + 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.setValue("WindowMaximised", windowState().testFlag(Qt::WindowMaximized)); - settings.setValue("WindowGeometry", saveGeometry()); - settings.setValue("LocationBarWidth", m_navigationBar->splitter()->sizes().at(0)); - settings.setValue("WebSearchBarWidth", m_navigationBar->splitter()->sizes().at(1)); - settings.setValue("SideBarWidth", m_sideBarWidth); - settings.setValue("WebViewWidth", m_webViewWidth); - settings.endGroup(); + settings.beginGroup("Browser-View-Settings"); + settings.setValue("WindowMaximised", windowState().testFlag(Qt::WindowMaximized)); + settings.setValue("WindowGeometry", saveGeometry()); + settings.setValue("LocationBarWidth", m_navigationBar->splitter()->sizes().at(0)); + settings.setValue("WebSearchBarWidth", m_navigationBar->splitter()->sizes().at(1)); + settings.setValue("SideBarWidth", m_sideBarWidth); + settings.setValue("WebViewWidth", m_webViewWidth); + settings.endGroup(); - if (askOnClose && afterLaunch != 3 && m_tabWidget->count() > 1) { - 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.setCheckBoxText(tr("Don't ask again")); - dialog.setWindowTitle(tr("There are still open tabs")); - dialog.setIcon(qIconProvider->standardIcon(QStyle::SP_MessageBoxWarning)); - if (dialog.exec() != QDialog::Accepted) { - return false; - } - if (dialog.isChecked()) { - settings.setValue("Browser-Tabs-Settings/AskOnClosing", false); + if (askOnClose && afterLaunch != 3 && m_tabWidget->count() > 1) { + 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.setCheckBoxText(tr("Don't ask again")); + dialog.setWindowTitle(tr("There are still open tabs")); + dialog.setIcon(qIconProvider->standardIcon(QStyle::SP_MessageBoxWarning)); + if (dialog.exec() != QDialog::Accepted) { + return false; + } + if (dialog.isChecked()) { + settings.setValue("Browser-Tabs-Settings/AskOnClosing", false); + } } }