attributes: unbreak copy-to-clipboard on KDE

The 'text' property of the QAction gets mangled by KDE when it adds its
own accelerator shortcuts. But the data property is ours. Use that for
keying instead.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
This commit is contained in:
Steven Noonan 2018-03-05 08:57:01 -08:00 committed by Janek Bevendorff
parent 4c9dcf5c98
commit 386b78b896
2 changed files with 2 additions and 1 deletions

View File

@ -598,7 +598,7 @@ void DatabaseWidget::copyAttribute(QAction* action)
return;
}
setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->text())));
setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->data().toString())));
}
void DatabaseWidget::setClipboardTextAndMinimize(const QString& text)

View File

@ -499,6 +499,7 @@ void MainWindow::updateCopyAttributesMenu()
const QStringList customEntryAttributes = dbWidget->customEntryAttributes();
for (const QString& key : customEntryAttributes) {
QAction* action = m_ui->menuEntryCopyAttribute->addAction(key);
action->setData(QVariant(key));
m_copyAdditionalAttributeActions->addAction(action);
}
}