Skip to content

Commit

Permalink
ui: Allow accessing online resources in web view (fixes #474)
Browse files Browse the repository at this point in the history
This removes a custom network manager that was blocking all requests to
non-local resources.
  • Loading branch information
trollixx committed Mar 24, 2016
1 parent 8d0b4e5 commit 23aac1a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 122 deletions.
11 changes: 4 additions & 7 deletions src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "ui_mainwindow.h"

#include "aboutdialog.h"
#include "networkaccessmanager.h"
#include "searchitemdelegate.h"
#include "settingsdialog.h"
#include "core/application.h"
Expand Down Expand Up @@ -108,11 +107,9 @@ MainWindow::MainWindow(Core::Application *app, QWidget *parent) :
restoreGeometry(m_settings->windowGeometry);
ui->splitter->restoreState(m_settings->verticalSplitterGeometry);

m_zealNetworkManager = new NetworkAccessManager(this);
#ifdef USE_WEBENGINE
/// FIXME AngularJS workaround (zealnetworkaccessmanager.cpp)
#else
ui->webView->page()->setNetworkAccessManager(m_zealNetworkManager);
/// TODO: Custom headers and URL scheme for Qt WebEngine.
#ifndef USE_WEBENGINE
ui->webView->page()->setNetworkAccessManager(m_application->networkManager());
#endif

// menu
Expand Down Expand Up @@ -462,7 +459,7 @@ void MainWindow::createTab()
newTab->page->load(QUrl(startPageUrl));
#else
newTab->page->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
newTab->page->setNetworkAccessManager(m_zealNetworkManager);
newTab->page->setNetworkAccessManager(m_application->networkManager());
newTab->page->mainFrame()->load(QUrl(startPageUrl));
#endif

Expand Down
2 changes: 0 additions & 2 deletions src/ui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class Settings;
}

class ListModel;
class NetworkAccessManager;
class SearchModel;
class SettingsDialog;

Expand Down Expand Up @@ -143,7 +142,6 @@ private slots:
QList<SearchState *> m_tabs;

SearchState *m_searchState = nullptr;
Zeal::NetworkAccessManager *m_zealNetworkManager = nullptr;

Ui::MainWindow *ui = nullptr;
Zeal::Core::Application *m_application = nullptr;
Expand Down
70 changes: 0 additions & 70 deletions src/ui/networkaccessmanager.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions src/ui/networkaccessmanager.h

This file was deleted.

0 comments on commit 23aac1a

Please sign in to comment.