summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-07-31 17:09:24 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-07-31 17:09:24 +0200
commit7dbff807a4a71d1bd81f438fe0facd833add3293 (patch)
tree8816d8f0177fbd22978cf2d89fa8c4c21b5472a3 /src
parentString fix (diff)
downloadrekonq-7dbff807a4a71d1bd81f438fe0facd833add3293.tar.xz
This commit removes rekonq KDEnetwork dependencies.
All this just to support KDE 4.2 Anyway this will be dropped with rekonq 0.3..
Diffstat (limited to 'src')
-rw-r--r--src/kaccessmanager.cpp40
-rw-r--r--src/kaccessmanager.h10
2 files changed, 40 insertions, 10 deletions
diff --git a/src/kaccessmanager.cpp b/src/kaccessmanager.cpp
index c298ed88..a79ff865 100644
--- a/src/kaccessmanager.cpp
+++ b/src/kaccessmanager.cpp
@@ -53,7 +53,7 @@
NetworkAccessManager::NetworkAccessManager(QObject *parent)
- : KNetworkAccessManager(parent)
+ : QNetworkAccessManager(parent)
{
connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)));
@@ -67,10 +67,8 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent)
loadSettings();
- QNetworkDiskCache *diskCache = new QNetworkDiskCache(this);
- QString location = KStandardDirs::locateLocal("cache", "", true);
- diskCache->setCacheDirectory(location);
- setCache(diskCache);
+ // resetting disk cache
+ resetDiskCache();
}
@@ -129,6 +127,38 @@ void NetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthent
}
+void NetworkAccessManager::resetDiskCache()
+{
+ if(!m_diskCache)
+ {
+ m_diskCache = new QNetworkDiskCache(this);
+ QString location = KStandardDirs::locateLocal("cache", "", true);
+ kDebug() << location;
+
+ m_diskCache->setCacheDirectory(location);
+ setCache(m_diskCache);
+ }
+ else
+ {
+ QString location = m_diskCache->cacheDirectory();
+// setCache(0);
+// delete m_diskCache;
+
+ QDir cacheDir(location + QString("/http") );
+ QStringList fileList = cacheDir.entryList();
+ foreach(QString str, fileList)
+ {
+ QFile file(str);
+ file.remove();
+ }
+
+// m_diskCache = new QNetworkDiskCache(this);
+// m_diskCache->setCacheDirectory(location);
+// setCache(m_diskCache);
+ }
+}
+
+
void NetworkAccessManager::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth)
{
MainWindow *mainWindow = Application::instance()->mainWindow();
diff --git a/src/kaccessmanager.h b/src/kaccessmanager.h
index ed5c208d..8a88594f 100644
--- a/src/kaccessmanager.h
+++ b/src/kaccessmanager.h
@@ -22,20 +22,20 @@
#ifndef KACCESSMANAGER_H
#define KACCESSMANAGER_H
-//KDE Network Includes
-#include <kdenetwork/knetworkaccessmanager.h>
-#include <kdenetwork/knetworkreply.h>
-// Forward Declarations
+// Qt Includes
+#include <QtNetwork/QNetworkAccessManager>
-class NetworkAccessManager : public KNetworkAccessManager
+class NetworkAccessManager : public QNetworkAccessManager
{
Q_OBJECT
public:
NetworkAccessManager(QObject *parent = 0);
+ void resetDiskCache();
+
public slots:
void loadSettings();