diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index a43009d954253..1f78550a55904 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -399,10 +399,9 @@ void BitcoinGUI::createActions() for (const std::pair& i : m_wallet_controller->listWalletDir()) { const std::string& path = i.first; QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path); - // Menu items remove single &. Single & are shown when && is in - // the string, but only the first occurrence. So replace only - // the first & with &&. - name.replace(name.indexOf(QChar('&')), 1, QString("&&")); + // An single ampersand in the menu item's text sets a shortcut for this item. + // Single & are shown when && is in the string. So replace & with &&. + name.replace(QChar('&'), QString("&&")); QAction* action = m_open_wallet_menu->addAction(name); if (i.second) {