Merge pull request #708 from keepassxreboot/feature/make-google-fallback-optional

Make favicon Google fallback optional and off by default
This commit is contained in:
Janek Bevendorff 2017-06-29 00:50:21 +02:00 committed by GitHub
commit 31ec840a8d
4 changed files with 26 additions and 1 deletions

View File

@ -129,6 +129,7 @@ void Config::init(const QString& fileName)
m_defaults.insert("security/passwordsrepeat", false);
m_defaults.insert("security/passwordscleartext", false);
m_defaults.insert("security/autotypeask", true);
m_defaults.insert("security/IconDownloadFallbackToGoogle", false);
m_defaults.insert("GUI/Language", "system");
m_defaults.insert("GUI/ShowTrayIcon", false);
m_defaults.insert("GUI/MinimizeToTray", false);

View File

@ -23,6 +23,7 @@
#include <QMessageBox>
#include <QFileDialog>
#include "core/Config.h"
#include "core/Group.h"
#include "core/Metadata.h"
#include "core/Tools.h"
@ -231,7 +232,7 @@ void EditWidgetIcons::fetchFavicon(const QUrl& url)
void EditWidgetIcons::fetchFaviconFromGoogle(const QString& domain)
{
if (m_fallbackToGoogle) {
if (config()->get("security/IconDownloadFallbackToGoogle", false).toBool() && m_fallbackToGoogle) {
resetFaviconDownload();
m_fallbackToGoogle = false;
fetchFavicon(QUrl("http://www.google.com/s2/favicons?domain=" + domain));

View File

@ -20,6 +20,7 @@
#include "ui_SettingsWidgetGeneral.h"
#include "ui_SettingsWidgetSecurity.h"
#include "config-keepassx.h"
#include "autotype/AutoType.h"
#include "core/Config.h"
#include "core/Translator.h"
@ -80,6 +81,10 @@ SettingsWidget::SettingsWidget(QWidget* parent)
m_secUi->clearClipboardSpinBox, SLOT(setEnabled(bool)));
connect(m_secUi->lockDatabaseIdleCheckBox, SIGNAL(toggled(bool)),
m_secUi->lockDatabaseIdleSpinBox, SLOT(setEnabled(bool)));
#ifndef WITH_XC_HTTP
m_secUi->privacy->setVisible(false);
#endif
}
SettingsWidget::~SettingsWidget()
@ -146,6 +151,7 @@ void SettingsWidget::loadSettings()
m_secUi->lockDatabaseIdleSpinBox->setValue(config()->get("security/lockdatabaseidlesec").toInt());
m_secUi->lockDatabaseMinimizeCheckBox->setChecked(config()->get("security/lockdatabaseminimize").toBool());
m_secUi->lockDatabaseOnScreenLockCheckBox->setChecked(config()->get("security/lockdatabasescreenlock").toBool());
m_secUi->lockDatabaseOnScreenLockCheckBox->setChecked(config()->get("security/IconDownloadFallbackToGoogle").toBool());
m_secUi->passwordCleartextCheckBox->setChecked(config()->get("security/passwordscleartext").toBool());
m_secUi->passwordRepeatCheckBox->setChecked(config()->get("security/passwordsrepeat").toBool());
@ -207,6 +213,7 @@ void SettingsWidget::saveSettings()
config()->set("security/lockdatabaseidlesec", m_secUi->lockDatabaseIdleSpinBox->value());
config()->set("security/lockdatabaseminimize", m_secUi->lockDatabaseMinimizeCheckBox->isChecked());
config()->set("security/lockdatabasescreenlock", m_secUi->lockDatabaseOnScreenLockCheckBox->isChecked());
config()->set("security/IconDownloadFallbackToGoogle", m_secUi->fallbackToGoogle->isChecked());
config()->set("security/passwordscleartext", m_secUi->passwordCleartextCheckBox->isChecked());
config()->set("security/passwordsrepeat", m_secUi->passwordRepeatCheckBox->isChecked());

View File

@ -139,6 +139,22 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="privacy">
<property name="title">
<string>Privacy</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="fallbackToGoogle">
<property name="text">
<string>Use Google as fallback for downloading website icons</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">