Permalink
Browse files

Support persistent data storage (HTML5 localStorage)

  • Loading branch information...
1 parent d8e83f6 commit 904cff6b6d19a401fa2d5194538302f8d7bf716c Bernhard Rosenkraenzer committed May 10, 2011
Showing with 14 additions and 0 deletions.
  1. +1 −0 src/browserapplication.cpp
  2. +3 −0 src/settings.cpp
  3. +10 −0 src/settings.ui
@@ -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);
View
@@ -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));
View
@@ -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>

0 comments on commit 904cff6

Please sign in to comment.