Fix sort order for numbers

This commit is contained in:
David Sansome 2009-12-24 21:09:18 +00:00
parent 02097ce50e
commit 15158805af
1 changed files with 6 additions and 2 deletions

View File

@ -482,8 +482,12 @@ QMimeData* Library::mimeData(const QModelIndexList& indexes) const {
}
bool Library::CompareItems(const LibraryItem* a, const LibraryItem* b) const {
return data(a, Library::Role_SortText).toString() <
data(b, Library::Role_SortText).toString();
QVariant left(data(a, Library::Role_SortText));
QVariant right(data(b, Library::Role_SortText));
if (left.type() == QVariant::Int)
return left.toInt() < right.toInt();
return left.toString() < right.toString();
}
void Library::GetChildSongs(LibraryItem* item, QList<QUrl>* urls, SongList* songs) const {