Skip to content

Commit

Permalink
attributes: unbreak copy-to-clipboard on KDE
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tycho authored and phoerious committed Mar 6, 2018
1 parent 4c9dcf5 commit 386b78b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/DatabaseWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 386b78b

Please sign in to comment.