Commit 0fe63ef5 authored by Akshay Ratan's avatar Akshay Ratan
Browse files

Thumbnails of High resolution pictures can also be viewed.

REVIEW: 111863
parent 981f86cc
......@@ -37,18 +37,21 @@ LocalPicturesModel::LocalPicturesModel (QObject* parent) : LocalFilesAbstractMod
QVariant LocalPicturesModel::data (const QModelIndex& index, int role) const
{
if (role == Qt::DecorationRole) {
const QString url = data(index, MediaCenter::MediaUrlRole).toString();
if (m_thumbProvider->hasThumbnail(url)) {
return "image://localpicturesthumbnail/" + url;
} else {
m_thumbProvider->loadThumbnail(KUrl(url), QSize(600, 600));
m_pendingThumbs.insert(url, index);
if(role == Qt::DecorationRole) {
const QString url = data(index, MediaCenter::MediaUrlRole).toString();
if (!LocalPicturesModel::data(index, MediaCenter::IsExpandableRole).toBool()) {
return LocalFilesAbstractModel::data (index, MediaCenter::MediaUrlRole);
} else {
if (m_thumbProvider->hasThumbnail(url)) {
return "image://localpicturesthumbnail/" + url;
} else {
m_thumbProvider->loadThumbnail(KUrl(url), QSize(600, 600));
m_pendingThumbs.insert(url, index);
}
}
} else if(role == MediaCenter::HideLabelRole) {
return !LocalPicturesModel::data(index, MediaCenter::IsExpandableRole).toBool();
}
return !LocalPicturesModel::data(index, MediaCenter::IsExpandableRole).toBool();
}
return LocalFilesAbstractModel::data (index, role);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment