Merge pull request #376

f012e4d history: show pending on top (Jaquee)
This commit is contained in:
Riccardo Spagni 2017-01-08 16:56:51 -08:00
commit 3badb12ea3
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
2 changed files with 6 additions and 2 deletions

View File

@ -265,7 +265,7 @@ ListView {
font.pixelSize: 13
font.letterSpacing: -1
color: "#545454"
text: blockHeight
text: (typeof blockHeight != "undefined")? blockHeight : qsTr("Pending") + translationManager.emptyString
}
}

View File

@ -75,7 +75,11 @@ QVariant TransactionHistoryModel::data(const QModelIndex &index, int role) const
result = tInfo->fee();
break;
case TransactionBlockHeightRole:
result = tInfo->blockHeight();
// Use NULL QVariant for transactions without height.
// Forces them to be displayed at top when sorted by blockHeight.
if (tInfo->blockHeight() != 0) {
result = tInfo->blockHeight();
}
break;
case TransactionHashRole:
result = tInfo->hash();