1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Fixed removing all cookies on close option.

Closes #731
This commit is contained in:
nowrep 2013-01-30 16:04:05 +01:00
parent 949bfe42ed
commit 109f607157
2 changed files with 8 additions and 7 deletions

View File

@ -671,14 +671,10 @@ void MainApplication::saveSettings()
settings.endGroup();
settings.beginGroup("Web-Browser-Settings");
bool deleteCookies = settings.value("deleteCookiesOnClose", false).toBool();
bool deleteHistory = settings.value("deleteHistoryOnClose", false).toBool();
bool deleteHtml5Storage = settings.value("deleteHTML5StorageOnClose", false).toBool();
settings.endGroup();
if (deleteCookies) {
m_cookiejar->clearCookies();
}
if (deleteHistory) {
m_historymodel->clearHistory();
}

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -177,11 +177,16 @@ bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const
void CookieJar::saveCookies()
{
if (m_deleteOnClose || mApp->isPrivateSession()) {
if (mApp->isPrivateSession()) {
return;
}
QList<QNetworkCookie> allCookies = getAllCookies();
QList<QNetworkCookie> allCookies;
// If we are deleting cookies on close, let's just save empty cookie list
if (!m_deleteOnClose) {
allCookies = getAllCookies();
}
QFile file(m_activeProfil + "cookies.dat");
file.open(QIODevice::WriteOnly);