From c0b6b091c3f92fe8f2951b89f4698dea8dbf1e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Tue, 10 Jun 2014 23:23:26 +0200 Subject: [PATCH] added folder_finished.png --- YACReaderLibrary/db/treemodel.cpp | 11 ++++++++--- YACReaderLibrary/images.qrc | 1 + images/folder_finished.png | Bin 0 -> 386 bytes 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 images/folder_finished.png diff --git a/YACReaderLibrary/db/treemodel.cpp b/YACReaderLibrary/db/treemodel.cpp index ea5a88af..8ccc4e29 100644 --- a/YACReaderLibrary/db/treemodel.cpp +++ b/YACReaderLibrary/db/treemodel.cpp @@ -106,17 +106,22 @@ QVariant TreeModel::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); + TreeItem *item = static_cast(index.internalPointer()); + if (role == Qt::DecorationRole) #ifdef Q_OS_MAC - return QVariant(QFileIconProvider().icon(QFileIconProvider::Folder)); + return QVariant(QFileIconProvider().icon(QFileIconProvider::Folder)); //TODO draw a tick on top when it is needed #else - return QVariant(QIcon(":/images/folder.png")); + if(!item->data(TreeModel::Finished).toBool()) + return QVariant(QIcon(":/images/folder_finished.png")); + else + return QVariant(QIcon(":/images/folder.png")); #endif if (role != Qt::DisplayRole) return QVariant(); - TreeItem *item = static_cast(index.internalPointer()); + return item->data(index.column()); } diff --git a/YACReaderLibrary/images.qrc b/YACReaderLibrary/images.qrc index 11902b02..fb527aa9 100644 --- a/YACReaderLibrary/images.qrc +++ b/YACReaderLibrary/images.qrc @@ -1,6 +1,7 @@ ../images/folder.png + ../images/folder_finished.png ../images/icon.png ../images/iconLibrary.png ../images/new.png diff --git a/images/folder_finished.png b/images/folder_finished.png new file mode 100644 index 0000000000000000000000000000000000000000..8313e89203f8a060892038c483bc147304945d33 GIT binary patch literal 386 zcmV-|0e$|7P)ah#7O`_O@lz<0EtAACj7%#fdrJ*YDao99>4d-Glsw#ZQCwz3R#v3 zJP2}6{3y_TbAMWlg$Y)j=NXn|IpBXbIe;Q@97hH;IUAit9LE9A^FS#Du4x)3Kylyq z3|-glzn9<n+a literal 0 HcmV?d00001