mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-03 12:06:25 -04:00
Auto-Type: Resolve username/password when copying to clipboard
* Fix #3882 * Add nullptr checks as well
This commit is contained in:
parent
3c2abaaa82
commit
17326dc3ec
1 changed files with 15 additions and 6 deletions
|
@ -281,16 +281,25 @@ void AutoTypeSelectDialog::buildActionMenu()
|
|||
});
|
||||
|
||||
connect(copyUsernameAction, &QAction::triggered, this, [&] {
|
||||
clipboard()->setText(m_ui->view->currentMatch().first->username());
|
||||
reject();
|
||||
auto entry = m_ui->view->currentMatch().first;
|
||||
if (entry) {
|
||||
clipboard()->setText(entry->resolvePlaceholder(entry->username()));
|
||||
reject();
|
||||
}
|
||||
});
|
||||
connect(copyPasswordAction, &QAction::triggered, this, [&] {
|
||||
clipboard()->setText(m_ui->view->currentMatch().first->password());
|
||||
reject();
|
||||
auto entry = m_ui->view->currentMatch().first;
|
||||
if (entry) {
|
||||
clipboard()->setText(entry->resolvePlaceholder(entry->password()));
|
||||
reject();
|
||||
}
|
||||
});
|
||||
connect(copyTotpAction, &QAction::triggered, this, [&] {
|
||||
clipboard()->setText(m_ui->view->currentMatch().first->totp());
|
||||
reject();
|
||||
auto entry = m_ui->view->currentMatch().first;
|
||||
if (entry) {
|
||||
clipboard()->setText(entry->totp());
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue