Removed unused variable

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-06-21 21:17:17 +03:00
parent 0975dbc3dd
commit 480faca559
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
6 changed files with 1 additions and 27 deletions

View File

@ -135,9 +135,6 @@ void ExternalResourcesPage::retranslate()
void ExternalResourcesPage::itemActivated(const QModelIndex&)
{
if (!m_controlsEnabled)
return;
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection());
m_model->setResourceEnabled(selection.indexes(), EnableAction::TOGGLE);
}
@ -182,9 +179,6 @@ bool ExternalResourcesPage::eventFilter(QObject* obj, QEvent* ev)
void ExternalResourcesPage::addItem()
{
if (!m_controlsEnabled)
return;
auto list = GuiUtil::BrowseForFiles(
helpPage(), tr("Select %1", "Select whatever type of files the page contains. Example: 'Loader Mods'").arg(displayName()),
m_fileSelectionFilter.arg(displayName()), APPLICATION->settings()->get("CentralModsDir").toString(), this->parentWidget());
@ -198,9 +192,6 @@ void ExternalResourcesPage::addItem()
void ExternalResourcesPage::removeItem()
{
if (!m_controlsEnabled)
return;
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection());
int count = 0;
@ -249,18 +240,12 @@ void ExternalResourcesPage::removeItems(const QItemSelection& selection)
void ExternalResourcesPage::enableItem()
{
if (!m_controlsEnabled)
return;
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection());
m_model->setResourceEnabled(selection.indexes(), EnableAction::ENABLE);
}
void ExternalResourcesPage::disableItem()
{
if (!m_controlsEnabled)
return;
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection());
m_model->setResourceEnabled(selection.indexes(), EnableAction::DISABLE);
}

View File

@ -72,7 +72,5 @@ class ExternalResourcesPage : public QMainWindow, public BasePage {
QString m_fileSelectionFilter;
QString m_viewFilter;
bool m_controlsEnabled = true;
std::shared_ptr<Setting> m_wide_bar_setting = nullptr;
};

View File

@ -133,15 +133,13 @@ bool ModFolderPage::onSelectionChanged(const QModelIndex& current, const QModelI
return true;
}
void ModFolderPage::removeItems(const QItemSelection &selection)
void ModFolderPage::removeItems(const QItemSelection& selection)
{
m_model->deleteMods(selection.indexes());
}
void ModFolderPage::installMods()
{
if (!m_controlsEnabled)
return;
if (m_instance->typeName() != "Minecraft")
return; // this is a null instance or a legacy instance

View File

@ -67,8 +67,6 @@ bool ResourcePackPage::onSelectionChanged(const QModelIndex& current, const QMod
void ResourcePackPage::downloadRPs()
{
if (!m_controlsEnabled)
return;
if (m_instance->typeName() != "Minecraft")
return; // this is a null instance or a legacy instance

View File

@ -46,7 +46,6 @@
#include "ui/dialogs/ProgressDialog.h"
#include "ui/dialogs/ResourceDownloadDialog.h"
ShaderPackPage::ShaderPackPage(MinecraftInstance* instance, std::shared_ptr<ShaderPackFolderModel> model, QWidget* parent)
: ExternalResourcesPage(instance, model, parent)
{
@ -61,8 +60,6 @@ ShaderPackPage::ShaderPackPage(MinecraftInstance* instance, std::shared_ptr<Shad
void ShaderPackPage::downloadShaders()
{
if (!m_controlsEnabled)
return;
if (m_instance->typeName() != "Minecraft")
return; // this is a null instance or a legacy instance

View File

@ -69,8 +69,6 @@ bool TexturePackPage::onSelectionChanged(const QModelIndex& current, const QMode
void TexturePackPage::downloadTPs()
{
if (!m_controlsEnabled)
return;
if (m_instance->typeName() != "Minecraft")
return; // this is a null instance or a legacy instance