From 16b28a3a90eb7f2b0bc2a39b65895bbcf0381f04 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 29 Sep 2015 10:55:24 +0200 Subject: [PATCH] Preferences: Remove not working options Also fix disabling local cache --- src/lib/app/mainapplication.cpp | 6 +- src/lib/preferences/preferences.cpp | 56 ------ src/lib/preferences/preferences.h | 4 - src/lib/preferences/preferences.ui | 285 ++++------------------------ 4 files changed, 46 insertions(+), 305 deletions(-) diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index a358b9c70..ca241a736 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -899,16 +899,18 @@ void MainApplication::loadSettings() settings.endGroup(); QWebEngineProfile* profile = QWebEngineProfile::defaultProfile(); - profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache); profile->setPersistentCookiesPolicy(QWebEngineProfile::AllowPersistentCookies); profile->setPersistentStoragePath(DataPaths::currentProfilePath()); QString defaultPath = DataPaths::path(DataPaths::Cache); if (!defaultPath.startsWith(DataPaths::currentProfilePath())) - defaultPath.append(QLatin1Char('/') + ProfileManager::currentProfile()); + defaultPath.append(QLatin1Char('/') + ProfileManager::currentProfile()); const QString &cachePath = settings.value("Web-Browser-Settings/CachePath", defaultPath).toString(); profile->setCachePath(cachePath); + const bool allowCache = settings.value(QSL("Web-Browser-Settings/AllowLocalCache"), true).toBool(); + profile->setHttpCacheType(allowCache ? QWebEngineProfile::DiskHttpCache : QWebEngineProfile::MemoryHttpCache); + if (isPrivate()) { webSettings->setAttribute(QWebEngineSettings::LocalStorageEnabled, false); history()->setSaving(false); diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index 8e635bd27..ab78bc898 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -29,7 +29,6 @@ #include "pluginproxy.h" #include "pluginsmanager.h" #include "qtwin.h" -#include "sslmanager.h" #include "jsoptions.h" #include "networkproxyfactory.h" #include "networkmanager.h" @@ -275,16 +274,11 @@ Preferences::Preferences(BrowserWindow* window) settings.beginGroup("Web-Browser-Settings"); ui->allowPlugins->setChecked(settings.value("allowFlash", true).toBool()); ui->allowJavaScript->setChecked(settings.value("allowJavaScript", true).toBool()); - ui->allowJava->setChecked(settings.value("allowJava", true).toBool()); - ui->allowDNSPrefetch->setChecked(settings.value("DNS-Prefetch", false).toBool()); ui->linksInFocusChain->setChecked(settings.value("IncludeLinkInFocusChain", false).toBool()); - ui->zoomTextOnly->setChecked(settings.value("zoomTextOnly", false).toBool()); ui->spatialNavigation->setChecked(settings.value("SpatialNavigation", false).toBool()); ui->animateScrolling->setChecked(settings.value("AnimateScrolling", true).toBool()); - ui->printEBackground->setChecked(settings.value("PrintElementBackground", true).toBool()); ui->wheelScroll->setValue(settings.value("wheelScrollLines", qApp->wheelScrollLines()).toInt()); ui->xssAuditing->setChecked(settings.value("XSSAuditing", false).toBool()); - ui->formsUndoRedo->setChecked(settings.value("enableFormsUndoRedo", false).toBool()); foreach (int level, WebView::zoomLevels()) { ui->defaultZoomLevel->addItem(QString("%1%").arg(level)); @@ -293,10 +287,6 @@ Preferences::Preferences(BrowserWindow* window) ui->closeAppWithCtrlQ->setChecked(settings.value("closeAppWithCtrlQ", true).toBool()); //Cache - ui->pagesInCache->setValue(settings.value("maximumCachedPages", 3).toInt()); - connect(ui->pagesInCache, SIGNAL(valueChanged(int)), this, SLOT(pageCacheValueChanged(int))); - ui->pageCacheLabel->setText(QString::number(ui->pagesInCache->value())); - ui->allowCache->setChecked(settings.value("AllowLocalCache", true).toBool()); ui->cacheMB->setValue(settings.value("LocalCacheSize", 50).toInt()); ui->MBlabel->setText(settings.value("LocalCacheSize", 50).toString() + " MB"); @@ -338,23 +328,16 @@ Preferences::Preferences(BrowserWindow* window) settings.beginGroup("DownloadManager"); ui->downLoc->setText(settings.value("defaultDownloadPath", "").toString()); ui->closeDownManOnFinish->setChecked(settings.value("CloseManagerOnFinish", false).toBool()); - ui->downlaodNativeSystemDialog->setChecked(settings.value("useNativeDialog", DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG).toBool()); if (ui->downLoc->text().isEmpty()) { ui->askEverytime->setChecked(true); } else { ui->useDefined->setChecked(true); } - ui->useExternalDownManager->setChecked(settings.value("UseExternalManager", false).toBool()); - ui->externalDownExecutable->setText(settings.value("ExternalManagerExecutable", "").toString()); - ui->externalDownArguments->setText(settings.value("ExternalManagerArguments", "").toString()); - connect(ui->useExternalDownManager, SIGNAL(toggled(bool)), this, SLOT(useExternalDownManagerChanged(bool))); connect(ui->useDefined, SIGNAL(toggled(bool)), this, SLOT(downLocChanged(bool))); connect(ui->downButt, SIGNAL(clicked()), this, SLOT(chooseDownPath())); - connect(ui->chooseExternalDown, SIGNAL(clicked()), this, SLOT(chooseExternalDownloadManager())); downLocChanged(ui->useDefined->isChecked()); - useExternalDownManagerChanged(ui->useExternalDownManager->isChecked()); settings.endGroup(); //FONTS @@ -479,7 +462,6 @@ Preferences::Preferences(BrowserWindow* window) connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); connect(ui->cookieManagerBut, SIGNAL(clicked()), this, SLOT(showCookieManager())); connect(ui->html5permissions, SIGNAL(clicked()), this, SLOT(showHtml5Permissions())); - connect(ui->sslManagerButton, SIGNAL(clicked()), this, SLOT(openSslManager())); connect(ui->preferredLanguages, SIGNAL(clicked()), this, SLOT(showAcceptLanguage())); connect(ui->deleteHtml5storage, SIGNAL(clicked()), this, SLOT(deleteHtml5storage())); connect(ui->uaManager, SIGNAL(clicked()), this, SLOT(openUserAgentManager())); @@ -626,16 +608,6 @@ void Preferences::deleteHtml5storage() ui->deleteHtml5storage->setEnabled(false); } -void Preferences::chooseExternalDownloadManager() -{ - QString path = QzTools::getOpenFileName("Preferences-ExternalDownloadManager", this, tr("Choose executable location..."), QDir::homePath()); - if (path.isEmpty()) { - return; - } - - ui->externalDownExecutable->setText(path); -} - void Preferences::openUserAgentManager() { UserAgentDialog* dialog = new UserAgentDialog(this); @@ -689,12 +661,6 @@ void Preferences::showHtml5Permissions() dialog->open(); } -void Preferences::openSslManager() -{ - SSLManager* m = new SSLManager(this); - m->open(); -} - void Preferences::openJsOptions() { JsOptions* dialog = new JsOptions(this); @@ -728,18 +694,6 @@ void Preferences::cacheValueChanged(int value) ui->MBlabel->setText(QString::number(value) + " MB"); } -void Preferences::pageCacheValueChanged(int value) -{ - ui->pageCacheLabel->setText(QString::number(value)); -} - -void Preferences::useExternalDownManagerChanged(bool state) -{ - ui->externalDownExecutable->setEnabled(state); - ui->externalDownArguments->setEnabled(state); - ui->chooseExternalDown->setEnabled(state); -} - void Preferences::useDifferentProxyForHttpsChanged(bool state) { ui->httpsProxyServer->setEnabled(state); @@ -940,10 +894,6 @@ void Preferences::saveSettings() settings.setValue("defaultDownloadPath", ui->downLoc->text()); } settings.setValue("CloseManagerOnFinish", ui->closeDownManOnFinish->isChecked()); - settings.setValue("useNativeDialog", ui->downlaodNativeSystemDialog->isChecked()); - settings.setValue("UseExternalManager", ui->useExternalDownManager->isChecked()); - settings.setValue("ExternalManagerExecutable", ui->externalDownExecutable->text()); - settings.setValue("ExternalManagerArguments", ui->externalDownArguments->text()); settings.endGroup(); //FONTS @@ -972,26 +922,20 @@ void Preferences::saveSettings() settings.beginGroup("Web-Browser-Settings"); settings.setValue("allowFlash", ui->allowPlugins->isChecked()); settings.setValue("allowJavaScript", ui->allowJavaScript->isChecked()); - settings.setValue("allowJava", ui->allowJava->isChecked()); - settings.setValue("DNS-Prefetch", ui->allowDNSPrefetch->isChecked()); settings.setValue("IncludeLinkInFocusChain", ui->linksInFocusChain->isChecked()); - settings.setValue("zoomTextOnly", ui->zoomTextOnly->isChecked()); settings.setValue("SpatialNavigation", ui->spatialNavigation->isChecked()); settings.setValue("AnimateScrolling", ui->animateScrolling->isChecked()); - settings.setValue("PrintElementBackground", ui->printEBackground->isChecked()); settings.setValue("wheelScrollLines", ui->wheelScroll->value()); settings.setValue("DoNotTrack", ui->doNotTrack->isChecked()); settings.setValue("CheckUpdates", ui->checkUpdates->isChecked()); settings.setValue("LoadTabsOnActivation", ui->dontLoadTabsUntilSelected->isChecked()); settings.setValue("DefaultZoomLevel", ui->defaultZoomLevel->currentIndex()); settings.setValue("XSSAuditing", ui->xssAuditing->isChecked()); - settings.setValue("enableFormsUndoRedo", ui->formsUndoRedo->isChecked()); settings.setValue("closeAppWithCtrlQ", ui->closeAppWithCtrlQ->isChecked()); #ifdef Q_OS_WIN settings.setValue("CheckDefaultBrowser", ui->checkDefaultBrowser->isChecked()); #endif //Cache - settings.setValue("maximumCachedPages", ui->pagesInCache->value()); settings.setValue("AllowLocalCache", ui->allowCache->isChecked()); settings.setValue("LocalCacheSize", ui->cacheMB->value()); settings.setValue("CachePath", ui->cachePath->text()); diff --git a/src/lib/preferences/preferences.h b/src/lib/preferences/preferences.h index dfc1c360f..e08b1d33a 100644 --- a/src/lib/preferences/preferences.h +++ b/src/lib/preferences/preferences.h @@ -57,11 +57,9 @@ private slots: void showHtml5Permissions(); void useActualHomepage(); void useActualNewTab(); - void openSslManager(); void showAcceptLanguage(); void chooseUserStyleClicked(); void deleteHtml5storage(); - void chooseExternalDownloadManager(); void openUserAgentManager(); void openJsOptions(); void openSearchEnginesManager(); @@ -73,7 +71,6 @@ private slots: void showPassManager(bool state); void setManualProxyConfigurationEnabled(bool state); void setProxyAutoConfigEnabled(bool state); - void useExternalDownManagerChanged(bool state); void useDifferentProxyForHttpsChanged(bool state); void showTabPreviewsChanged(bool state); void changeCachePathClicked(); @@ -82,7 +79,6 @@ private slots: void newTabChanged(int value); void afterLaunchChanged(int value); void cacheValueChanged(int value); - void pageCacheValueChanged(int value); void createProfile(); void deleteProfile(); diff --git a/src/lib/preferences/preferences.ui b/src/lib/preferences/preferences.ui index 8ed2b209a..108d7b362 100644 --- a/src/lib/preferences/preferences.ui +++ b/src/lib/preferences/preferences.ui @@ -1111,16 +1111,9 @@ - + - Allow JAVA - - - - - - - Allow DNS Prefetch + Include links in focus chain @@ -1131,20 +1124,6 @@ - - - - Print element background - - - - - - - Include links in focus chain - - - @@ -1159,23 +1138,6 @@ - - - - Zoom text only - - - - - - - If you disable this, it will still be accesible via standard Qt shortcuts - - - Enable Undo/Redo for editable forms - - - @@ -1264,41 +1226,7 @@ - - - - QFrame::NoFrame - - - QFrame::Raised - - - - 0 - - - 6 - - - 0 - - - 6 - - - - - 20 - - - Qt::Horizontal - - - - - - - + @@ -1318,7 +1246,7 @@ - + 20 @@ -1334,40 +1262,14 @@ - - - - - 0 - 0 - - - - - 20 - 0 - - - - 1 - - - - - - - Maximum pages in cache: - - - - + Allow storing network cache on disk - + Store cache in: @@ -1377,7 +1279,7 @@ - + @@ -2101,14 +2003,6 @@ - - - - Use native system file dialog -(may or may not cause problems with downloading SSL secured content) - - - @@ -2116,70 +2010,7 @@ - - - - <b>External download manager</b> - - - - - - - Use external download manager - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Executable: - - - - - - - Arguments: - - - - - - - Leave blank if unsure - - - - - - - - - - - - ... - - - - - - - - - <b>%d</b> will be replaced with URL to be downloaded - - - - - - + Qt::Vertical @@ -2258,7 +2089,7 @@ - + Send Referer header to servers @@ -2272,31 +2103,21 @@ - + Send Do Not Track header to servers - + <b>Other</b> - - - - Manage CA certificates - - - true - - - - + Qt::Vertical @@ -2310,46 +2131,6 @@ - - - - 0 - 0 - - - - Certificate Manager - - - - - - - <b>SSL Certificates</b> - - - - - - - true - - - <b>JavaScript</b> - - - - - - - false - - - Manage JavaScript privacy options - - - - @@ -2362,6 +2143,16 @@ + + + + true + + + <b>JavaScript</b> + + + @@ -2375,7 +2166,17 @@ - + + + + false + + + Manage JavaScript privacy options + + + + Qt::Horizontal @@ -2391,6 +2192,13 @@ + + + + Manage HTML5 permissions + + + @@ -2411,21 +2219,14 @@ - + <b>HTML5 Permissions</b> - - - - Manage HTML5 permissions - - - - + @@ -2857,7 +2658,6 @@ downLoc downButt closeDownManOnFinish - downlaodNativeSystemDialog allowPassManager useOSDNotifications useNativeSystemNotifications @@ -2878,7 +2678,6 @@ noProxy showStatusbar showNavigationToolbar - pagesInCache showHome showBookmarksToolbar