Fix VersionProxyModel.cpp
Signed-off-by: PandaNinjas <admin@malwarefight.wip.la>
This commit is contained in:
parent
4509fde410
commit
817ecf8225
@ -191,36 +191,21 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case Qt::ToolTipRole: {
|
case Qt::ToolTipRole:
|
||||||
|
{
|
||||||
if (column == Name && hasRecommended) {
|
if (column == Name && hasRecommended) {
|
||||||
auto recommendedValue = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole);
|
auto value = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole);
|
||||||
if(recommendedValue.toBool()) {
|
if (value.toBool()) {
|
||||||
return tr("Recommended");
|
return tr("Recommended");
|
||||||
}
|
} else if(hasLatest) {
|
||||||
else if(hasLatest) {
|
auto value = sourceModel()->data(parentIndex, BaseVersionList::LatestRole);
|
||||||
auto latestValue = sourceModel()->data(parentIndex, BaseVersionList::LatestRole);
|
if(value.toBool()) {
|
||||||
if(latestValue.toBool())
|
return tr("Latest");
|
||||||
{
|
|
||||||
auto value = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole);
|
|
||||||
if(value.toBool())
|
|
||||||
{
|
|
||||||
return tr("Recommended");
|
|
||||||
}
|
|
||||||
else if(hasLatest)
|
|
||||||
{
|
|
||||||
auto value = sourceModel()->data(parentIndex, BaseVersionList::LatestRole);
|
|
||||||
if(value.toBool())
|
|
||||||
{
|
|
||||||
return tr("Latest");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(index.row() == 0) {
|
} else {
|
||||||
return tr("Latest");
|
return sourceModel()->data(parentIndex, BaseVersionList::VersionIdRole);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return sourceModel()->data(parentIndex, BaseVersionList::VersionIdRole);
|
|
||||||
}
|
}
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
{
|
{
|
||||||
@ -255,20 +240,10 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const
|
|||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(index.row() == 0) {
|
default:
|
||||||
return APPLICATION->getThemedIcon("bug");
|
{
|
||||||
|
return QVariant();
|
||||||
}
|
}
|
||||||
QPixmap pixmap;
|
|
||||||
QPixmapCache::find("placeholder", &pixmap);
|
|
||||||
if(!pixmap) {
|
|
||||||
QPixmap px(16,16);
|
|
||||||
px.fill(Qt::transparent);
|
|
||||||
QPixmapCache::insert("placeholder", px);
|
|
||||||
return px;
|
|
||||||
}
|
|
||||||
return pixmap;
|
|
||||||
} else {
|
|
||||||
return QVariant();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user