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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> actionsToRemove = m_ui->menuEntryCopyAttribute->actions();
|
QList<QAction*> actions = m_ui->menuEntryCopyAttribute->actions();
|
||||||
actionsToRemove.removeOne(m_ui->actionEntryCopyTitle);
|
for (int i = EntryAttributes::DefaultAttributes.size() + 1; i < actions.size(); i++) {
|
||||||
actionsToRemove.removeOne(m_ui->actionEntryCopyUsername);
|
delete actions[i];
|
||||||
actionsToRemove.removeOne(m_ui->actionEntryCopyPassword);
|
|
||||||
actionsToRemove.removeOne(m_ui->actionEntryCopyURL);
|
|
||||||
actionsToRemove.removeOne(m_ui->actionEntryCopyNotes);
|
|
||||||
|
|
||||||
Q_FOREACH (QAction* action, actionsToRemove) {
|
|
||||||
delete action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry* entry = dbWidget->entryView()->currentEntry();
|
Entry* entry = dbWidget->entryView()->currentEntry();
|
||||||
|
|
||||||
m_ui->menuEntryCopyAttribute->addSeparator();
|
|
||||||
|
|
||||||
Q_FOREACH (const QString& key, entry->attributes()->customKeys()) {
|
Q_FOREACH (const QString& key, entry->attributes()->customKeys()) {
|
||||||
QAction* action = m_ui->menuEntryCopyAttribute->addAction(key);
|
QAction* action = m_ui->menuEntryCopyAttribute->addAction(key);
|
||||||
m_copyAdditionalAttributeActions->addAction(action);
|
m_copyAdditionalAttributeActions->addAction(action);
|
||||||
|
@ -119,6 +119,7 @@
|
|||||||
<addaction name="actionEntryCopyPassword"/>
|
<addaction name="actionEntryCopyPassword"/>
|
||||||
<addaction name="actionEntryCopyURL"/>
|
<addaction name="actionEntryCopyURL"/>
|
||||||
<addaction name="actionEntryCopyNotes"/>
|
<addaction name="actionEntryCopyNotes"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="actionEntryNew"/>
|
<addaction name="actionEntryNew"/>
|
||||||
<addaction name="actionEntryClone"/>
|
<addaction name="actionEntryClone"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user