refactor: rename Modrinth classes to ModrinthMod

This commit is contained in:
Sefa Eyeoglu
2022-05-14 19:46:52 +02:00
parent 123ed5bd2e
commit c6b3eccbdf
7 changed files with 22 additions and 22 deletions

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ModrinthModel.h"
#include "ModrinthModModel.h"
#include "modplatform/modrinth/ModrinthPackIndex.h"

View File

@ -1,6 +1,6 @@
#pragma once
#include "ModrinthPage.h"
#include "ModrinthModPage.h"
namespace Modrinth {
@ -8,7 +8,7 @@ class ListModel : public ModPlatform::ListModel {
Q_OBJECT
public:
ListModel(ModrinthPage* parent) : ModPlatform::ListModel(parent){};
ListModel(ModrinthModPage* parent) : ModPlatform::ListModel(parent){};
~ListModel() override = default;
private:

View File

@ -33,14 +33,14 @@
* limitations under the License.
*/
#include "ModrinthPage.h"
#include "ModrinthModPage.h"
#include "modplatform/modrinth/ModrinthAPI.h"
#include "ui_ModPage.h"
#include "ModrinthModel.h"
#include "ModrinthModModel.h"
#include "ui/dialogs/ModDownloadDialog.h"
ModrinthPage::ModrinthPage(ModDownloadDialog* dialog, BaseInstance* instance)
ModrinthModPage::ModrinthModPage(ModDownloadDialog* dialog, BaseInstance* instance)
: ModPage(dialog, instance, new ModrinthAPI())
{
listModel = new Modrinth::ListModel(this);
@ -56,12 +56,12 @@ ModrinthPage::ModrinthPage(ModDownloadDialog* dialog, BaseInstance* instance)
// sometimes Qt just ignores virtual slots and doesn't work as intended it seems,
// so it's best not to connect them in the parent's constructor...
connect(ui->sortByBox, SIGNAL(currentIndexChanged(int)), this, SLOT(triggerSearch()));
connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &ModrinthPage::onSelectionChanged);
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &ModrinthPage::onVersionSelectionChanged);
connect(ui->modSelectionButton, &QPushButton::clicked, this, &ModrinthPage::onModSelected);
connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &ModrinthModPage::onSelectionChanged);
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &ModrinthModPage::onVersionSelectionChanged);
connect(ui->modSelectionButton, &QPushButton::clicked, this, &ModrinthModPage::onModSelected);
}
auto ModrinthPage::validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, ModAPI::ModLoaderType loader) const -> bool
auto ModrinthModPage::validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, ModAPI::ModLoaderType loader) const -> bool
{
auto loaderStrings = ModrinthAPI::getModLoaderStrings(loader);
@ -79,4 +79,4 @@ auto ModrinthPage::validateVersion(ModPlatform::IndexedVersion& ver, QString min
// I don't know why, but doing this on the parent class makes it so that
// other mod providers start loading before being selected, at least with
// my Qt, so we need to implement this in every derived class...
auto ModrinthPage::shouldDisplay() const -> bool { return true; }
auto ModrinthModPage::shouldDisplay() const -> bool { return true; }

View File

@ -40,12 +40,12 @@
#include "modplatform/modrinth/ModrinthAPI.h"
class ModrinthPage : public ModPage {
class ModrinthModPage : public ModPage {
Q_OBJECT
public:
explicit ModrinthPage(ModDownloadDialog* dialog, BaseInstance* instance);
~ModrinthPage() override = default;
explicit ModrinthModPage(ModDownloadDialog* dialog, BaseInstance* instance);
~ModrinthModPage() override = default;
inline auto displayName() const -> QString override { return "Modrinth"; }
inline auto icon() const -> QIcon override { return APPLICATION->getThemedIcon("modrinth"); }