mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
gui: Sort wallets in open wallet menu
This commit is contained in:
parent
b5fa2319d8
commit
224eb9534a
3 changed files with 16 additions and 11 deletions
|
|
@ -46,13 +46,16 @@ std::vector<WalletModel*> WalletController::getWallets() const
|
|||
return m_wallets;
|
||||
}
|
||||
|
||||
std::vector<std::string> WalletController::getWalletsAvailableToOpen() const
|
||||
std::map<std::string, bool> WalletController::listWalletDir() const
|
||||
{
|
||||
QMutexLocker locker(&m_mutex);
|
||||
std::vector<std::string> wallets = m_node.listWalletDir();
|
||||
std::map<std::string, bool> wallets;
|
||||
for (const std::string& name : m_node.listWalletDir()) {
|
||||
wallets[name] = false;
|
||||
}
|
||||
for (WalletModel* wallet_model : m_wallets) {
|
||||
auto it = std::remove(wallets.begin(), wallets.end(), wallet_model->wallet().getWalletName());
|
||||
if (it != wallets.end()) wallets.erase(it);
|
||||
auto it = wallets.find(wallet_model->wallet().getWalletName());
|
||||
if (it != wallets.end()) it->second = true;
|
||||
}
|
||||
return wallets;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue