aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-09-08 00:24:47 -0400
committerAndrew Chow <achow101-github@achow101.com>2019-09-08 16:40:53 -0400
commitad52f054f67374dc46e0096d1e2f593d6372a2df (patch)
treeb13e7e5a136b828d3e050bd7518ef91bfba08ba0 /src
parent2c530ea2ada71ca23fa17bab5023b855515463ef (diff)
Escape ampersands (&) in wallet names in Open Wallet menu
Diffstat (limited to 'src')
-rw-r--r--src/qt/bitcoingui.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index c4960b38d7..a1e42bb56f 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -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) {