aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletframe.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2017-10-12 07:22:48 +0000
committerJonas Schnelli <dev@jonasschnelli.ch>2018-03-26 18:40:26 +0700
commitb6d04fc7cc5de3370d2d8255f2b3e43f6bf9c80d (patch)
tree1ee0d7aeed7c411ad495a14b52f14ccb162ecc58 /src/qt/walletframe.cpp
parent12d8d2681e34a191f5d82f15448f8c4c9a14f6d0 (diff)
Qt: Get wallet name from WalletModel rather than passing it around
Diffstat (limited to 'src/qt/walletframe.cpp')
-rw-r--r--src/qt/walletframe.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
index c0b9d04269..5b13353d7b 100644
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -3,6 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <qt/walletframe.h>
+#include <qt/walletmodel.h>
#include <qt/bitcoingui.h>
#include <qt/walletview.h>
@@ -39,10 +40,16 @@ void WalletFrame::setClientModel(ClientModel *_clientModel)
this->clientModel = _clientModel;
}
-bool WalletFrame::addWallet(const QString& name, WalletModel *walletModel)
+bool WalletFrame::addWallet(WalletModel *walletModel)
{
- if (!gui || !clientModel || !walletModel || mapWalletViews.count(name) > 0)
+ if (!gui || !clientModel || !walletModel) {
return false;
+ }
+
+ const QString name = walletModel->getWalletName();
+ if (mapWalletViews.count(name) > 0) {
+ return false;
+ }
WalletView *walletView = new WalletView(platformStyle, this);
walletView->setBitcoinGUI(gui);