From 109f6071573b93df8a9e1971440194faa1212528 Mon Sep 17 00:00:00 2001 From: nowrep Date: Wed, 30 Jan 2013 16:04:05 +0100 Subject: [PATCH] Fixed removing all cookies on close option. Closes #731 --- src/lib/app/mainapplication.cpp | 4 ---- src/lib/cookies/cookiejar.cpp | 11 ++++++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index aa10b3318..8eaf9f3f1 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -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(); } diff --git a/src/lib/cookies/cookiejar.cpp b/src/lib/cookies/cookiejar.cpp index 84babe7e3..bb409c921 100644 --- a/src/lib/cookies/cookiejar.cpp +++ b/src/lib/cookies/cookiejar.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 &cookieList, const void CookieJar::saveCookies() { - if (m_deleteOnClose || mApp->isPrivateSession()) { + if (mApp->isPrivateSession()) { return; } - QList allCookies = getAllCookies(); + QList 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);