From b90cece697c11aa63bd686c72c7440c7dd857bd8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 5 Sep 2009 22:17:55 +0200 Subject: Simplified CookieJar management --- src/cookiejar.cpp | 16 ++++++---------- src/cookiejar.h | 2 -- src/mainwindow.cpp | 5 ----- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/cookiejar.cpp b/src/cookiejar.cpp index 5160d6ed..cd7b97fa 100644 --- a/src/cookiejar.cpp +++ b/src/cookiejar.cpp @@ -32,6 +32,10 @@ // Auto Includes #include "rekonq.h" +// Local Includes +#include "application.h" +#include "mainwindow.h" + // KDE Includes #include #include @@ -48,7 +52,6 @@ CookieJar::CookieJar(QObject* parent) : QNetworkCookieJar(parent) - , m_windowId(-1) , m_kcookiejar(new QDBusInterface("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer")) { } @@ -63,7 +66,7 @@ CookieJar::~CookieJar() QList CookieJar::cookiesForUrl(const QUrl & url) const { QList cookieList; - QDBusReply reply = m_kcookiejar->call("findCookies", url.toString() , m_windowId); + QDBusReply reply = m_kcookiejar->call("listCookies", url.toString() ); if (reply.isValid()) { @@ -85,20 +88,13 @@ bool CookieJar::setCookiesFromUrl(const QList & cookieList, cons { cookieHeader = "Set-Cookie: "; cookieHeader += cookie.toRawForm(); - m_kcookiejar->call("addCookies", url.toString(), cookieHeader, m_windowId); + m_kcookiejar->call("addCookies", url.toString(), cookieHeader, 0 ); } return !m_kcookiejar->lastError().isValid(); } -void CookieJar::setWindowId(qlonglong id) -{ - kDebug() << id; - m_windowId = id; -} - - void CookieJar::clear() { QDBusReply reply = m_kcookiejar->call( "deleteAllCookies" ); diff --git a/src/cookiejar.h b/src/cookiejar.h index f78a9662..4dea1e60 100644 --- a/src/cookiejar.h +++ b/src/cookiejar.h @@ -44,7 +44,6 @@ class CookieJar : public QNetworkCookieJar public: CookieJar(QObject* parent = 0); virtual ~CookieJar(); - void setWindowId(qlonglong id); virtual QList cookiesForUrl(const QUrl & url) const; virtual bool setCookiesFromUrl(const QList & cookieList, const QUrl & url); @@ -52,7 +51,6 @@ public: void clear(); private: - qlonglong m_windowId; QDBusInterface *m_kcookiejar; }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a6b663a3..04db6f6f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -208,11 +208,6 @@ void MainWindow::postLaunch() // accept d'n'd setAcceptDrops(true); - - // set CookieJar window Id - const qlonglong winId = window()->winId(); - Application::cookieJar()->setWindowId(winId); - Application::networkAccessManager()->metaData().insert("window-id", QString::number(winId)); } -- cgit v1.2.1