diff options
author | Lionel Chauvin <megabigbug@yahoo.fr> | 2009-08-05 22:47:31 +0200 |
---|---|---|
committer | Lionel Chauvin <megabigbug@yahoo.fr> | 2009-08-05 22:47:31 +0200 |
commit | 4b38a882c26d23f22f603f8638c178b2bf4e183a (patch) | |
tree | 340663084cb34fc03692bfbfd651eba1f297bec4 /src | |
parent | add m_windowId else unable to connect to KCookieJarServer (diff) | |
download | rekonq-4b38a882c26d23f22f603f8638c178b2bf4e183a.tar.xz |
fix: clear cookies
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/cookiejar.cpp | 14 | ||||
-rw-r--r-- | src/cookiejar.h | 2 | ||||
-rw-r--r-- | src/mainwindow.cpp | 2 |
4 files changed, 16 insertions, 6 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bc8ef53d..003b55bf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,14 +24,10 @@ SET( rekonq_SRCS lineedit.cpp stackedurlbar.cpp webpage.cpp -# cookiedialog.cpp -# cookieexceptiondialog.cpp ) KDE4_ADD_UI_FILES( rekonq_SRCS -# cookies.ui -# cookiesexceptions.ui password.ui proxy.ui settings_general.ui diff --git a/src/cookiejar.cpp b/src/cookiejar.cpp index 324fe827..e6409f3e 100644 --- a/src/cookiejar.cpp +++ b/src/cookiejar.cpp @@ -86,7 +86,6 @@ QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl & url) const } - bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> & cookieList, const QUrl & url) { @@ -109,7 +108,20 @@ bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> & cookieList, cons return false; } + void CookieJar::setWindowId(qlonglong id) { m_windowId=id; } + + +void CookieJar::clear() +{ + QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer", QDBusConnection::sessionBus()); + QDBusReply<void> reply = kcookiejar.call( "deleteAllCookies" ); + if (!reply.isValid()) + { + kWarning() << "Unable to delete all the cookies as requested."; + return; + } +}
\ No newline at end of file diff --git a/src/cookiejar.h b/src/cookiejar.h index e6e3f701..a1fe7d2d 100644 --- a/src/cookiejar.h +++ b/src/cookiejar.h @@ -46,6 +46,8 @@ public: virtual QList<QNetworkCookie> cookiesForUrl(const QUrl & url) const; virtual bool setCookiesFromUrl(const QList<QNetworkCookie> & cookieList, const QUrl & url); + void clear(); + private: qlonglong m_windowId; }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7de20c6e..e27c75fe 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -972,7 +972,7 @@ void MainWindow::clearPrivateData() if(clearWidget.clearCookies->isChecked()) { - // FIXME (!) Application::cookieJar()->clear(); + Application::cookieJar()->clear(); } if(clearWidget.clearCachedPages->isChecked()) |