-
Notifications
You must be signed in to change notification settings - Fork 38.6k
[Qt] fix coincontrol sort issue #9185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Qt] fix coincontrol sort issue #9185
Conversation
src/qt/coincontroldialog.cpp
Outdated
| // amount | ||
| itemOutput->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->vout[out.i].nValue)); | ||
| itemOutput->setText(COLUMN_AMOUNT_INT64, strPad(QString::number(out.tx->vout[out.i].nValue), 15, " ")); // padding so that sorting works correctly | ||
| itemOutput->setData(COLUMN_AMOUNT_INT64, Qt::DisplayRole, QVariant((qlonglong)out.tx->vout[out.i].nValue)); // padding so that sorting works correctly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get rid of the hidden _INT64 columns completely, they should no longer be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
|
- 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).
|
@gmaxwell Can you please test this in your environment and confirm whether the problem is fixed? |
|
Tested ACK (Ubuntu) after @laanwj commit. Waiting for @gmaxwell's re-test |
|
tested ACK! |
Github-Pull: bitcoin#9185 Rebased-From: 76af4eb
- 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). Github-Pull: bitcoin#9185 Rebased-From: 4231032

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.