> On May 14, 2014, 2:13 p.m., Mark Gaiser wrote: > > Ehh.. > > > > Does this mean that there is no way to get the actual byte size anymore? > > > > In that case i think it would be better to introduce a new role: > > "HumanReadableSize" which does what your patch is doing now. > > > > Note: i really think that this user facing value should be determined in > > either the view, not the model. Imho the model should always return the > > byte version where the view formats it to whatever it wants. This also > > eases sorting. > > Martin Klapetek wrote: > I don't disagree, but since that role already returns formatted bytes > string (QLocale().toString(..)), it actually already does not quite return > the bytes you might want (some locales have thousands delimiter etc).
Revising my stance. The format is already "1.000.000" thus breaking sorting since that is just the default QAbstractItemModel::sort which means it's doing a local aware string comparison. With that in mind: +1 to make it fully human readable thus accepting this patch. However, it might be good to add a new role called "Bytes". Then KDirModel::sort should use the Bytes role when Size is provided. That should fix sorting based on size. - Mark ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118128/#review57921 ----------------------------------------------------------- On May 14, 2014, 2:01 p.m., Martin Klapetek wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/118128/ > ----------------------------------------------------------- > > (Updated May 14, 2014, 2:01 p.m.) > > > Review request for KDE Frameworks and David Faure. > > > Repository: kio > > > Description > ------- > > Now I'm not sure if returning the unit together with the size won't break > some things, but as it returns string already, I thought returning it in the > "human readable" form would be better than always returning bytes. > > > Diffs > ----- > > src/widgets/kdirmodel.cpp 70d5ee4 > > Diff: https://git.reviewboard.kde.org/r/118128/diff/ > > > Testing > ------- > > > Thanks, > > Martin Klapetek > >
_______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel