From 386b78b896c948f74de1ff30752dacfd568a7008 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Mon, 5 Mar 2018 08:57:01 -0800 Subject: [PATCH] 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 --- src/gui/DatabaseWidget.cpp | 2 +- src/gui/MainWindow.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index e4ee21a3c..0573a0189 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -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) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index ba69c0173..1822c48d4 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -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); } }