Hi, thanks for the explanation!
2013/6/12 Kevin Ottens: > Hello, > > On Tuesday 11 June 2013 21:08:45 Frank Reininghaus wrote: >> 2013/6/11 Kevin Ottens: >> [...] >> >> > * ItemViews will be tier 2 until we contribute the natural compare to Qt; >> >> I thought that Qt 5.1 will have the QCollator class, which can perform >> natural comparison of strings if you use "numeric mode"? > > Indeed, it's still private API though. Also the conclusion was "our > implementation is better", but looking at QCollator I'm not sure I agree with > that. The disadvantage of KStringHandler:: naturalCompare(QString, QString) is that it's very slow. When you open a directory with really many files in Dolphin, this function is the main bottleneck. The big advantage of QCollator is that it has a function QByteArray QCollator::sortKey(const QString &string) which lets you do the expensive stuff just N times for N items, and then do O(N*log N) cheap comparisons of QByteArrays when you sort them. Regards, Frank _______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel