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>
This commit is contained in:
Rachel Powers
2023-06-30 23:51:15 -07:00
parent 98d6904e4a
commit 8d7dcdfc5b
96 changed files with 409 additions and 413 deletions

View File

@ -114,7 +114,7 @@ QVariant AtlOptionalModListModel::data(const QModelIndex &index, int role) const
return {};
}
bool AtlOptionalModListModel::setData(const QModelIndex &index, const QVariant &value, int role) {
bool AtlOptionalModListModel::setData(const QModelIndex &index, [[maybe_unused]] const QVariant &value, int role) {
if (role == Qt::CheckStateRole) {
auto row = index.row();
auto mod = m_mods.at(row);
@ -206,7 +206,7 @@ void AtlOptionalModListModel::shareCodeSuccess() {
AtlOptionalModListModel::index(m_mods.size() - 1, EnabledColumn));
}
void AtlOptionalModListModel::shareCodeFailure(const QString& reason) {
void AtlOptionalModListModel::shareCodeFailure([[maybe_unused]] const QString& reason) {
m_jobPtr.reset();
// fixme: plumb in an error message
@ -277,16 +277,16 @@ void AtlOptionalModListModel::setMod(ATLauncher::VersionMod mod, int index, bool
// if the dependency is 'effectively hidden', then track which mods
// depend on it - so we can efficiently disable it when no more dependents
// depend on it.
auto dependants = m_dependants[dependencyName];
auto dependents = m_dependents[dependencyName];
if (enable) {
dependants.append(mod.name);
dependents.append(mod.name);
}
else {
dependants.removeAll(mod.name);
dependents.removeAll(mod.name);
// if there are no longer any dependents, let's disable the mod
if (dependencyMod.effectively_hidden && dependants.isEmpty()) {
if (dependencyMod.effectively_hidden && dependents.isEmpty()) {
setMod(dependencyMod, dependencyIndex, false, shouldEmit);
}
}
@ -294,8 +294,8 @@ void AtlOptionalModListModel::setMod(ATLauncher::VersionMod mod, int index, bool
// disable mods that depend on this one, if disabling
if (!enable) {
auto dependants = m_dependants[mod.name];
for (const auto& dependencyName : dependants) {
auto dependents = m_dependents[mod.name];
for (const auto& dependencyName : dependents) {
auto dependencyIndex = m_index[dependencyName];
auto dependencyMod = m_mods.at(dependencyIndex);

View File

@ -91,7 +91,7 @@ private:
QMap<QString, bool> m_selection;
QMap<QString, int> m_index;
QMap<QString, QVector<QString>> m_dependants;
QMap<QString, QVector<QString>> m_dependents;
};
class AtlOptionalModDialog : public QDialog {

View File

@ -132,13 +132,13 @@ void AtlPage::triggerSearch()
filterModel->setSearchTerm(ui->searchEdit->text());
}
void AtlPage::onSortingSelectionChanged(QString data)
void AtlPage::onSortingSelectionChanged(QString sort)
{
auto toSet = filterModel->getAvailableSortings().value(data);
auto toSet = filterModel->getAvailableSortings().value(sort);
filterModel->setSorting(toSet);
}
void AtlPage::onSelectionChanged(QModelIndex first, QModelIndex second)
void AtlPage::onSelectionChanged(QModelIndex first, [[maybe_unused]] QModelIndex second)
{
ui->versionSelectionBox->clear();
@ -162,14 +162,14 @@ void AtlPage::onSelectionChanged(QModelIndex first, QModelIndex second)
suggestCurrent();
}
void AtlPage::onVersionSelectionChanged(QString data)
void AtlPage::onVersionSelectionChanged(QString version)
{
if(data.isNull() || data.isEmpty())
if(version.isNull() || version.isEmpty())
{
selectedVersion = "";
return;
}
selectedVersion = data;
selectedVersion = version;
suggestCurrent();
}