mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
SSH Agent: Reload settings when KeeAgent.settings attachment changed
Signed-off-by: Konrad Vité <kvite@paktolos.net>
This commit is contained in:
parent
76860ce57a
commit
6063508e7a
3 changed files with 20 additions and 1 deletions
|
|
@ -661,6 +661,12 @@ void EditEntryWidget::updateSSHAgentAttachments()
|
|||
setSSHAgentSettings();
|
||||
}
|
||||
|
||||
if (KeeAgentSettings::inEntryAttachments(m_attachments.data())) {
|
||||
m_sshAgentSettings.reset();
|
||||
m_sshAgentSettings.fromEntryAttachments(m_attachments.data());
|
||||
setSSHAgentSettings();
|
||||
}
|
||||
|
||||
m_sshAgentUi->attachmentComboBox->clear();
|
||||
m_sshAgentUi->attachmentComboBox->addItem("");
|
||||
|
||||
|
|
|
|||
|
|
@ -533,7 +533,19 @@ bool KeeAgentSettings::inEntryAttachments(const EntryAttachments* attachments)
|
|||
*/
|
||||
bool KeeAgentSettings::fromEntry(const Entry* entry)
|
||||
{
|
||||
const auto attachments = entry->attachments();
|
||||
return KeeAgentSettings::fromEntryAttachments(entry->attachments());
|
||||
}
|
||||
|
||||
/**
|
||||
* Read settings from entry attachments as an XML attachment.
|
||||
*
|
||||
* Sets error string on error.
|
||||
*
|
||||
* @param entry EntryAttachments to read the attachment from
|
||||
* @return true if XML document was loaded
|
||||
*/
|
||||
bool KeeAgentSettings::fromEntryAttachments(const EntryAttachments* attachments)
|
||||
{
|
||||
if (attachments->hasKey("KeeAgent.settings")) {
|
||||
return fromXml(attachments->value("KeeAgent.settings"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ public:
|
|||
|
||||
static bool inEntryAttachments(const EntryAttachments* attachments);
|
||||
bool fromEntry(const Entry* entry);
|
||||
bool fromEntryAttachments(const EntryAttachments* attachments);
|
||||
void toEntry(Entry* entry) const;
|
||||
bool keyConfigured() const;
|
||||
bool toOpenSSHKey(const Entry* entry, OpenSSHKey& key, bool decrypt);
|
||||
|
|
|
|||
Loading…
Reference in a new issue