Skip to content

Commit

Permalink
Merge branch 'keepassxreboot:develop' into devbleo3
Browse files Browse the repository at this point in the history
  • Loading branch information
blessio authored Dec 25, 2024
2 parents c12bd4e + af0c164 commit b463c35
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
24 changes: 15 additions & 9 deletions src/autotype/AutoTypeSelectDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,7 @@ void AutoTypeSelectDialog::buildActionMenu()
});
#endif

// Qt 5.10 introduced a new "feature" to hide shortcuts in context menus
// Unfortunately, Qt::AA_DontShowShortcutsInContextMenus is broken, have to manually enable them
typeUsernameAction->setShortcutVisibleInContextMenu(true);
typePasswordAction->setShortcutVisibleInContextMenu(true);
typeTotpAction->setShortcutVisibleInContextMenu(true);
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
typeVirtualAction->setShortcutVisibleInContextMenu(true);
#endif

copyUsernameAction->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_1);
copyUsernameAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::USERNAME);
connect(copyUsernameAction, &QAction::triggered, this, [&] {
auto entry = m_ui->view->currentMatch().first;
Expand All @@ -348,6 +340,7 @@ void AutoTypeSelectDialog::buildActionMenu()
}
});

copyPasswordAction->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_2);
copyPasswordAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::PASSWORD);
connect(copyPasswordAction, &QAction::triggered, this, [&] {
auto entry = m_ui->view->currentMatch().first;
Expand All @@ -357,6 +350,7 @@ void AutoTypeSelectDialog::buildActionMenu()
}
});

copyTotpAction->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_3);
copyTotpAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::TOTP);
connect(copyTotpAction, &QAction::triggered, this, [&] {
auto entry = m_ui->view->currentMatch().first;
Expand All @@ -365,6 +359,18 @@ void AutoTypeSelectDialog::buildActionMenu()
reject();
}
});

// Qt 5.10 introduced a new "feature" to hide shortcuts in context menus
// Unfortunately, Qt::AA_DontShowShortcutsInContextMenus is broken, have to manually enable them
typeUsernameAction->setShortcutVisibleInContextMenu(true);
typePasswordAction->setShortcutVisibleInContextMenu(true);
typeTotpAction->setShortcutVisibleInContextMenu(true);
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
typeVirtualAction->setShortcutVisibleInContextMenu(true);
#endif
copyUsernameAction->setShortcutVisibleInContextMenu(true);
copyPasswordAction->setShortcutVisibleInContextMenu(true);
copyTotpAction->setShortcutVisibleInContextMenu(true);
}

void AutoTypeSelectDialog::showEvent(QShowEvent* event)
Expand Down
2 changes: 2 additions & 0 deletions src/gui/Clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ void Clipboard::setText(const QString& text, bool clear)
mime->setData("x-kde-passwordManagerHint", QByteArrayLiteral("secret"));
#elif defined(Q_OS_WIN)
mime->setData("ExcludeClipboardContentFromMonitorProcessing", QByteArrayLiteral("1"));
mime->setData("CanIncludeInClipboardHistory", {4, '\0'});
mime->setData("CanUploadToCloudClipboard ", {4, '\0'});
#endif

if (clipboard->supportsSelection()) {
Expand Down
6 changes: 3 additions & 3 deletions src/gui/EntryPreviewWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void EntryPreviewWidget::updateEntryHeaderLine()
{
Q_ASSERT(m_currentEntry);
const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title());
m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title));
m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title.toHtmlEscaped()));
m_ui->entryIcon->setPixmap(Icons::entryIconPixmap(m_currentEntry, IconSize::Large));
}

Expand Down Expand Up @@ -305,7 +305,7 @@ void EntryPreviewWidget::setPasswordVisible(bool state)
m_ui->entryPasswordLabel->setText(html);
} else {
// No color
m_ui->entryPasswordLabel->setText(password);
m_ui->entryPasswordLabel->setText(password.toHtmlEscaped());
}
} else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) {
m_ui->entryPasswordLabel->setText("");
Expand Down Expand Up @@ -387,7 +387,7 @@ void EntryPreviewWidget::updateEntryGeneralTab()
m_ui->entryNotesTextEdit->setFont(Font::defaultFont());
}

m_ui->entryUrlLabel->setRawText(m_currentEntry->displayUrl());
m_ui->entryUrlLabel->setRawText(m_currentEntry->displayUrl().toHtmlEscaped());
const QString url = m_currentEntry->url();
if (!url.isEmpty()) {
// URL is well formed and can be opened in a browser
Expand Down

0 comments on commit b463c35

Please sign in to comment.