Move the call to cache initialization to the WebPageManager

This commit is contained in:
Joan Karadimov 2017-03-26 23:31:29 +03:00 committed by Matthew Horan
parent b98d288be8
commit 65c56752a0
3 changed files with 4 additions and 5 deletions

View File

@ -40,10 +40,6 @@ WebPage::WebPage(WebPageManager *manager, QObject *parent) : QWebPage(parent) {
settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
settings()->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
manager->initOfflineWebApplicationCache();
createWindow();
}
void WebPage::createWindow() {

View File

@ -57,6 +57,9 @@ WebPage *WebPageManager::currentPage() const {
WebPage *WebPageManager::createPage() {
WebPage *page = new WebPage(this);
initOfflineWebApplicationCache();
page->createWindow();
connect(page, SIGNAL(loadStarted()),
this, SLOT(emitLoadStarted()));
connect(page, SIGNAL(pageFinished(bool)),

View File

@ -42,7 +42,6 @@ class WebPageManager : public QObject {
void setUnknownUrlMode(UnknownUrlHandler::Mode);
void allowUrl(const QString &);
void blockUrl(const QString &);
void initOfflineWebApplicationCache();
public slots:
void emitLoadStarted();
@ -58,6 +57,7 @@ class WebPageManager : public QObject {
private:
void emitPageFinished();
static void handleDebugMessage(QtMsgType type, const char *message);
void initOfflineWebApplicationCache();
QList<WebPage *> m_pages;
QList<QNetworkReply *> m_pendingReplies;