history: show pending on top

This commit is contained in:
Jaquee 2016-12-31 14:56:08 +01:00
parent d8f9e7360f
commit f012e4d968
No known key found for this signature in database
GPG key ID: 384E52B09F45DC39
2 changed files with 6 additions and 2 deletions

View file

@ -239,7 +239,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:
// 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();