diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-06-30 23:51:15 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-07-01 23:39:38 -0700 |
commit | 8d7dcdfc5b2a231a1304878e25929e6f4ff4e338 (patch) | |
tree | 761f56c74858e9811b9fa78ff63392f51836678c /launcher/VersionProxyModel.cpp | |
parent | 98d6904e4a84836c1b9ec662b0b8a49d5282e27b (diff) | |
download | PrismLauncher-8d7dcdfc5b2a231a1304878e25929e6f4ff4e338.tar.gz PrismLauncher-8d7dcdfc5b2a231a1304878e25929e6f4ff4e338.tar.bz2 PrismLauncher-8d7dcdfc5b2a231a1304878e25929e6f4ff4e338.zip |
chore: fix shadowed member and signed/unsigned mismatch
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: supress unused with [[maybe_unused]]
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: unshadow ^&^& static_cast implicit return
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: deshadow and mark unused in parse task
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: mark unused in folder models
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: deshadow and mark unused with instances
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: more deshadow and unused
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: remove uneeded simicolons
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: mark unused
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
chore: prevent shadow
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/VersionProxyModel.cpp')
-rw-r--r-- | launcher/VersionProxyModel.cpp | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/launcher/VersionProxyModel.cpp b/launcher/VersionProxyModel.cpp index e5c66566..ce3abe38 100644 --- a/launcher/VersionProxyModel.cpp +++ b/launcher/VersionProxyModel.cpp @@ -199,16 +199,12 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const { if(hasRecommended) { - auto value = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole); - if(value.toBool()) - { + auto recommended = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole); + if (recommended.toBool()) { return tr("Recommended"); - } - else if(hasLatest) - { - auto value = sourceModel()->data(parentIndex, BaseVersionList::LatestRole); - if(value.toBool()) - { + } else if (hasLatest) { + auto latest = sourceModel()->data(parentIndex, BaseVersionList::LatestRole); + if (latest.toBool()) { return tr("Latest"); } } @@ -228,16 +224,12 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const { if(hasRecommended) { - auto value = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole); - if(value.toBool()) - { + auto recommenced = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole); + if (recommenced.toBool()) { return APPLICATION->getThemedIcon("star"); - } - else if(hasLatest) - { - auto value = sourceModel()->data(parentIndex, BaseVersionList::LatestRole); - if(value.toBool()) - { + } else if (hasLatest) { + auto latest = sourceModel()->data(parentIndex, BaseVersionList::LatestRole); + if (latest.toBool()) { return APPLICATION->getThemedIcon("bug"); } } @@ -270,7 +262,7 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const } } -QModelIndex VersionProxyModel::parent(const QModelIndex &child) const +QModelIndex VersionProxyModel::parent([[maybe_unused]] const QModelIndex& child) const { return QModelIndex(); } @@ -469,7 +461,9 @@ void VersionProxyModel::sourceRowsAboutToBeInserted(const QModelIndex& parent, i beginInsertRows(parent, first, last); } -void VersionProxyModel::sourceRowsInserted(const QModelIndex& parent, int first, int last) +void VersionProxyModel::sourceRowsInserted([[maybe_unused]] const QModelIndex& parent, + [[maybe_unused]] int first, + [[maybe_unused]] int last) { endInsertRows(); } @@ -479,7 +473,7 @@ void VersionProxyModel::sourceRowsAboutToBeRemoved(const QModelIndex& parent, in beginRemoveRows(parent, first, last); } -void VersionProxyModel::sourceRowsRemoved(const QModelIndex& parent, int first, int last) +void VersionProxyModel::sourceRowsRemoved([[maybe_unused]] const QModelIndex& parent, [[maybe_unused]] int first, [[maybe_unused]] int last) { endRemoveRows(); } |