projects
/
dorian
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix cover images.
[dorian]
/
model
/
library.cpp
diff --git
a/model/library.cpp
b/model/library.cpp
index
6d66a91
..
1a66639
100644
(file)
--- a/
model/library.cpp
+++ b/
model/library.cpp
@@
-47,7
+47,7
@@
QVariant Library::data(const QModelIndex &index, int role) const
ret = mBooks[index.row()]->name();
break;
case Qt::DecorationRole:
ret = mBooks[index.row()]->name();
break;
case Qt::DecorationRole:
- ret.setValue(mBooks[index.row()]->cover);
+ ret.setValue(mBooks[index.row()]->coverImage());
break;
default:
;
break;
default:
;
@@
-149,6
+149,7
@@
void Library::remove(const QModelIndex &index)
void Library::remove(const QString &path)
{
void Library::remove(const QString &path)
{
+ TRACE;
remove(find(path));
}
remove(find(path));
}
@@
-166,6
+167,7
@@
void Library::setNowReading(const QModelIndex &index)
void Library::clear()
{
void Library::clear()
{
+ TRACE;
for (int i = 0; i < mBooks.size(); i++) {
delete mBooks[i];
}
for (int i = 0; i < mBooks.size(); i++) {
delete mBooks[i];
}
@@
-175,6
+177,7
@@
void Library::clear()
QModelIndex Library::find(QString path) const
{
QModelIndex Library::find(QString path) const
{
+ TRACE;
if (path != "") {
QString absolutePath = QFileInfo(path).absoluteFilePath();
for (int i = 0; i < mBooks.size(); i++) {
if (path != "") {
QString absolutePath = QFileInfo(path).absoluteFilePath();
for (int i = 0; i < mBooks.size(); i++) {
@@
-188,6
+191,7
@@
QModelIndex Library::find(QString path) const
QModelIndex Library::find(const Book *book) const
{
QModelIndex Library::find(const Book *book) const
{
+ TRACE;
if (book) {
for (int i = 0; i < mBooks.size(); i++) {
if (book == mBooks[i]) {
if (book) {
for (int i = 0; i < mBooks.size(); i++) {
if (book == mBooks[i]) {