From 6a2579a22cf1b3ffdfc43e0848363cc218ddbaed Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 30 Sep 2015 15:02:10 +0200 Subject: [PATCH] Cleanups Remove PAC proxy option as it is hardly to ever be supported in QtWebEngine. --- src/lib/network/networkmanager.h | 74 ----------------------------- src/lib/preferences/preferences.cpp | 23 --------- src/lib/preferences/preferences.h | 2 - src/lib/preferences/preferences.ui | 47 ++---------------- src/lib/webengine/webview.cpp | 8 ---- src/lib/webengine/webview.h | 1 - 6 files changed, 3 insertions(+), 152 deletions(-) diff --git a/src/lib/network/networkmanager.h b/src/lib/network/networkmanager.h index 3339a2085..59c8d7f86 100644 --- a/src/lib/network/networkmanager.h +++ b/src/lib/network/networkmanager.h @@ -38,78 +38,4 @@ private: QHash m_ignoredSslErrors; }; -#if QTWEBENGINE_DISABLED - -#include -#include - -#include "qzcommon.h" -#include "networkmanagerproxy.h" - -class AdBlockManager; -class NetworkProxyFactory; -class QupZillaSchemeHandler; -class SchemeHandler; - -class QUPZILLA_EXPORT NetworkManager : public NetworkManagerProxy -{ - Q_OBJECT -public: - explicit NetworkManager(QObject* parent = 0); - QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData); - - void loadSettings(); - void saveSettings(); - void loadCertificates(); - - QList getCaCertificates() { return m_caCerts; } - QList getLocalCertificates() { return m_localCerts; } - - void removeLocalCertificate(const QSslCertificate &cert); - void addLocalCertificate(const QSslCertificate &cert); - - void setCertificatePaths(const QStringList &paths) { m_certPaths = paths; } - QStringList certificatePaths() { return m_certPaths; } - - bool isIgnoringAllWarnings() const; - void setIgnoreAllWarnings(bool state); - - bool isDisablingWeakCiphers() const; - void setDisableWeakCiphers(bool state); - - NetworkProxyFactory* proxyFactory() const; - - bool registerSchemeHandler(const QString &scheme, SchemeHandler* handler); - bool unregisterSchemeHandler(const QString &scheme, SchemeHandler* handler); - -signals: - void sslDialogClosed(); - -private slots: - void ftpAuthentication(const QUrl &url, QAuthenticator* auth); - void sslError(QNetworkReply* reply, QList errors); - void setSSLConfiguration(QNetworkReply* reply); - -private: - void disableWeakCiphers(bool disable); - - AdBlockManager* m_adblockManager; - NetworkProxyFactory* m_proxyFactory; - - QStringList m_certPaths; - QList m_caCerts; - QList m_localCerts; - QList m_tempAllowedCerts; - - QHash m_schemeHandlers; - QByteArray m_acceptLanguage; - - bool m_ignoreAllWarnings; - bool m_disableWeakCiphers; - bool m_doNotTrack; - bool m_sendReferer; -}; - -#endif - #endif // NETWORKMANAGER_H diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index b59ae49fa..0d4bbf2fc 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -47,7 +47,6 @@ #include "registerqappassociation.h" #include "profilemanager.h" #include "html5permissions/html5permissionsdialog.h" -#include "pac/pacmanager.h" #include "searchenginesdialog.h" #include @@ -426,7 +425,6 @@ Preferences::Preferences(BrowserWindow* window) ui->systemProxy->setChecked(proxyPreference == NetworkProxyFactory::SystemProxy); ui->noProxy->setChecked(proxyPreference == NetworkProxyFactory::NoProxy); ui->manualProxy->setChecked(proxyPreference == NetworkProxyFactory::DefinedProxy); - ui->pacProxy->setChecked(proxyPreference == NetworkProxyFactory::ProxyAutoConfig); if (proxyType == QNetworkProxy::HttpProxy) { ui->proxyType->setCurrentIndex(0); } @@ -445,18 +443,14 @@ Preferences::Preferences(BrowserWindow* window) ui->httpsProxyUsername->setText(settings.value("HttpsUsername", "").toString()); ui->httpsProxyPassword->setText(settings.value("HttpsPassword", "").toString()); - ui->pacUrl->setText(settings.value("PacUrl", QUrl()).toUrl().toString()); ui->proxyExceptions->setText(settings.value("ProxyExceptions", QStringList() << "localhost" << "127.0.0.1").toStringList().join(",")); settings.endGroup(); useDifferentProxyForHttpsChanged(ui->useHttpsProxy->isChecked()); setManualProxyConfigurationEnabled(proxyPreference == NetworkProxyFactory::DefinedProxy); - setProxyAutoConfigEnabled(proxyPreference == NetworkProxyFactory::ProxyAutoConfig); connect(ui->manualProxy, SIGNAL(toggled(bool)), this, SLOT(setManualProxyConfigurationEnabled(bool))); - connect(ui->pacProxy, SIGNAL(toggled(bool)), this, SLOT(setProxyAutoConfigEnabled(bool))); connect(ui->useHttpsProxy, SIGNAL(toggled(bool)), this, SLOT(useDifferentProxyForHttpsChanged(bool))); - connect(ui->reloadPac, SIGNAL(clicked()), this, SLOT(reloadPacFileClicked())); //CONNECTS connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); @@ -633,12 +627,6 @@ void Preferences::setManualProxyConfigurationEnabled(bool state) ui->useHttpsProxy->setEnabled(state); } -void Preferences::setProxyAutoConfigEnabled(bool state) -{ - ui->pacUrl->setEnabled(state); - ui->reloadPac->setEnabled(state); -} - void Preferences::saveHistoryChanged(bool stat) { ui->deleteHistoryOnClose->setEnabled(stat); @@ -717,13 +705,6 @@ void Preferences::changeCachePathClicked() ui->cachePath->setText(path); } -void Preferences::reloadPacFileClicked() -{ -#if QTWEBENGINE_DISABLED - mApp->networkManager()->proxyFactory()->pacManager()->downloadPacFile(); -#endif -} - void Preferences::showPassManager(bool state) { if (m_autoFillManager) { @@ -995,9 +976,6 @@ void Preferences::saveSettings() else if (ui->noProxy->isChecked()) { proxyPreference = NetworkProxyFactory::NoProxy; } - else if (ui->pacProxy->isChecked()) { - proxyPreference = NetworkProxyFactory::ProxyAutoConfig; - } else { proxyPreference = NetworkProxyFactory::DefinedProxy; } @@ -1024,7 +1002,6 @@ void Preferences::saveSettings() settings.setValue("HttpsUsername", ui->httpsProxyUsername->text()); settings.setValue("HttpsPassword", ui->httpsProxyPassword->text()); - settings.setValue("PacUrl", ui->pacUrl->text()); settings.setValue("ProxyExceptions", ui->proxyExceptions->text().split(QLatin1Char(','), QString::SkipEmptyParts)); settings.endGroup(); diff --git a/src/lib/preferences/preferences.h b/src/lib/preferences/preferences.h index e08b1d33a..18a32b2f7 100644 --- a/src/lib/preferences/preferences.h +++ b/src/lib/preferences/preferences.h @@ -70,11 +70,9 @@ private slots: void allowCacheChanged(bool state); void showPassManager(bool state); void setManualProxyConfigurationEnabled(bool state); - void setProxyAutoConfigEnabled(bool state); void useDifferentProxyForHttpsChanged(bool state); void showTabPreviewsChanged(bool state); void changeCachePathClicked(); - void reloadPacFileClicked(); void newTabChanged(int value); void afterLaunchChanged(int value); diff --git a/src/lib/preferences/preferences.ui b/src/lib/preferences/preferences.ui index 108d7b362..c3421cf27 100644 --- a/src/lib/preferences/preferences.ui +++ b/src/lib/preferences/preferences.ui @@ -1405,48 +1405,14 @@ Proxy Configuration - - - - - - Proxy Auto-Config (.pac) file - - - - - - - Reload - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 50 - 20 - - - - - - - + <b>Exceptions</b> - + @@ -1460,7 +1426,7 @@ - + Qt::Vertical @@ -1653,13 +1619,6 @@ - - - - Use script for automatic configuration: - - - diff --git a/src/lib/webengine/webview.cpp b/src/lib/webengine/webview.cpp index 7321c7f7a..7b3e44bcd 100644 --- a/src/lib/webengine/webview.cpp +++ b/src/lib/webengine/webview.cpp @@ -514,13 +514,6 @@ void WebView::downloadUrlToDisk() #endif } -void WebView::copyImageToClipboard() -{ -#if QTWEBENGINE_DISABLED - triggerPageAction(QWebEnginePage::CopyImageToClipboard); -#endif -} - void WebView::openActionUrl() { if (QAction* action = qobject_cast(sender())) { @@ -800,7 +793,6 @@ void WebView::createImageContextMenu(QMenu* menu, const WebHitTestResult &hitTes connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl())); connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab())); menu->addAction(act); - menu->addAction(tr("Copy im&age"), this, SLOT(copyImageToClipboard()))->setData(hitTest.imageUrl()); menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.imageUrl()); menu->addSeparator(); #if QTWEBENGINE_DISABLED diff --git a/src/lib/webengine/webview.h b/src/lib/webengine/webview.h index 49abe6897..b0979cff6 100644 --- a/src/lib/webengine/webview.h +++ b/src/lib/webengine/webview.h @@ -120,7 +120,6 @@ protected slots: void sendLinkByMail(); void copyLinkToClipboard(); void downloadUrlToDisk(); - void copyImageToClipboard(); void openActionUrl(); void showSiteInfo(); void searchSelectedText();