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

@ -300,7 +300,7 @@ bool ExternalResourcesPage::current(const QModelIndex& current, const QModelInde
return onSelectionChanged(current, previous);
}
bool ExternalResourcesPage::onSelectionChanged(const QModelIndex& current, const QModelIndex& previous)
bool ExternalResourcesPage::onSelectionChanged(const QModelIndex& current, [[maybe_unused]] const QModelIndex& previous)
{
auto sourceCurrent = m_filterModel->mapToSource(current);
int row = sourceCurrent.row();

View File

@ -482,7 +482,7 @@ void InstanceSettingsPage::changeInstanceAccount(int index)
}
}
void InstanceSettingsPage::on_maxMemSpinBox_valueChanged(int i)
void InstanceSettingsPage::on_maxMemSpinBox_valueChanged([[maybe_unused]] int i)
{
updateThresholds();
}

View File

@ -122,7 +122,7 @@ bool ModFolderPage::shouldDisplay() const
return true;
}
bool ModFolderPage::onSelectionChanged(const QModelIndex& current, const QModelIndex& previous)
bool ModFolderPage::onSelectionChanged(const QModelIndex& current, [[maybe_unused]] const QModelIndex& previous)
{
auto sourceCurrent = m_filterModel->mapToSource(current);
int row = sourceCurrent.row();

View File

@ -287,23 +287,23 @@ void OtherLogsPage::on_btnClean_clicked()
}
if(!failed.empty())
{
QMessageBox *messageBox = new QMessageBox(this);
messageBox->setWindowTitle(tr("Error"));
QMessageBox *messageBoxFailure = new QMessageBox(this);
messageBoxFailure->setWindowTitle(tr("Error"));
if(failed.size() > 5)
{
messageBox->setText(tr("Couldn't delete some files!"));
messageBox->setDetailedText(failed.join('\n'));
messageBoxFailure->setText(tr("Couldn't delete some files!"));
messageBoxFailure->setDetailedText(failed.join('\n'));
}
else
{
messageBox->setText(tr("Couldn't delete some files:\n%1").arg(failed.join('\n')));
messageBoxFailure->setText(tr("Couldn't delete some files:\n%1").arg(failed.join('\n')));
}
messageBox->setStandardButtons(QMessageBox::Ok);
messageBox->setDefaultButton(QMessageBox::Ok);
messageBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
messageBox->setIcon(QMessageBox::Critical);
messageBox->setTextInteractionFlags(Qt::TextBrowserInteraction);
messageBox->exec();
messageBoxFailure->setStandardButtons(QMessageBox::Ok);
messageBoxFailure->setDefaultButton(QMessageBox::Ok);
messageBoxFailure->setTextInteractionFlags(Qt::TextSelectableByMouse);
messageBoxFailure->setIcon(QMessageBox::Critical);
messageBoxFailure->setTextInteractionFlags(Qt::TextBrowserInteraction);
messageBoxFailure->exec();
}
}

View File

@ -55,7 +55,7 @@ ResourcePackPage::ResourcePackPage(MinecraftInstance* instance, std::shared_ptr<
ui->actionViewConfigs->setVisible(false);
}
bool ResourcePackPage::onSelectionChanged(const QModelIndex& current, const QModelIndex& previous)
bool ResourcePackPage::onSelectionChanged(const QModelIndex& current, [[maybe_unused]] const QModelIndex& previous)
{
auto sourceCurrent = m_filterModel->mapToSource(current);
int row = sourceCurrent.row();

View File

@ -684,7 +684,7 @@ void ServersPage::runningStateChanged(bool running)
updateState();
}
void ServersPage::currentChanged(const QModelIndex &current, const QModelIndex &previous)
void ServersPage::currentChanged(const QModelIndex &current, [[maybe_unused]] const QModelIndex &previous)
{
int nextServer = -1;
if (!current.isValid())
@ -700,7 +700,7 @@ void ServersPage::currentChanged(const QModelIndex &current, const QModelIndex &
}
// WARNING: this is here because currentChanged is not accurate when removing rows. the current item needs to be fixed up after removal.
void ServersPage::rowsRemoved(const QModelIndex& parent, int first, int last)
void ServersPage::rowsRemoved([[maybe_unused]] const QModelIndex& parent, int first, int last)
{
if(currentServer < first)
{

View File

@ -57,7 +57,7 @@ TexturePackPage::TexturePackPage(MinecraftInstance* instance, std::shared_ptr<Te
ui->actionViewConfigs->setVisible(false);
}
bool TexturePackPage::onSelectionChanged(const QModelIndex& current, const QModelIndex& previous)
bool TexturePackPage::onSelectionChanged(const QModelIndex& current, [[maybe_unused]] const QModelIndex& previous)
{
auto sourceCurrent = m_filterModel->mapToSource(current);
int row = sourceCurrent.row();

View File

@ -202,7 +202,7 @@ void VersionPage::showContextMenu(const QPoint& pos)
delete menu;
}
void VersionPage::packageCurrent(const QModelIndex &current, const QModelIndex &previous)
void VersionPage::packageCurrent(const QModelIndex &current, [[maybe_unused]] const QModelIndex &previous)
{
if (!current.isValid())
{
@ -647,7 +647,7 @@ void VersionPage::on_actionMinecraftFolder_triggered()
DesktopServices::openDirectory(m_inst->gameRoot(), true);
}
void VersionPage::versionCurrent(const QModelIndex &current, const QModelIndex &previous)
void VersionPage::versionCurrent(const QModelIndex &current, [[maybe_unused]] const QModelIndex &previous)
{
currentIdx = current.row();
updateButtons(currentIdx);

View File

@ -352,7 +352,7 @@ void WorldListPage::mceditState(LoggedProcess::State state)
}
}
void WorldListPage::worldChanged(const QModelIndex &current, const QModelIndex &previous)
void WorldListPage::worldChanged([[maybe_unused]] const QModelIndex &current, [[maybe_unused]] const QModelIndex &previous)
{
QModelIndex index = getSelectedWorld();
bool enable = index.isValid();