diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-09-05 22:17:55 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-09-05 22:17:55 +0200 |
commit | b90cece697c11aa63bd686c72c7440c7dd857bd8 (patch) | |
tree | e05c5ce105f72cce11a1810dd0d0e1249ddc101f /src | |
parent | Restored the beautiful CTRL + L shortcut. (diff) | |
download | rekonq-b90cece697c11aa63bd686c72c7440c7dd857bd8.tar.xz |
Simplified CookieJar management
Diffstat (limited to 'src')
-rw-r--r-- | src/cookiejar.cpp | 16 | ||||
-rw-r--r-- | src/cookiejar.h | 2 | ||||
-rw-r--r-- | 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 <KConfig> #include <KStandardDirs> @@ -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<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl & url) const { QList<QNetworkCookie> cookieList; - QDBusReply<QString> reply = m_kcookiejar->call("findCookies", url.toString() , m_windowId); + QDBusReply<QString> reply = m_kcookiejar->call("listCookies", url.toString() ); if (reply.isValid()) { @@ -85,20 +88,13 @@ bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> & 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<void> 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<QNetworkCookie> cookiesForUrl(const QUrl & url) const; virtual bool setCookiesFromUrl(const QList<QNetworkCookie> & 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)); } |