diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-09-26 00:56:41 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-09-26 00:56:41 +0200 |
commit | 8d587d4627fcf3d4c811bdd201d7cc1435a1153d (patch) | |
tree | 988535ce9d736721a11c39130c01bdd15274eccc /src/cookiejar.cpp | |
parent | AccessManager fixes (diff) | |
download | rekonq-8d587d4627fcf3d4c811bdd201d7cc1435a1153d.tar.xz |
cookie jar fixes...
Diffstat (limited to 'src/cookiejar.cpp')
-rw-r--r-- | src/cookiejar.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/cookiejar.cpp b/src/cookiejar.cpp index a8ba18bc..05ffb987 100644 --- a/src/cookiejar.cpp +++ b/src/cookiejar.cpp @@ -52,21 +52,22 @@ CookieJar::CookieJar(QObject* parent) : QNetworkCookieJar(parent) - , m_kcookiejar(new QDBusInterface("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer")) + , m_windowId(-1) { } CookieJar::~CookieJar() { - delete m_kcookiejar; } QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl & url) const { + + QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer"); QList<QNetworkCookie> cookieList; - QDBusReply<QString> reply = m_kcookiejar->call("listCookies", url.toString() ); + QDBusReply<QString> reply = kcookiejar.call("findDOMCookies", url.toString() ); if (reply.isValid()) { @@ -83,24 +84,27 @@ QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl & url) const bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> & cookieList, const QUrl & url) { + QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer"); QByteArray cookieHeader; Q_FOREACH(const QNetworkCookie& cookie, cookieList) { cookieHeader = "Set-Cookie: "; cookieHeader += cookie.toRawForm(); - m_kcookiejar->call("addCookies", url.toString(), cookieHeader, 0 ); + kcookiejar.call("addCookies", url.toString(), cookieHeader, m_windowId ); } - return !m_kcookiejar->lastError().isValid(); + return !kcookiejar.lastError().isValid(); } void CookieJar::clear() { - QDBusReply<void> reply = m_kcookiejar->call( "deleteAllCookies" ); + QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer"); + + QDBusReply<void> reply = kcookiejar.call( "deleteAllCookies" ); if (!reply.isValid()) { kWarning() << "Unable to delete all the cookies as requested."; - return; } + return; } |