From e5559372144dac44b09fb03c02d17f4f5a49b7b2 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Thu, 29 Jun 2017 00:32:47 +0200 Subject: [PATCH] Make favicon Google fallback optional and off by default --- src/core/Config.cpp | 1 + src/gui/EditWidgetIcons.cpp | 3 ++- src/gui/SettingsWidget.cpp | 7 +++++++ src/gui/SettingsWidgetSecurity.ui | 16 ++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/core/Config.cpp b/src/core/Config.cpp index 5afbfcceb..8b266a845 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -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); diff --git a/src/gui/EditWidgetIcons.cpp b/src/gui/EditWidgetIcons.cpp index a68bda05e..42bc507dd 100644 --- a/src/gui/EditWidgetIcons.cpp +++ b/src/gui/EditWidgetIcons.cpp @@ -23,6 +23,7 @@ #include #include +#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)); diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index 185372beb..24d00b7d9 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -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()); diff --git a/src/gui/SettingsWidgetSecurity.ui b/src/gui/SettingsWidgetSecurity.ui index 679c470ad..4233fdbd1 100644 --- a/src/gui/SettingsWidgetSecurity.ui +++ b/src/gui/SettingsWidgetSecurity.ui @@ -139,6 +139,22 @@ + + + + Privacy + + + + + + Use Google as fallback for downloading website icons + + + + + +