Skip to content
Snippets Groups Projects
Commit bbaae925 authored by littletux89@gmail.com's avatar littletux89@gmail.com
Browse files

[*] Fixed deleting wallet.

parent 8d5bdbb3
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ QHash<int, QByteArray> DapChainWalletsModel::roleNames() const ...@@ -49,7 +49,7 @@ QHash<int, QByteArray> DapChainWalletsModel::roleNames() const
QVariantMap DapChainWalletsModel::get(int row) const QVariantMap DapChainWalletsModel::get(int row) const
{ {
if (m_dapChainWallets.count() == 0) { if (m_dapChainWallets.count() == 0 || m_dapChainWallets.count() == row) {
return { {"iconPath", ""}, {"name", ""}, {"address", ""}, {"balance", ""}, {"tokens", QStringList()}, {"count", 0} }; return { {"iconPath", ""}, {"name", ""}, {"address", ""}, {"balance", ""}, {"tokens", QStringList()}, {"count", 0} };
} }
const DapChainWallet *wallet = m_dapChainWallets.value(row); const DapChainWallet *wallet = m_dapChainWallets.value(row);
......
...@@ -125,6 +125,7 @@ void DapServiceController::removeWallet(int index, const QString &asWalletName) ...@@ -125,6 +125,7 @@ void DapServiceController::removeWallet(int index, const QString &asWalletName)
qInfo() << QString("removeWallet(%1)").arg(index); qInfo() << QString("removeWallet(%1)").arg(index);
qInfo() << QString("removeWallet(%1)").arg(asWalletName); qInfo() << QString("removeWallet(%1)").arg(asWalletName);
m_pDapCommandController->removeWallet(asWalletName.trimmed()); m_pDapCommandController->removeWallet(asWalletName.trimmed());
DapChainWalletsModel::getInstance().remove(index);
} }
void DapServiceController::sendToken(const QString &asSendWallet, const QString &asAddressReceiver, const QString &asToken, const QString &aAmount) void DapServiceController::sendToken(const QString &asSendWallet, const QString &asAddressReceiver, const QString &asToken, const QString &aAmount)
......
...@@ -26,23 +26,6 @@ Dialog { ...@@ -26,23 +26,6 @@ Dialog {
{ {
anchors.fill: parent anchors.fill: parent
// Text {
// id: textWalletName
// text: qsTr(listViewWallet.model.get(listViewWallet.currentIndex < 0 ? 0 : listViewWallet.currentIndex).name)
// verticalAlignment: Text.AlignVCenter
// horizontalAlignment: Text.AlignHCenter
// height: 35
// anchors.bottom: textQuery.top
// anchors.bottomMargin: 20
// anchors.right: parent.right
// anchors.rightMargin: 10
// anchors.left: parent.left
// anchors.leftMargin: 10
// font.pixelSize: 20
// clip: true
// }
TextEdit { TextEdit {
...@@ -124,12 +107,7 @@ Dialog { ...@@ -124,12 +107,7 @@ Dialog {
onClicked: onClicked:
{ {
console.log("COUNT " + listViewWallet.model.count) dapServiceController.removeWallet(dapQmlWidgetChainWallet.indexWallet, dapQmlWidgetChainWallet.nameWallet)
console.log("INDEX " + dapQmlWidgetChainWallet.indexWallet + " " + dapQmlWidgetChainWallet.nameWallet)
// listViewWallet.model.remove(dapQmlWidgetChainWallet.indexWallet)
// dapServiceController.removeWallet(dapQmlWidgetChainWallet.indexWallet, dapQmlWidgetChainWallet.nameWallet)
// console.log("INDEX " + dapQmlWidgetChainWallet.indexWallet + " " + dapQmlWidgetChainWallet.nameWallet)
close() close()
} }
} }
......
...@@ -41,7 +41,6 @@ DapUiQmlWidgetChainWalletForm { ...@@ -41,7 +41,6 @@ DapUiQmlWidgetChainWalletForm {
{ {
indexWallet = listViewWallet.currentIndex indexWallet = listViewWallet.currentIndex
nameWallet = listViewWallet.model.get(listViewWallet.currentIndex).name nameWallet = listViewWallet.model.get(listViewWallet.currentIndex).name
console.log("++++++" + indexWallet)
} }
else else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment