mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-20 18:56:07 -05:00
Optimize deletion of copy to clipboard actions.
This commit is contained in:
parent
a3b95c1c38
commit
fc3cc12038
2 changed files with 4 additions and 11 deletions
|
|
@ -221,21 +221,13 @@ void MainWindow::updateCopyAttributesMenu()
|
|||
return;
|
||||
}
|
||||
|
||||
QList<QAction*> actionsToRemove = m_ui->menuEntryCopyAttribute->actions();
|
||||
actionsToRemove.removeOne(m_ui->actionEntryCopyTitle);
|
||||
actionsToRemove.removeOne(m_ui->actionEntryCopyUsername);
|
||||
actionsToRemove.removeOne(m_ui->actionEntryCopyPassword);
|
||||
actionsToRemove.removeOne(m_ui->actionEntryCopyURL);
|
||||
actionsToRemove.removeOne(m_ui->actionEntryCopyNotes);
|
||||
|
||||
Q_FOREACH (QAction* action, actionsToRemove) {
|
||||
delete action;
|
||||
QList<QAction*> actions = m_ui->menuEntryCopyAttribute->actions();
|
||||
for (int i = EntryAttributes::DefaultAttributes.size() + 1; i < actions.size(); i++) {
|
||||
delete actions[i];
|
||||
}
|
||||
|
||||
Entry* entry = dbWidget->entryView()->currentEntry();
|
||||
|
||||
m_ui->menuEntryCopyAttribute->addSeparator();
|
||||
|
||||
Q_FOREACH (const QString& key, entry->attributes()->customKeys()) {
|
||||
QAction* action = m_ui->menuEntryCopyAttribute->addAction(key);
|
||||
m_copyAdditionalAttributeActions->addAction(action);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue