Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resolving advanced values in entry preview #11291

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/gui/EntryPreviewWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ void EntryPreviewWidget::setPasswordVisible(bool state)

void EntryPreviewWidget::setEntryNotesVisible(bool state)
{
setNotesVisible(m_ui->entryNotesTextEdit, m_currentEntry->notes(), state);
setNotesVisible(
m_ui->entryNotesTextEdit, m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->notes()), state);
m_ui->toggleEntryNotesButton->setIcon(icons()->onOffIcon("password-show", state));
}

Expand Down Expand Up @@ -427,6 +428,8 @@ void EntryPreviewWidget::updateEntryAdvancedTab()
m_ui->entryAttributesTable->item(i, 0)->setFont(font);
m_ui->entryAttributesTable->item(i, 0)->setTextAlignment(Qt::AlignTop | Qt::AlignLeft);

auto value = m_currentEntry->resolveMultiplePlaceholders(attributes->value(key));

if (attributes->isProtected(key)) {
// only show the reveal button on protected attributes
auto button = new QToolButton();
Expand All @@ -453,10 +456,10 @@ void EntryPreviewWidget::updateEntryAdvancedTab()
m_ui->entryAttributesTable->setCellWidget(i, 1, button);
m_ui->entryAttributesTable->setItem(i, 2, new QTableWidgetItem(QString("\u25cf").repeated(6)));
} else {
m_ui->entryAttributesTable->setItem(i, 2, new QTableWidgetItem(attributes->value(key)));
m_ui->entryAttributesTable->setItem(i, 2, new QTableWidgetItem(value));
}

m_ui->entryAttributesTable->item(i, 2)->setData(Qt::UserRole, attributes->value(key));
m_ui->entryAttributesTable->item(i, 2)->setData(Qt::UserRole, value);
m_ui->entryAttributesTable->item(i, 2)->setToolTip(tr("Double click to copy value"));
m_ui->entryAttributesTable->item(i, 2)->setTextAlignment(Qt::AlignTop | Qt::AlignLeft);

Expand Down