mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Optimize deletion of copy to clipboard actions.
This commit is contained in:
parent
a3b95c1c38
commit
fc3cc12038
@ -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);
|
||||
|
@ -119,6 +119,7 @@
|
||||
<addaction name="actionEntryCopyPassword"/>
|
||||
<addaction name="actionEntryCopyURL"/>
|
||||
<addaction name="actionEntryCopyNotes"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<addaction name="actionEntryNew"/>
|
||||
<addaction name="actionEntryClone"/>
|
||||
|
Loading…
Reference in New Issue
Block a user