Reported by @gmaxwell The sort order for the amount column is lexicographical resulting in a order like "1 10 2 20 200 3 ...".
The attempts of this PR is to fix this.
Reported by @gmaxwell The sort order for the amount column is lexicographical resulting in a order like "1 10 2 20 200 3 ...".
The attempts of this PR is to fix this.
729 | @@ -721,11 +730,11 @@ void CoinControlDialog::updateView() 730 | 731 | // amount 732 | itemOutput->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->vout[out.i].nValue)); 733 | - itemOutput->setText(COLUMN_AMOUNT_INT64, strPad(QString::number(out.tx->vout[out.i].nValue), 15, " ")); // padding so that sorting works correctly 734 | + itemOutput->setData(COLUMN_AMOUNT_INT64, Qt::DisplayRole, QVariant((qlonglong)out.tx->vout[out.i].nValue)); // padding so that sorting works correctly
Let's get rid of the hidden _INT64 columns completely, they should no longer be necessary.
Also: function strPad can go after this.
Working on a patch
Please cherry-pick the top commit from: https://github.com/laanwj/bitcoin/tree/2016_11_trol_cleanup into this. I've done some further cleanups and fixes:
UserRole to store our own data for sorting. This makes it treated as ancillary data prevents it from being displayed.getMappedColumn strPad - these are no longer necessary._INT64 columns.
- Do sorting for date, amount and confirmations column as longlong, not
unsigned longlong.
- Use `UserRole` to store our own data. This makes it treated as
ancillary data prevents it from being displayed.
- Get rid of `getMappedColumn` `strPad` - these are no longer necessary.
- Get rid of hidden `_INT64` columns.
- Start enumeration from 0 (otherwise values are undefined).
Thanks @laanwj! Cherry picked your 4231032
Tested ACK (Ubuntu) after @laanwj commit. Binaries: https://bitcoin.jonasschnelli.ch/pulls/9185/
Waiting for @gmaxwell's re-test
<img width="735" alt="bildschirmfoto 2016-11-21 um 13 55 27" src="https://cloud.githubusercontent.com/assets/178464/20483425/403e6474-aff2-11e6-9a68-1e01908c8561.png">
tested ACK!