mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Merge branch 'master' of github.com:QupZilla/qupzilla
This commit is contained in:
commit
f329e4914c
@ -62,7 +62,8 @@ static bool matchDomain(const QString &domain, const QString &filter)
|
||||
|
||||
int index = domain.indexOf(filter);
|
||||
|
||||
return (index > 0 && filter[0] == QLatin1Char('.'));
|
||||
return (index == 1 && domain[0] == QLatin1Char('.')) ||
|
||||
(index > 0 && filter[0] == QLatin1Char('.'));
|
||||
}
|
||||
|
||||
static int listContainsDomain(const QStringList &list, const QString &domain)
|
||||
@ -183,10 +184,24 @@ void CookieJar::saveCookies()
|
||||
|
||||
QList<QNetworkCookie> allCookies;
|
||||
|
||||
// If we are deleting cookies on close, let's just save empty cookie list
|
||||
if (!m_deleteOnClose) {
|
||||
// If we are deleting cookies on close, let's just save empty cookie list
|
||||
allCookies = getAllCookies();
|
||||
}
|
||||
else {
|
||||
// Do not delete whitelisted cookies
|
||||
QList<QNetworkCookie> cookies = getAllCookies();
|
||||
int count = cookies.count();
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
const QNetworkCookie &cookie = cookies.at(i);
|
||||
int result = listContainsDomain(m_whitelist, cookie.domain());
|
||||
|
||||
if (result == 1) {
|
||||
allCookies.append(cookie);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QFile file(m_activeProfil + "cookies.dat");
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
Loading…
Reference in New Issue
Block a user