From 4965704b1025a8029a2fe98ce099dec173525d21 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Wed, 13 Jan 2016 19:36:02 +0300 Subject: [PATCH] Fix NetworkCookieJar::deleteCookie() behavior to match Qt5 one --- src/base/net/downloadmanager.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/base/net/downloadmanager.cpp b/src/base/net/downloadmanager.cpp index fa8288f88..408733394 100644 --- a/src/base/net/downloadmanager.cpp +++ b/src/base/net/downloadmanager.cpp @@ -79,8 +79,19 @@ namespace virtual bool deleteCookie(const QNetworkCookie &cookie) { auto myCookies = allCookies(); - myCookies.removeAll(cookie); - setAllCookies(myCookies); + + QList::Iterator it; + for (it = myCookies.begin(); it != myCookies.end(); ++it) { + if ((it->name() == cookie.name()) + && (it->domain() == cookie.domain()) + && (it->path() == cookie.path())) { + myCookies.erase(it); + setAllCookies(myCookies); + return true; + } + } + + return false; } #endif