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 | |
parent | AccessManager fixes (diff) | |
download | rekonq-8d587d4627fcf3d4c811bdd201d7cc1435a1153d.tar.xz |
cookie jar fixes...
Diffstat (limited to 'src')
-rw-r--r-- | src/cookiejar.cpp | 18 | ||||
-rw-r--r-- | src/cookiejar.h | 3 | ||||
-rw-r--r-- | src/webpage.cpp | 7 |
3 files changed, 17 insertions, 11 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; } diff --git a/src/cookiejar.h b/src/cookiejar.h index 4dea1e60..3f9f366c 100644 --- a/src/cookiejar.h +++ b/src/cookiejar.h @@ -31,7 +31,6 @@ // Qt Includes #include <QtNetwork/QNetworkCookieJar> -#include <QtDBus/QDBusInterface> // Forward Declarations class QUrl; @@ -51,7 +50,7 @@ public: void clear(); private: - QDBusInterface *m_kcookiejar; + qlonglong m_windowId; }; #endif // RECOOKIEJAR_H diff --git a/src/webpage.cpp b/src/webpage.cpp index f1e5db33..942f20e3 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -272,8 +272,11 @@ bool WebPage::javaScriptPrompt(QWebFrame *frame, const QString &msg, const QStri QObject *WebPage::createPlugin(const QString &classId, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues) { - kDebug() << "create Plugin requested with classId: " << classId; - + kDebug() << "create Plugin requested:"; + kDebug() << "classid:" << classId; + kDebug() << "url:" << url; + kDebug() << "paramNames:" << paramNames << " paramValues:" << paramValues; + QUiLoader loader; return loader.createWidget(classId, view()); } |