Escape ampersands (&) in wallet names in Open Wallet menu

This commit is contained in:
Andrew Chow committed 2019-09-08 16:40:53 -04:00
1 parent 2c530ea2ad
commit ad52f054f6
1 file changed
+2
+2
View File
@@ -375,6 +375,8 @@ void BitcoinGUI::createActions()
for (const std::pair<const std::string, bool>& 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("&&"));
QAction* action = m_open_wallet_menu->addAction(name);
if (i.second) {