add a natural sort helper function for qSort
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1236305
This commit is contained in:
parent
d6544380a9
commit
9449938d4b
|
@ -33,6 +33,7 @@
|
|||
#include <kcmdlineargs.h>
|
||||
#include <kdebug.h>
|
||||
#include <kmenu.h>
|
||||
#include <kstringhandler.h>
|
||||
|
||||
#include <solid/device.h>
|
||||
|
||||
|
@ -140,6 +141,11 @@ bool caseInsensitiveLessThan(const QString& s1, const QString& s2)
|
|||
return s1.toLower() < s2.toLower();
|
||||
}
|
||||
|
||||
bool naturalLessThan(const QString& s1, const QString& s2)
|
||||
{
|
||||
return KStringHandler::naturalCompare(s1, s2) < 0;
|
||||
}
|
||||
|
||||
QIcon createFileSystemColor(FileSystem::Type type, quint32 size)
|
||||
{
|
||||
QPixmap pixmap(size, size);
|
||||
|
|
|
@ -43,6 +43,7 @@ LIBPARTITIONMANAGERPRIVATE_EXPORT bool checkPermissions();
|
|||
LIBPARTITIONMANAGERPRIVATE_EXPORT KAboutData* createPartitionManagerAboutData();
|
||||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT bool caseInsensitiveLessThan(const QString& s1, const QString& s2);
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT bool naturalLessThan(const QString& s1, const QString& s2);
|
||||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT QIcon createFileSystemColor(FileSystem::Type type, quint32 size);
|
||||
|
||||
|
|
Loading…
Reference in New Issue