Fix inheriting browser group settings

This commit is contained in:
varjolintu authored and Jonathan White committed 2025-10-25 19:24:16 -04:00
1 parent 9dec5fa3ca
commit 9b36334cdc
3 files changed
+27 -8

No files matched your search

+19 -1
View File
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2025 KeePassXC Team <[email protected]>
* Copyright (C) 2010 Felix Geyer <[email protected]>
* Copyright (C) 2021 KeePassXC Team <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1128,6 +1128,24 @@ bool Group::resolveAutoTypeEnabled() const
}
}
bool Group::resolveBrowserOptionEnabled(const QString& option) const
{
switch (resolveCustomDataTriState(option, true)) {
case Inherit:
if (!m_parent) {
return false;
}
return m_parent->resolveBrowserOptionEnabled(option);
case Enable:
return true;
case Disable:
return false;
default:
Q_ASSERT(false);
return false;
}
}
Entry* Group::addEntryWithPath(const QString& entryPath)
{
if (entryPath.isEmpty() || findEntryByPath(entryPath)) {
+2 -1
View File
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2025 KeePassXC Team <[email protected]>
* Copyright (C) 2010 Felix Geyer <[email protected]>
* Copyright (C) 2021 KeePassXC Team <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -97,6 +97,7 @@ public:
Group::MergeMode mergeMode() const;
bool resolveSearchingEnabled() const;
bool resolveAutoTypeEnabled() const;
bool resolveBrowserOptionEnabled(const QString& option) const;
Entry* lastTopVisibleEntry() const;
bool isExpired() const;
bool isRecycled() const;
+6 -6
View File
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2025 KeePassXC Team <[email protected]>
* Copyright (C) 2011 Felix Geyer <[email protected]>
* Copyright (C) 2022 KeePassXC Team <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -202,11 +202,11 @@ void EditGroupWidget::loadGroup(Group* group, bool create, const QSharedPointer<
auto parent = group->parentGroup();
if (parent) {
inheritHideEntries = parent->resolveCustomDataTriState(BrowserService::OPTION_HIDE_ENTRY);
inheritSkipSubmit = parent->resolveCustomDataTriState(BrowserService::OPTION_SKIP_AUTO_SUBMIT);
inheritOnlyHttp = parent->resolveCustomDataTriState(BrowserService::OPTION_ONLY_HTTP_AUTH);
inheritNoHttp = parent->resolveCustomDataTriState(BrowserService::OPTION_NOT_HTTP_AUTH);
inheritOmitWww = parent->resolveCustomDataTriState(BrowserService::OPTION_OMIT_WWW);
inheritHideEntries = parent->resolveBrowserOptionEnabled(BrowserService::OPTION_HIDE_ENTRY);
inheritSkipSubmit = parent->resolveBrowserOptionEnabled(BrowserService::OPTION_SKIP_AUTO_SUBMIT);
inheritOnlyHttp = parent->resolveBrowserOptionEnabled(BrowserService::OPTION_ONLY_HTTP_AUTH);
inheritNoHttp = parent->resolveBrowserOptionEnabled(BrowserService::OPTION_NOT_HTTP_AUTH);
inheritOmitWww = parent->resolveBrowserOptionEnabled(BrowserService::OPTION_OMIT_WWW);
inheritRestrictKey = parent->resolveCustomDataString(BrowserService::OPTION_RESTRICT_KEY);
}