NOISSUE rename ComponentList to PackProfile

It's not just components, so the naming needed cleaning up.
This commit is contained in:
Petr Mrázek
2020-06-27 12:02:31 +02:00
parent 4ca62916f5
commit a0ef20a264
29 changed files with 145 additions and 145 deletions

View File

@ -28,7 +28,7 @@
#include "minecraft/mod/ModFolderModel.h"
#include "minecraft/mod/Mod.h"
#include "minecraft/VersionFilterData.h"
#include "minecraft/ComponentList.h"
#include "minecraft/PackProfile.h"
#include <DesktopServices.h>
#include <QSortFilterProxyModel>
@ -244,7 +244,7 @@ bool CoreModFolderPage::shouldDisplay() const
auto inst = dynamic_cast<MinecraftInstance *>(m_inst);
if (!inst)
return true;
auto version = inst->getComponentList();
auto version = inst->getPackProfile();
if (!version)
return true;
if(!version->getComponent("net.minecraftforge"))

View File

@ -37,7 +37,7 @@
#include <QString>
#include <QUrl>
#include "minecraft/ComponentList.h"
#include "minecraft/PackProfile.h"
#include "minecraft/auth/MojangAccountList.h"
#include "minecraft/mod/Mod.h"
#include "icons/IconList.h"
@ -114,9 +114,9 @@ VersionPage::VersionPage(MinecraftInstance *inst, QWidget *parent)
ui->toolBar->insertSpacer(ui->actionReload);
m_profile = m_inst->getComponentList();
m_profile = m_inst->getPackProfile();
reloadComponentList();
reloadPackProfile();
auto proxy = new IconProxy(ui->packageView);
proxy->setSourceModel(m_profile.get());
@ -129,7 +129,7 @@ VersionPage::VersionPage(MinecraftInstance *inst, QWidget *parent)
auto smodel = ui->packageView->selectionModel();
connect(smodel, &QItemSelectionModel::currentChanged, this, &VersionPage::packageCurrent);
connect(m_profile.get(), &ComponentList::minecraftChanged, this, &VersionPage::updateVersionControls);
connect(m_profile.get(), &PackProfile::minecraftChanged, this, &VersionPage::updateVersionControls);
controlsEnabled = !m_inst->isRunning();
updateVersionControls();
preselect(0);
@ -232,7 +232,7 @@ void VersionPage::updateButtons(int row)
ui->actionAdd_to_Minecraft_jar->setEnabled(controlsEnabled);
}
bool VersionPage::reloadComponentList()
bool VersionPage::reloadPackProfile()
{
try
{
@ -255,7 +255,7 @@ bool VersionPage::reloadComponentList()
void VersionPage::on_actionReload_triggered()
{
reloadComponentList();
reloadPackProfile();
m_container->refreshContainer();
}
@ -270,7 +270,7 @@ void VersionPage::on_actionRemove_triggered()
}
}
updateButtons();
reloadComponentList();
reloadPackProfile();
m_container->refreshContainer();
}
@ -306,7 +306,7 @@ void VersionPage::on_actionMove_up_triggered()
{
try
{
m_profile->move(currentRow(), ComponentList::MoveUp);
m_profile->move(currentRow(), PackProfile::MoveUp);
}
catch (const Exception &e)
{
@ -319,7 +319,7 @@ void VersionPage::on_actionMove_down_triggered()
{
try
{
m_profile->move(currentRow(), ComponentList::MoveDown);
m_profile->move(currentRow(), PackProfile::MoveDown);
}
catch (const Exception &e)
{

View File

@ -18,7 +18,7 @@
#include <QMainWindow>
#include "minecraft/MinecraftInstance.h"
#include "minecraft/ComponentList.h"
#include "minecraft/PackProfile.h"
#include "pages/BasePage.h"
namespace Ui
@ -82,11 +82,11 @@ protected:
QMenu * createPopupMenu() override;
/// FIXME: this shouldn't be necessary!
bool reloadComponentList();
bool reloadPackProfile();
private:
Ui::VersionPage *ui;
std::shared_ptr<ComponentList> m_profile;
std::shared_ptr<PackProfile> m_profile;
MinecraftInstance *m_inst;
int currentIdx = 0;
bool controlsEnabled = false;