1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Preferences: Remove not working options

Also fix disabling local cache
This commit is contained in:
David Rosca 2015-09-29 10:55:24 +02:00
parent 5ba8f4dbb6
commit 16b28a3a90
4 changed files with 46 additions and 305 deletions

View File

@ -899,7 +899,6 @@ void MainApplication::loadSettings()
settings.endGroup();
QWebEngineProfile* profile = QWebEngineProfile::defaultProfile();
profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache);
profile->setPersistentCookiesPolicy(QWebEngineProfile::AllowPersistentCookies);
profile->setPersistentStoragePath(DataPaths::currentProfilePath());
@ -909,6 +908,9 @@ void MainApplication::loadSettings()
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);

View File

@ -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());

View File

@ -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();

View File

@ -1111,16 +1111,9 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="allowJava">
<widget class="QCheckBox" name="linksInFocusChain">
<property name="text">
<string>Allow JAVA</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="allowDNSPrefetch">
<property name="text">
<string>Allow DNS Prefetch</string>
<string>Include links in focus chain</string>
</property>
</widget>
</item>
@ -1131,20 +1124,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="printEBackground">
<property name="text">
<string extracomment="when you are printing page (on printer), it determine whether to also print background (color, image) of html elements">Print element background</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="linksInFocusChain">
<property name="text">
<string extracomment="focus also links on page (basically &lt;a&gt; elements) when pressing Tab key">Include links in focus chain</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="animateScrolling">
<property name="text">
@ -1159,23 +1138,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="zoomTextOnly">
<property name="text">
<string>Zoom text only</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="formsUndoRedo">
<property name="toolTip">
<string>If you disable this, it will still be accesible via standard Qt shortcuts</string>
</property>
<property name="text">
<string>Enable Undo/Redo for editable forms</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
@ -1264,41 +1226,7 @@
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="3">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QSlider" name="pagesInCache">
<property name="maximum">
<number>20</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QFrame" name="cacheFrame">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
@ -1318,7 +1246,7 @@
</layout>
</widget>
</item>
<item row="2" column="3">
<item row="1" column="2">
<widget class="QSlider" name="cacheMB">
<property name="minimum">
<number>20</number>
@ -1334,40 +1262,14 @@
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="pageCacheLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Maximum pages in cache: </string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="4">
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="allowCache">
<property name="text">
<string>Allow storing network cache on disk</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<widget class="QLabel" name="storeCacheLabel">
<property name="text">
<string>Store cache in:</string>
@ -1377,7 +1279,7 @@
</property>
</widget>
</item>
<item row="3" column="3">
<item row="2" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<widget class="QLineEdit" name="cachePath"/>
@ -2101,14 +2003,6 @@
</property>
</widget>
</item>
<item row="8" column="1" colspan="3">
<widget class="QCheckBox" name="downlaodNativeSystemDialog">
<property name="text">
<string>Use native system file dialog
(may or may not cause problems with downloading SSL secured content)</string>
</property>
</widget>
</item>
<item row="7" column="1" colspan="3">
<widget class="QCheckBox" name="closeDownManOnFinish">
<property name="text">
@ -2116,70 +2010,7 @@
</property>
</widget>
</item>
<item row="10" column="0" colspan="4">
<widget class="QLabel" name="label_51">
<property name="text">
<string>&lt;b&gt;External download manager&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="4">
<widget class="QCheckBox" name="useExternalDownManager">
<property name="text">
<string>Use external download manager</string>
</property>
</widget>
</item>
<item row="13" column="1" colspan="3">
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_52">
<property name="text">
<string>Executable:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_53">
<property name="text">
<string>Arguments:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="externalDownArguments">
<property name="placeholderText">
<string>Leave blank if unsure</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLineEdit" name="externalDownExecutable"/>
</item>
<item>
<widget class="MacToolButton" name="chooseExternalDown">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_64">
<property name="text">
<string>&lt;b&gt;%d&lt;/b&gt; will be replaced with URL to be downloaded</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="0" colspan="4">
<item row="8" column="0" colspan="4">
<spacer name="verticalSpacer_10">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -2258,7 +2089,7 @@
</widget>
<widget class="QWidget" name="privacyPage">
<layout class="QGridLayout" name="gridLayout_12">
<item row="24" column="1" colspan="3">
<item row="22" column="1" colspan="3">
<widget class="QCheckBox" name="sendReferer">
<property name="text">
<string>Send Referer header to servers</string>
@ -2272,31 +2103,21 @@
</property>
</widget>
</item>
<item row="25" column="1" colspan="3">
<item row="23" column="1" colspan="3">
<widget class="QCheckBox" name="doNotTrack">
<property name="text">
<string>Send Do Not Track header to servers</string>
</property>
</widget>
</item>
<item row="22" column="0" colspan="4">
<item row="20" column="0" colspan="4">
<widget class="QLabel" name="label_50">
<property name="text">
<string>&lt;b&gt;Other&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="16" column="0" colspan="3">
<widget class="QLabel" name="label_49">
<property name="text">
<string>Manage CA certificates</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="30" column="0" colspan="4">
<item row="28" column="0" colspan="4">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -2310,46 +2131,6 @@
</spacer>
</item>
<item row="16" column="3">
<widget class="QPushButton" name="sslManagerButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Certificate Manager</string>
</property>
</widget>
</item>
<item row="14" column="0" colspan="4">
<widget class="QLabel" name="label_48">
<property name="text">
<string>&lt;b&gt;SSL Certificates&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="17" column="0" colspan="4">
<widget class="QLabel" name="label_61">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="text">
<string>&lt;b&gt;JavaScript&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="18" column="0" colspan="3">
<widget class="QLabel" name="label_25">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="text">
<string>Manage JavaScript privacy options</string>
</property>
</widget>
</item>
<item row="18" column="3">
<widget class="QPushButton" name="jsOptionsButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -2362,6 +2143,16 @@
</property>
</widget>
</item>
<item row="15" column="0" colspan="4">
<widget class="QLabel" name="label_61">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="text">
<string>&lt;b&gt;JavaScript&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="12" column="3">
<widget class="QPushButton" name="cookieManagerBut">
<property name="sizePolicy">
@ -2375,7 +2166,17 @@
</property>
</widget>
</item>
<item row="24" column="0">
<item row="16" column="0" colspan="3">
<widget class="QLabel" name="label_25">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="text">
<string>Manage JavaScript privacy options</string>
</property>
</widget>
</item>
<item row="22" column="0">
<spacer name="horizontalSpacer_20">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -2391,6 +2192,13 @@
</property>
</spacer>
</item>
<item row="19" column="0" colspan="3">
<widget class="QLabel" name="label_63">
<property name="text">
<string>Manage HTML5 permissions</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="3">
<widget class="QLabel" name="label_19">
<property name="text">
@ -2411,21 +2219,14 @@
</property>
</spacer>
</item>
<item row="20" column="0" colspan="4">
<item row="18" column="0" colspan="4">
<widget class="QLabel" name="label_62">
<property name="text">
<string>&lt;b&gt;HTML5 Permissions&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="21" column="0" colspan="3">
<widget class="QLabel" name="label_63">
<property name="text">
<string>Manage HTML5 permissions</string>
</property>
</widget>
</item>
<item row="21" column="3">
<item row="19" column="3">
<widget class="QPushButton" name="html5permissions">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -2857,7 +2658,6 @@
<tabstop>downLoc</tabstop>
<tabstop>downButt</tabstop>
<tabstop>closeDownManOnFinish</tabstop>
<tabstop>downlaodNativeSystemDialog</tabstop>
<tabstop>allowPassManager</tabstop>
<tabstop>useOSDNotifications</tabstop>
<tabstop>useNativeSystemNotifications</tabstop>
@ -2878,7 +2678,6 @@
<tabstop>noProxy</tabstop>
<tabstop>showStatusbar</tabstop>
<tabstop>showNavigationToolbar</tabstop>
<tabstop>pagesInCache</tabstop>
<tabstop>showHome</tabstop>
<tabstop>showBookmarksToolbar</tabstop>
</tabstops>