Fix shadowing and add copyright header

Signed-off-by: PandaNinjas <admin@malwarefight.wip.la>
This commit is contained in:
PandaNinjas 2023-06-07 22:13:57 -04:00 committed by GitHub
parent 886b372ade
commit 11cbeb8f96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
/* /*
* PolyMC - Minecraft Launcher * PolyMC - Minecraft Launcher
* Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> * Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3. * the Free Software Foundation, version 3.
@ -187,13 +187,13 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const
} }
case Qt::ToolTipRole: { case Qt::ToolTipRole: {
if (column == Name && hasRecommended) { if (column == Name && hasRecommended) {
auto value = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole); auto recommendedValue = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole);
if(value.toBool()) { if(recommendedValue.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"); return tr("Latest");
} }
@ -206,12 +206,12 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const
} }
case Qt::DecorationRole: { case Qt::DecorationRole: {
if (column == Name && hasRecommended) { if (column == Name && hasRecommended) {
auto value = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole); auto recommendedValue = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole);
if(value.toBool()) { if(recommendedValue.toBool()) {
return APPLICATION->getThemedIcon("star"); return APPLICATION->getThemedIcon("star");
} 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 APPLICATION->getThemedIcon("bug"); return APPLICATION->getThemedIcon("bug");
} }
} }