#include "sortedlibrary.h"
#include "book.h"
+#include "trace.h"
-SortedLibrary::SortedLibrary(QObject *parent): QSortFilterProxyModel(parent)
+SortedLibrary::SortedLibrary(QObject *parent):
+ QSortFilterProxyModel(parent), mSortBy(SortByTitle)
{
setSourceModel(Library::instance());
+ sort(0);
}
void SortedLibrary::sortBy(SortBy key)
break;
}
- return QString::localeAwareCompare(leftString, rightString);
+ return QString::localeAwareCompare(leftString, rightString) < 0;
}