Hi, 2013/7/19 Aleix Pol: > Hi, > I was looking at that task in the Qt5 epics list and I didn't understand it > fully. > > contribute natural-comparison to Qt5 (see KStringHandler). In Qt there is > naturalCompare function but private and not as good as from KStringHandler. > Thiago says: add the feature to QCollator.
Could you explain why KStringHandler::naturalCompare() is better than what QCollator offers? QCollator has the very nice feature QByteArray QCollator::sortKey(const QString &string) which allows to calculate the 'sortKey' for each string once, and then use these for the sorting. This means that we could sort a large list of strings with O(N*log(N)) cheap comparisons of QByteArrays, rather than the same amount of very expensive KStringHandler::naturalCompare() calls. At the moment, KStringHandler::naturalCompare() is the major bottleneck in Dolphin when you open a very large directory. If we could use QCollator, that problem could be solved quite easily. Cheers, Frank _______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel