summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin C Meyer <ben@meyerhome.net>2011-05-16 01:47:28 (GMT)
committerBenjamin C Meyer <ben@meyerhome.net>2011-05-16 01:47:28 (GMT)
commit5c3c14104d95d9bf2c8ea5ac64190038264f9757 (patch)
tree7507a60b00874f6b7a6b39d058773d2094087f7c
parentd8e83f65ee738a56ffc0703f065e8c74f08697e7 (diff)
parent904cff6b6d19a401fa2d5194538302f8d7bf716c (diff)
Merge pull request #3 from berolinux/localStorage
Support persistent data storage (HTML5 localStorage)
-rw-r--r--src/browserapplication.cpp1
-rw-r--r--src/settings.cpp3
-rw-r--r--src/settings.ui10
3 files changed, 14 insertions, 0 deletions
diff --git a/src/browserapplication.cpp b/src/browserapplication.cpp
index c7c0d4b..4514a80 100644
--- a/src/browserapplication.cpp
+++ b/src/browserapplication.cpp
@@ -374,6 +374,7 @@ void BrowserApplication::loadSettings()
defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, settings.value(QLatin1String("enableJavascript"), true).toBool());
defaultSettings->setAttribute(QWebSettings::PluginsEnabled, settings.value(QLatin1String("enablePlugins"), true).toBool());
defaultSettings->setAttribute(QWebSettings::AutoLoadImages, settings.value(QLatin1String("enableImages"), true).toBool());
+ defaultSettings->setAttribute(QWebSettings::LocalStorageEnabled, settings.value(QLatin1String("enableLocalStorage"), true).toBool());
defaultSettings->setAttribute(QWebSettings::DeveloperExtrasEnabled, settings.value(QLatin1String("enableInspector"), false).toBool());
#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
defaultSettings->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
diff --git a/src/settings.cpp b/src/settings.cpp
index c21cd09..3cbe7e8 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -129,6 +129,7 @@ void SettingsDialog::loadDefaults()
enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled));
enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled));
enableImages->setChecked(defaultSettings->testAttribute(QWebSettings::AutoLoadImages));
+ enableLocalStorage->setChecked(defaultSettings->testAttribute(QWebSettings::LocalStorageEnabled));
clickToFlash->setChecked(false);
cookieSessionCombo->setCurrentIndex(0);
filterTrackingCookiesCheckbox->setChecked(false);
@@ -194,6 +195,7 @@ void SettingsDialog::loadFromSettings()
enableJavascript->setChecked(settings.value(QLatin1String("enableJavascript"), enableJavascript->isChecked()).toBool());
enablePlugins->setChecked(settings.value(QLatin1String("enablePlugins"), enablePlugins->isChecked()).toBool());
enableImages->setChecked(settings.value(QLatin1String("enableImages"), enableImages->isChecked()).toBool());
+ enableLocalStorage->setChecked(settings.value(QLatin1String("enableLocalStorage"), enableLocalStorage->isChecked()).toBool());
userStyleSheet->setText(QString::fromUtf8(settings.value(QLatin1String("userStyleSheet")).toUrl().toEncoded()));
clickToFlash->setChecked(settings.value(QLatin1String("enableClickToFlash"), clickToFlash->isChecked()).toBool());
int minimumFontSize = settings.value(QLatin1String("minimumFontSize"), 0).toInt();
@@ -339,6 +341,7 @@ void SettingsDialog::saveToSettings()
settings.setValue(QLatin1String("enableJavascript"), enableJavascript->isChecked());
settings.setValue(QLatin1String("enablePlugins"), enablePlugins->isChecked());
settings.setValue(QLatin1String("enableImages"), enableImages->isChecked());
+ settings.setValue(QLatin1String("enableLocalStorage"), enableLocalStorage->isChecked());
QString userStyleSheetString = userStyleSheet->text();
if (QFile::exists(userStyleSheetString))
settings.setValue(QLatin1String("userStyleSheet"), QUrl::fromLocalFile(userStyleSheetString));
diff --git a/src/settings.ui b/src/settings.ui
index 7d4f66e..43275b5 100644
--- a/src/settings.ui
+++ b/src/settings.ui
@@ -452,6 +452,16 @@
</property>
</widget>
</item>
+ <item row="5" column="0" colspan="2">
+ <widget class="QCheckBox" name="enableLocalStorage">
+ <property name="text">
+ <string>Persistent Data Storage</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>