Remove duplicate menu entries to copy username and password.

This commit is contained in:
Florian Geyer 2013-11-30 16:05:10 +01:00
parent af98c2636c
commit 34f12ac39c
4 changed files with 21 additions and 8 deletions

View file

@ -214,10 +214,19 @@ void MainWindow::updateCopyAttributesMenu()
return;
}
m_ui->menuEntryCopyAttribute->clear();
Q_FOREACH (QAction* action, m_ui->menuEntryCopyAttribute->actions()) {
if (action != m_ui->actionEntryCopyPassword && action != m_ui->actionEntryCopyUsername) {
m_ui->menuEntryCopyAttribute->removeAction(action);
}
}
Entry* entry = dbWidget->entryView()->currentEntry();
Q_FOREACH (const QString& key, EntryAttributes::DefaultAttributes) {
QStringList defaultAttributesWithoutPasswordAndUsername = EntryAttributes::DefaultAttributes;
defaultAttributesWithoutPasswordAndUsername.removeOne(EntryAttributes::PasswordKey);
defaultAttributesWithoutPasswordAndUsername.removeOne(EntryAttributes::UserNameKey);
Q_FOREACH (const QString& key, defaultAttributesWithoutPasswordAndUsername) {
QAction* action = m_ui->menuEntryCopyAttribute->addAction(key);
m_copyAdditionalAttributeActions->addAction(action);
}