Summary: | Sorting on fields ETA, Last Seen and Age not correct | ||
---|---|---|---|
Product: | [Applications] kmldonkey | Reporter: | Henk de Leeuw <bugs.kde.org> |
Component: | general | Assignee: | Petter Stokke <ummo> |
Status: | RESOLVED FIXED | ||
Severity: | minor | ||
Priority: | NOR | ||
Version: | 0.9.1 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Henk de Leeuw
2004-01-27 22:30:51 UTC
This is mostly fixed in CVS. I'll follow up with a commit that fixes the rest. Subject: kdeextragear-2/kmldonkey/kmldonkey CVS commit by pstokke: Sort the ETA field numerically. CCMAIL: 73642-done@bugs.kde.org M +11 -2 infolist.cpp 1.20 --- kdeextragear-2/kmldonkey/kmldonkey/infolist.cpp #1.19:1.20 @@ -284,4 +284,10 @@ QString humanReadableTime(time_t t, bool } +double calculateETANumeric(FileInfo* fi) +{ + if (!fi->fileSpeed() || fi->fileSize() <= fi->fileDownloaded()) return 0; + return (double)(fi->fileSize() - fi->fileDownloaded()) / fi->fileSpeed(); +} + QString calculateETA(FileInfo* fi) { @@ -398,4 +404,6 @@ double DownloadFile::numeric( int col ) case 6: return it->fileSize() ? ((double)it->fileDownloaded() * 100.0) / (double)it->fileSize() : 0.0; + case 7: + return calculateETANumeric(it); case 3: return it->fileSpeed(); @@ -403,7 +411,7 @@ double DownloadFile::numeric( int col ) return (double)it->fileSources().size(); case 11: - return (time_t)it->fileLastSeen(); + return (double)((time_t)it->fileLastSeen()); case 12: - return it->fileAge(); + return (double)(time(0) - (time_t)it->fileAge()); default: return 0.0; @@ -419,4 +427,5 @@ bool DownloadFile::isNumeric(int col) co case 5: case 6: + case 7: case 9: case 11: It was a minor bug, really, not a wishlist item. :) |