[Qt] fix coincontrol sort issue #9185

pull jonasschnelli wants to merge 2 commits into bitcoin:master from jonasschnelli:2016/11/fix_cc_sort changing 2 files +32 −49
  1. jonasschnelli commented at 10:13 AM on November 18, 2016: contributor

    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.

  2. [Qt] fix coincontrol sort issue 76af4eb876
  3. jonasschnelli added the label GUI on Nov 18, 2016
  4. jonasschnelli added the label Priority Low on Nov 18, 2016
  5. in src/qt/coincontroldialog.cpp:None in 76af4eb876 outdated
     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
    


    laanwj commented at 12:17 PM on November 18, 2016:

    Let's get rid of the hidden _INT64 columns completely, they should no longer be necessary.


    laanwj commented at 12:17 PM on November 18, 2016:

    Also: function strPad can go after this.

  6. laanwj changes_requested
  7. laanwj commented at 1:16 PM on November 18, 2016: member

    Working on a patch

  8. laanwj commented at 1:39 PM on November 18, 2016: member

    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 for sorting. 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 column enumeration from 0 (otherwise values are undefined).
  9. [Qt] Clean up and fix coincontrol tree widget handling
    - 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).
    4231032bfc
  10. jonasschnelli commented at 7:20 PM on November 20, 2016: contributor

    Thanks @laanwj! Cherry picked your 4231032

  11. laanwj approved
  12. laanwj commented at 7:46 AM on November 21, 2016: member

    @gmaxwell Can you please test this in your environment and confirm whether the problem is fixed?

  13. jonasschnelli commented at 12:56 PM on November 21, 2016: contributor

    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">

  14. gmaxwell commented at 6:22 AM on November 22, 2016: contributor

    tested ACK!

  15. jonasschnelli merged this on Nov 22, 2016
  16. jonasschnelli closed this on Nov 22, 2016

  17. jonasschnelli referenced this in commit e4dbeb9499 on Nov 22, 2016
  18. luke-jr referenced this in commit 6d70a73968 on Dec 2, 2016
  19. luke-jr referenced this in commit ff423cc6b0 on Dec 2, 2016
  20. codablock referenced this in commit 507c4e5246 on Jan 15, 2018
  21. andvgal referenced this in commit 4ae486325a on Jan 6, 2019
  22. CryptoCentric referenced this in commit 36d2ebd1f6 on Feb 24, 2019
  23. MarcoFalke locked this on Sep 8, 2021
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me