Commit fa3fe3e6 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Do not change read-only tooltip settings when loading defaults

Use the generated setters to set the settings to their defaults
because the setters actually do nothing, if settings are read-only.

GnuPG-bug-id: 5791
parent 8c455efc
......@@ -420,14 +420,21 @@ void AppearanceConfigWidget::Private::slotDefaultClicked()
void AppearanceConfigWidget::defaults()
{
// This simply means "default look for every category"
for (int i = 0, end = d->categoriesLV->count(); i != end; ++i) {
set_default_appearance(d->categoriesLV->item(i));
}
d->tooltipValidityCheckBox->setChecked(true);
d->tooltipOwnerCheckBox->setChecked(false);
d->tooltipDetailsCheckBox->setChecked(false);
// use a temporary TooltipPreferences instance for resetting the values to the defaults;
// the setters respect the immutability of the individual settings, so that we don't have
// to check this explicitly
TooltipPreferences tooltipPrefs;
tooltipPrefs.setShowValidity(tooltipPrefs.findItem(QStringLiteral("ShowValidity"))->getDefault().toBool());
d->tooltipValidityCheckBox->setChecked(tooltipPrefs.showValidity());
tooltipPrefs.setShowOwnerInformation(tooltipPrefs.findItem(QStringLiteral("ShowOwnerInformation"))->getDefault().toBool());
d->tooltipOwnerCheckBox->setChecked(tooltipPrefs.showOwnerInformation());
tooltipPrefs.setShowCertificateDetails(tooltipPrefs.findItem(QStringLiteral("ShowCertificateDetails"))->getDefault().toBool());
d->tooltipDetailsCheckBox->setChecked(tooltipPrefs.showCertificateDetails());
if (d->dnOrderWidget) {
const Settings settings;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment