projects
/
dorian
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix sorting of library. Add basic search framework.
[dorian]
/
model
/
sortedlibrary.cpp
diff --git
a/model/sortedlibrary.cpp
b/model/sortedlibrary.cpp
index
9091263
..
3a0fb54
100644
(file)
--- a/
model/sortedlibrary.cpp
+++ b/
model/sortedlibrary.cpp
@@
-1,9
+1,12
@@
#include "sortedlibrary.h"
#include "book.h"
#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());
{
setSourceModel(Library::instance());
+ sort(0);
}
void SortedLibrary::sortBy(SortBy key)
}
void SortedLibrary::sortBy(SortBy key)
@@
-31,5
+34,5
@@
bool SortedLibrary::lessThan(const QModelIndex &left,
break;
}
break;
}
- return QString::localeAwareCompare(leftString, rightString);
+ return QString::localeAwareCompare(leftString, rightString) < 0;
}
}