Skip to content
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

Fix GUI sort by size #2311

Closed
wants to merge 1 commit into from
Closed

Conversation

HebaruSan
Copy link
Member

Background

#2277 updated the Download column in GUI to use "B", "KB", "MB", and "GB" units depending on the magnitude of the size. Previously this column was always in KB.

Problem

This broke the sorting of this column. There doesn't seem to be a pattern to it anymore.

image

Cause

The size sort code depended on parsing the text of the cells, which is no longer useful when the units aren't the same or when the strings contain more than just numeric digits.

Changes

Now the Download column sorts directly by the raw size data. The largest mods are:

image

Fixes https://forum.kerbalspaceprogram.com/index.php?/topic/154922-ckan-the-comprehensive-kerbal-archive-network-v1240-bruce/&do=findComment&comment=3303380 .

@HebaruSan HebaruSan added GUI Issues affecting the interactive GUI Pull request Bug Something is not working as intended labels Feb 24, 2018
@politas
Copy link
Member

politas commented Feb 24, 2018

I saw that comment and thought this would be the way to do it, but I had not a clue how to start.

politas added a commit to politas/CKAN that referenced this pull request Feb 24, 2018
@HebaruSan
Copy link
Member Author

@politas , I think you merged this into your own fork rather than KSP-CKAN's. Was that intentional?

@politas
Copy link
Member

politas commented Feb 25, 2018

Ah, must have missed the push to the main fork. I'll fix it when I get home.

@politas
Copy link
Member

politas commented Feb 25, 2018

Ok, some definite weirdness happened. This has now been merged, though I broke the GitHub PR connection in the process.

@politas politas closed this Feb 25, 2018
@politas politas removed Bug Something is not working as intended Pull request labels Feb 25, 2018
@HebaruSan HebaruSan deleted the fix/sort-by-size branch February 25, 2018 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants