Fix the 'Reset' command in debug builds (on Windows)
This commit is contained in:
parent
01c1a064f5
commit
b98d288be8
|
@ -41,10 +41,7 @@ WebPage::WebPage(WebPageManager *manager, QObject *parent) : QWebPage(parent) {
|
||||||
settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
|
settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
|
||||||
settings()->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
|
settings()->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
|
||||||
|
|
||||||
if(QFileInfo("tmp").isDir()) {
|
manager->initOfflineWebApplicationCache();
|
||||||
settings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
|
|
||||||
settings()->setOfflineWebApplicationCachePath("tmp");
|
|
||||||
}
|
|
||||||
|
|
||||||
createWindow();
|
createWindow();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,14 @@
|
||||||
#include "MissingContentHeaderRequestHandler.h"
|
#include "MissingContentHeaderRequestHandler.h"
|
||||||
#include "UnknownUrlHandler.h"
|
#include "UnknownUrlHandler.h"
|
||||||
#include "NetworkRequestFactory.h"
|
#include "NetworkRequestFactory.h"
|
||||||
|
#include <QWebSettings>
|
||||||
|
|
||||||
WebPageManager::WebPageManager(QObject *parent) : QObject(parent) {
|
WebPageManager::WebPageManager(QObject *parent) : QObject(parent) {
|
||||||
m_ignoreSslErrors = false;
|
m_ignoreSslErrors = false;
|
||||||
m_cookieJar = new NetworkCookieJar(this);
|
m_cookieJar = new NetworkCookieJar(this);
|
||||||
m_success = true;
|
m_success = true;
|
||||||
m_loggingEnabled = false;
|
m_loggingEnabled = false;
|
||||||
|
m_isCacheInitialized = false;
|
||||||
m_ignoredOutput = new QFile(this);
|
m_ignoredOutput = new QFile(this);
|
||||||
m_timeout = -1;
|
m_timeout = -1;
|
||||||
m_customHeadersRequestHandler = new CustomHeadersRequestHandler(
|
m_customHeadersRequestHandler = new CustomHeadersRequestHandler(
|
||||||
|
@ -217,3 +219,11 @@ void WebPageManager::allowUrl(const QString &url) {
|
||||||
void WebPageManager::blockUrl(const QString &url) {
|
void WebPageManager::blockUrl(const QString &url) {
|
||||||
m_blacklistedRequestHandler->blockUrl(url);
|
m_blacklistedRequestHandler->blockUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebPageManager::initOfflineWebApplicationCache() {
|
||||||
|
if (!m_isCacheInitialized && QFileInfo("tmp").isDir()) {
|
||||||
|
QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
|
||||||
|
QWebSettings::globalSettings()->setOfflineWebApplicationCachePath("tmp");
|
||||||
|
m_isCacheInitialized = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ class WebPageManager : public QObject {
|
||||||
void setUnknownUrlMode(UnknownUrlHandler::Mode);
|
void setUnknownUrlMode(UnknownUrlHandler::Mode);
|
||||||
void allowUrl(const QString &);
|
void allowUrl(const QString &);
|
||||||
void blockUrl(const QString &);
|
void blockUrl(const QString &);
|
||||||
|
void initOfflineWebApplicationCache();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void emitLoadStarted();
|
void emitLoadStarted();
|
||||||
|
@ -66,6 +67,7 @@ class WebPageManager : public QObject {
|
||||||
QSet<WebPage *> m_started;
|
QSet<WebPage *> m_started;
|
||||||
bool m_success;
|
bool m_success;
|
||||||
bool m_loggingEnabled;
|
bool m_loggingEnabled;
|
||||||
|
bool m_isCacheInitialized;
|
||||||
QFile *m_ignoredOutput;
|
QFile *m_ignoredOutput;
|
||||||
int m_timeout;
|
int m_timeout;
|
||||||
NetworkAccessManager *m_networkAccessManager;
|
NetworkAccessManager *m_networkAccessManager;
|
||||||
|
|
Loading…
Reference in New Issue