aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-01-24 18:12:02 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-01-24 18:12:02 +0100
commit7d5787025aa5cebf6778f71e79f248f10b8541c9 (patch)
treebb80eb6a4e313b19da00a9ad8d0e1248aaa50212
parent156bc8f27656c115bf1b023cd4ebc5f629df3887 (diff)
downloadPrismLauncher-7d5787025aa5cebf6778f71e79f248f10b8541c9.tar.gz
PrismLauncher-7d5787025aa5cebf6778f71e79f248f10b8541c9.tar.bz2
PrismLauncher-7d5787025aa5cebf6778f71e79f248f10b8541c9.zip
Change naming from Derp -> OneSix until the new instance type supports legacy
-rw-r--r--CMakeLists.txt38
-rw-r--r--gui/MainWindow.cpp4
-rw-r--r--gui/dialogs/OneSixModEditDialog.cpp (renamed from gui/dialogs/DerpModEditDialog.cpp)46
-rw-r--r--gui/dialogs/OneSixModEditDialog.h (renamed from gui/dialogs/DerpModEditDialog.h)16
-rw-r--r--gui/dialogs/OneSixModEditDialog.ui (renamed from gui/dialogs/DerpModEditDialog.ui)4
-rw-r--r--logic/BaseInstaller.cpp12
-rw-r--r--logic/BaseInstaller.h10
-rw-r--r--logic/BaseInstance.h2
-rw-r--r--logic/DerpVersion.cpp194
-rw-r--r--logic/DerpVersion.h115
-rw-r--r--logic/ForgeInstaller.cpp14
-rw-r--r--logic/ForgeInstaller.h6
-rw-r--r--logic/InstanceFactory.cpp32
-rw-r--r--logic/LegacyInstance.h2
-rw-r--r--logic/LiteLoaderInstaller.cpp14
-rw-r--r--logic/LiteLoaderInstaller.h4
-rw-r--r--logic/MinecraftVersion.h6
-rw-r--r--logic/NostalgiaInstance.cpp2
-rw-r--r--logic/NostalgiaInstance.h4
-rw-r--r--logic/OneSixFTBInstance.cpp (renamed from logic/DerpFTBInstance.cpp)38
-rw-r--r--logic/OneSixFTBInstance.h (renamed from logic/DerpFTBInstance.h)10
-rw-r--r--logic/OneSixInstance.cpp (renamed from logic/DerpInstance.cpp)86
-rw-r--r--logic/OneSixInstance.h (renamed from logic/DerpInstance.h)10
-rw-r--r--logic/OneSixInstance_p.h (renamed from logic/DerpInstance_p.h)6
-rw-r--r--logic/OneSixLibrary.cpp (renamed from logic/DerpLibrary.cpp)38
-rw-r--r--logic/OneSixLibrary.h (renamed from logic/DerpLibrary.h)4
-rw-r--r--logic/OneSixRule.cpp (renamed from logic/DerpRule.cpp)2
-rw-r--r--logic/OneSixRule.h (renamed from logic/DerpRule.h)10
-rw-r--r--logic/OneSixUpdate.cpp (renamed from logic/DerpUpdate.cpp)58
-rw-r--r--logic/OneSixUpdate.h (renamed from logic/DerpUpdate.h)4
-rw-r--r--logic/OneSixVersion.cpp292
-rw-r--r--logic/OneSixVersion.h45
-rw-r--r--logic/OneSixVersionBuilder.cpp (renamed from logic/DerpVersionBuilder.cpp)46
-rw-r--r--logic/OneSixVersionBuilder.h (renamed from logic/DerpVersionBuilder.h)16
-rw-r--r--logic/lists/MinecraftVersionList.cpp6
35 files changed, 375 insertions, 821 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5339a30..6218ee7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -297,8 +297,8 @@ gui/dialogs/IconPickerDialog.h
gui/dialogs/IconPickerDialog.cpp
gui/dialogs/LegacyModEditDialog.h
gui/dialogs/LegacyModEditDialog.cpp
-gui/dialogs/DerpModEditDialog.h
-gui/dialogs/DerpModEditDialog.cpp
+gui/dialogs/OneSixModEditDialog.h
+gui/dialogs/OneSixModEditDialog.cpp
gui/dialogs/ModEditDialogCommon.h
gui/dialogs/ModEditDialogCommon.cpp
gui/dialogs/EditNotesDialog.h
@@ -405,15 +405,15 @@ logic/LegacyUpdate.cpp
logic/LegacyForge.h
logic/LegacyForge.cpp
-# Derp instances
-logic/DerpUpdate.h
-logic/DerpUpdate.cpp
-logic/DerpVersion.h
-logic/DerpVersion.cpp
-logic/DerpLibrary.h
-logic/DerpLibrary.cpp
-logic/DerpRule.h
-logic/DerpRule.cpp
+# OneSix instances
+logic/OneSixUpdate.h
+logic/OneSixUpdate.cpp
+logic/OneSixVersion.h
+logic/OneSixVersion.cpp
+logic/OneSixLibrary.h
+logic/OneSixLibrary.cpp
+logic/OneSixRule.h
+logic/OneSixRule.cpp
logic/OpSys.h
logic/OpSys.cpp
logic/BaseInstaller.h
@@ -422,19 +422,19 @@ logic/ForgeInstaller.h
logic/ForgeInstaller.cpp
logic/LiteLoaderInstaller.h
logic/LiteLoaderInstaller.cpp
-logic/DerpInstance.h
-logic/DerpInstance.cpp
-logic/DerpInstance_p.h
-logic/DerpVersionBuilder.h
-logic/DerpVersionBuilder.cpp
+logic/OneSixInstance.h
+logic/OneSixInstance.cpp
+logic/OneSixInstance_p.h
+logic/OneSixVersionBuilder.h
+logic/OneSixVersionBuilder.cpp
# Nostalgia
logic/NostalgiaInstance.h
logic/NostalgiaInstance.cpp
# FTB
-logic/DerpFTBInstance.h
-logic/DerpFTBInstance.cpp
+logic/OneSixFTBInstance.h
+logic/OneSixFTBInstance.cpp
logic/LegacyFTBInstance.h
logic/LegacyFTBInstance.cpp
@@ -510,7 +510,7 @@ gui/dialogs/InstanceSettings.ui
gui/dialogs/ProgressDialog.ui
gui/dialogs/IconPickerDialog.ui
gui/dialogs/LegacyModEditDialog.ui
-gui/dialogs/DerpModEditDialog.ui
+gui/dialogs/OneSixModEditDialog.ui
gui/dialogs/EditNotesDialog.ui
gui/dialogs/AccountListDialog.ui
gui/dialogs/AccountSelectDialog.ui
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp
index ba394a94..ee9c3fad 100644
--- a/gui/MainWindow.cpp
+++ b/gui/MainWindow.cpp
@@ -84,7 +84,7 @@
#include "logic/BaseInstance.h"
#include "logic/InstanceFactory.h"
#include "logic/MinecraftProcess.h"
-#include "logic/DerpUpdate.h"
+#include "logic/OneSixUpdate.h"
#include "logic/JavaUtils.h"
#include "logic/NagUtils.h"
#include "logic/SkinUtils.h"
@@ -1257,7 +1257,7 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
VersionSelectDialog vselect(m_selectedInstance->versionList().get(),
tr("Change Minecraft version"), this);
- vselect.setFilter(1, "Derp");
+ vselect.setFilter(1, "OneSix");
if(!vselect.exec() || !vselect.selectedVersion())
return;
diff --git a/gui/dialogs/DerpModEditDialog.cpp b/gui/dialogs/OneSixModEditDialog.cpp
index 216aa59d..625a7c91 100644
--- a/gui/dialogs/DerpModEditDialog.cpp
+++ b/gui/dialogs/OneSixModEditDialog.cpp
@@ -23,9 +23,9 @@
#include <QKeyEvent>
#include <QDesktopServices>
-#include "DerpModEditDialog.h"
+#include "OneSixModEditDialog.h"
#include "ModEditDialogCommon.h"
-#include "ui_DerpModEditDialog.h"
+#include "ui_OneSixModEditDialog.h"
#include "gui/Platform.h"
#include "gui/dialogs/CustomMessageBox.h"
@@ -34,14 +34,14 @@
#include "gui/dialogs/ProgressDialog.h"
#include "logic/ModList.h"
-#include "logic/DerpVersion.h"
+#include "logic/OneSixVersion.h"
#include "logic/EnabledItemFilter.h"
#include "logic/lists/ForgeVersionList.h"
#include "logic/ForgeInstaller.h"
#include "logic/LiteLoaderInstaller.h"
-DerpModEditDialog::DerpModEditDialog(DerpInstance *inst, QWidget *parent)
- : QDialog(parent), ui(new Ui::DerpModEditDialog), m_inst(inst)
+OneSixModEditDialog::OneSixModEditDialog(OneSixInstance *inst, QWidget *parent)
+ : QDialog(parent), ui(new Ui::OneSixModEditDialog), m_inst(inst)
{
MultiMCPlatform::fixWM_CLASS(this);
ui->setupUi(this);
@@ -81,17 +81,17 @@ DerpModEditDialog::DerpModEditDialog(DerpInstance *inst, QWidget *parent)
m_resourcepacks->startWatching();
}
- connect(m_inst, &DerpInstance::versionReloaded, this, &DerpModEditDialog::updateVersionControls);
+ connect(m_inst, &OneSixInstance::versionReloaded, this, &OneSixModEditDialog::updateVersionControls);
}
-DerpModEditDialog::~DerpModEditDialog()
+OneSixModEditDialog::~OneSixModEditDialog()
{
m_mods->stopWatching();
m_resourcepacks->stopWatching();
delete ui;
}
-void DerpModEditDialog::updateVersionControls()
+void OneSixModEditDialog::updateVersionControls()
{
bool customVersion = m_inst->versionIsCustom();
ui->forgeBtn->setEnabled(true);
@@ -100,7 +100,7 @@ void DerpModEditDialog::updateVersionControls()
ui->mainClassEdit->setText(m_version->mainClass);
}
-void DerpModEditDialog::disableVersionControls()
+void OneSixModEditDialog::disableVersionControls()
{
ui->forgeBtn->setEnabled(false);
ui->liteloaderBtn->setEnabled(false);
@@ -108,7 +108,7 @@ void DerpModEditDialog::disableVersionControls()
ui->mainClassEdit->setText("");
}
-void DerpModEditDialog::on_customEditorBtn_clicked()
+void OneSixModEditDialog::on_customEditorBtn_clicked()
{
if (QDir(m_inst->instanceRoot()).exists("custom.json"))
{
@@ -119,7 +119,7 @@ void DerpModEditDialog::on_customEditorBtn_clicked()
}
}
-void DerpModEditDialog::on_forgeBtn_clicked()
+void OneSixModEditDialog::on_forgeBtn_clicked()
{
VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this);
vselect.setFilter(1, m_inst->currentVersionId());
@@ -165,7 +165,7 @@ void DerpModEditDialog::on_forgeBtn_clicked()
m_inst->reloadFullVersion(this);
}
-void DerpModEditDialog::on_liteloaderBtn_clicked()
+void OneSixModEditDialog::on_liteloaderBtn_clicked()
{
LiteLoaderInstaller liteloader;
if (!liteloader.canApply(m_inst))
@@ -188,7 +188,7 @@ void DerpModEditDialog::on_liteloaderBtn_clicked()
}
}
-bool DerpModEditDialog::loaderListFilter(QKeyEvent *keyEvent)
+bool OneSixModEditDialog::loaderListFilter(QKeyEvent *keyEvent)
{
switch (keyEvent->key())
{
@@ -204,7 +204,7 @@ bool DerpModEditDialog::loaderListFilter(QKeyEvent *keyEvent)
return QDialog::eventFilter(ui->loaderModTreeView, keyEvent);
}
-bool DerpModEditDialog::resourcePackListFilter(QKeyEvent *keyEvent)
+bool OneSixModEditDialog::resourcePackListFilter(QKeyEvent *keyEvent)
{
switch (keyEvent->key())
{
@@ -220,7 +220,7 @@ bool DerpModEditDialog::resourcePackListFilter(QKeyEvent *keyEvent)
return QDialog::eventFilter(ui->resPackTreeView, keyEvent);
}
-bool DerpModEditDialog::eventFilter(QObject *obj, QEvent *ev)
+bool OneSixModEditDialog::eventFilter(QObject *obj, QEvent *ev)
{
if (ev->type() != QEvent::KeyPress)
{
@@ -234,12 +234,12 @@ bool DerpModEditDialog::eventFilter(QObject *obj, QEvent *ev)
return QDialog::eventFilter(obj, ev);
}
-void DerpModEditDialog::on_buttonBox_rejected()
+void OneSixModEditDialog::on_buttonBox_rejected()
{
close();
}
-void DerpModEditDialog::on_addModBtn_clicked()
+void OneSixModEditDialog::on_addModBtn_clicked()
{
QStringList fileNames = QFileDialog::getOpenFileNames(
this, QApplication::translate("LegacyModEditDialog", "Select Loader Mods"));
@@ -250,7 +250,7 @@ void DerpModEditDialog::on_addModBtn_clicked()
m_mods->startWatching();
}
}
-void DerpModEditDialog::on_rmModBtn_clicked()
+void OneSixModEditDialog::on_rmModBtn_clicked()
{
int first, last;
auto list = ui->loaderModTreeView->selectionModel()->selectedRows();
@@ -261,12 +261,12 @@ void DerpModEditDialog::on_rmModBtn_clicked()
m_mods->deleteMods(first, last);
m_mods->startWatching();
}
-void DerpModEditDialog::on_viewModBtn_clicked()
+void OneSixModEditDialog::on_viewModBtn_clicked()
{
openDirInDefaultProgram(m_inst->loaderModsDir(), true);
}
-void DerpModEditDialog::on_addResPackBtn_clicked()
+void OneSixModEditDialog::on_addResPackBtn_clicked()
{
QStringList fileNames = QFileDialog::getOpenFileNames(
this, QApplication::translate("LegacyModEditDialog", "Select Resource Packs"));
@@ -277,7 +277,7 @@ void DerpModEditDialog::on_addResPackBtn_clicked()
m_resourcepacks->startWatching();
}
}
-void DerpModEditDialog::on_rmResPackBtn_clicked()
+void OneSixModEditDialog::on_rmResPackBtn_clicked()
{
int first, last;
auto list = ui->resPackTreeView->selectionModel()->selectedRows();
@@ -288,12 +288,12 @@ void DerpModEditDialog::on_rmResPackBtn_clicked()
m_resourcepacks->deleteMods(first, last);
m_resourcepacks->startWatching();
}
-void DerpModEditDialog::on_viewResPackBtn_clicked()
+void OneSixModEditDialog::on_viewResPackBtn_clicked()
{
openDirInDefaultProgram(m_inst->resourcePacksDir(), true);
}
-void DerpModEditDialog::loaderCurrent(QModelIndex current, QModelIndex previous)
+void OneSixModEditDialog::loaderCurrent(QModelIndex current, QModelIndex previous)
{
if (!current.isValid())
{
diff --git a/gui/dialogs/DerpModEditDialog.h b/gui/dialogs/OneSixModEditDialog.h
index e9e61c65..161604c9 100644
--- a/gui/dialogs/DerpModEditDialog.h
+++ b/gui/dialogs/OneSixModEditDialog.h
@@ -16,21 +16,21 @@
#pragma once
#include <QDialog>
-#include <logic/DerpInstance.h>
+#include <logic/OneSixInstance.h>
class EnabledItemFilter;
namespace Ui
{
-class DerpModEditDialog;
+class OneSixModEditDialog;
}
-class DerpModEditDialog : public QDialog
+class OneSixModEditDialog : public QDialog
{
Q_OBJECT
public:
- explicit DerpModEditDialog(DerpInstance *inst, QWidget *parent = 0);
- virtual ~DerpModEditDialog();
+ explicit OneSixModEditDialog(OneSixInstance *inst, QWidget *parent = 0);
+ virtual ~OneSixModEditDialog();
private
slots:
@@ -55,12 +55,12 @@ protected:
bool resourcePackListFilter(QKeyEvent *ev);
private:
- Ui::DerpModEditDialog *ui;
- std::shared_ptr<DerpVersion> m_version;
+ Ui::OneSixModEditDialog *ui;
+ std::shared_ptr<OneSixVersion> m_version;
std::shared_ptr<ModList> m_mods;
std::shared_ptr<ModList> m_resourcepacks;
EnabledItemFilter *main_model;
- DerpInstance *m_inst;
+ OneSixInstance *m_inst;
public
slots:
void loaderCurrent(QModelIndex current, QModelIndex previous);
diff --git a/gui/dialogs/DerpModEditDialog.ui b/gui/dialogs/OneSixModEditDialog.ui
index 7aaf1564..d57d0f85 100644
--- a/gui/dialogs/DerpModEditDialog.ui
+++ b/gui/dialogs/OneSixModEditDialog.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>DerpModEditDialog</class>
- <widget class="QDialog" name="DerpModEditDialog">
+ <class>OneSixModEditDialog</class>
+ <widget class="QDialog" name="OneSixModEditDialog">
<property name="geometry">
<rect>
<x>0</x>
diff --git a/logic/BaseInstaller.cpp b/logic/BaseInstaller.cpp
index 74a8e909..92aa0c92 100644
--- a/logic/BaseInstaller.cpp
+++ b/logic/BaseInstaller.cpp
@@ -17,9 +17,9 @@
#include <QFile>
-#include "DerpVersion.h"
-#include "DerpLibrary.h"
-#include "DerpInstance.h"
+#include "OneSixVersion.h"
+#include "OneSixLibrary.h"
+#include "OneSixInstance.h"
#include "cmdutils.h"
@@ -28,12 +28,12 @@ BaseInstaller::BaseInstaller()
}
-bool BaseInstaller::isApplied(DerpInstance *on)
+bool BaseInstaller::isApplied(OneSixInstance *on)
{
return QFile::exists(filename(on->instanceRoot()));
}
-bool BaseInstaller::add(DerpInstance *to)
+bool BaseInstaller::add(OneSixInstance *to)
{
if (!patchesDir(to->instanceRoot()).exists())
{
@@ -51,7 +51,7 @@ bool BaseInstaller::add(DerpInstance *to)
return true;
}
-bool BaseInstaller::remove(DerpInstance *from)
+bool BaseInstaller::remove(OneSixInstance *from)
{
return QFile::remove(filename(from->instanceRoot()));
}
diff --git a/logic/BaseInstaller.h b/logic/BaseInstaller.h
index 08f78bfc..df7eab89 100644
--- a/logic/BaseInstaller.h
+++ b/logic/BaseInstaller.h
@@ -17,7 +17,7 @@
#include <memory>
-class DerpInstance;
+class OneSixInstance;
class QDir;
class QString;
@@ -26,11 +26,11 @@ class BaseInstaller
public:
BaseInstaller();
- virtual bool canApply(DerpInstance *instance) const { return true; }
- bool isApplied(DerpInstance *on);
+ virtual bool canApply(OneSixInstance *instance) const { return true; }
+ bool isApplied(OneSixInstance *on);
- virtual bool add(DerpInstance *to);
- virtual bool remove(DerpInstance *from);
+ virtual bool add(OneSixInstance *to);
+ virtual bool remove(OneSixInstance *from);
protected:
virtual QString id() const = 0;
diff --git a/logic/BaseInstance.h b/logic/BaseInstance.h
index 79640c84..a861e9b2 100644
--- a/logic/BaseInstance.h
+++ b/logic/BaseInstance.h
@@ -27,7 +27,7 @@
class QDialog;
class Task;
class MinecraftProcess;
-class DerpUpdate;
+class OneSixUpdate;
class InstanceList;
class BaseInstancePrivate;
diff --git a/logic/DerpVersion.cpp b/logic/DerpVersion.cpp
deleted file mode 100644
index f4a8dd97..00000000
--- a/logic/DerpVersion.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Copyright 2013 MultiMC Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "DerpVersion.h"
-
-#include <QDebug>
-
-#include "DerpVersionBuilder.h"
-
-DerpVersion::DerpVersion(DerpInstance *instance, QObject *parent)
- : QAbstractListModel(parent), m_instance(instance)
-{
- clear();
-}
-
-bool DerpVersion::reload(QWidget *widgetParent)
-{
- return DerpVersionBuilder::build(this, m_instance, widgetParent);
-}
-
-void DerpVersion::clear()
-{
- id.clear();
- time.clear();
- releaseTime.clear();
- type.clear();
- assets.clear();
- processArguments.clear();
- minecraftArguments.clear();
- minimumLauncherVersion = 0xDEADBEAF;
- mainClass.clear();
- libraries.clear();
-}
-
-void DerpVersion::dump() const
-{
- qDebug().nospace() << "DerpVersion("
- << "\n\tid=" << id
- << "\n\ttime=" << time
- << "\n\treleaseTime=" << releaseTime
- << "\n\ttype=" << type
- << "\n\tassets=" << assets
- << "\n\tprocessArguments=" << processArguments
- << "\n\tminecraftArguments=" << minecraftArguments
- << "\n\tminimumLauncherVersion=" << minimumLauncherVersion
- << "\n\tmainClass=" << mainClass
- << "\n\tlibraries=";
- for (auto lib : libraries)
- {
- qDebug().nospace() << "\n\t\t" << lib.get();
- }
- qDebug().nospace() << "\n)";
-}
-
-QList<std::shared_ptr<DerpLibrary> > DerpVersion::getActiveNormalLibs()
-{
- QList<std::shared_ptr<DerpLibrary> > output;
- for (auto lib : libraries)
- {
- if (lib->isActive() && !lib->isNative())
- {
- output.append(lib);
- }
- }
- return output;
-}
-
-QList<std::shared_ptr<DerpLibrary> > DerpVersion::getActiveNativeLibs()
-{
- QList<std::shared_ptr<DerpLibrary> > output;
- for (auto lib : libraries)
- {
- if (lib->isActive() && lib->isNative())
- {
- output.append(lib);
- }
- }
- return output;
-}
-
-std::shared_ptr<DerpVersion> DerpVersion::fromJson(const QJsonObject &obj)
-{
- std::shared_ptr<DerpVersion> version(new DerpVersion(0));
- if (DerpVersionBuilder::read(version.get(), obj))
- {
- return version;
- }
- return 0;
-}
-
-QVariant DerpVersion::data(const QModelIndex &index, int role) const
-{
- if (!index.isValid())
- return QVariant();
-
- int row = index.row();
- int column = index.column();
-
- if (row < 0 || row >= libraries.size())
- return QVariant();
-
- if (role == Qt::DisplayRole)
- {
- switch (column)
- {
- case 0:
- return libraries[row]->name();
- case 1:
- return libraries[row]->type();
- case 2:
- return libraries[row]->version();
- default:
- return QVariant();
- }
- }
- return QVariant();
-}
-
-Qt::ItemFlags DerpVersion::flags(const QModelIndex &index) const
-{
- if (!index.isValid())
- return Qt::NoItemFlags;
- int row = index.row();
- if (libraries[row]->isActive())
- {
- return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemNeverHasChildren;
- }
- else
- {
- return Qt::ItemNeverHasChildren;
- }
- // return QAbstractListModel::flags(index);
-}
-
-QVariant DerpVersion::headerData(int section, Qt::Orientation orientation, int role) const
-{
- if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
- return QVariant();
- switch (section)
- {
- case 0:
- return QString("Name");
- case 1:
- return QString("Type");
- case 2:
- return QString("Version");
- default:
- return QString();
- }
-}
-
-int DerpVersion::rowCount(const QModelIndex &parent) const
-{
- return libraries.size();
-}
-
-int DerpVersion::columnCount(const QModelIndex &parent) const
-{
- return 3;
-}
-
-QDebug operator<<(QDebug &dbg, const DerpVersion *version)
-{
- version->dump();
- return dbg.maybeSpace();
-}
-QDebug operator<<(QDebug &dbg, const DerpLibrary *library)
-{
- dbg.nospace() << "DerpLibrary("
- << "\n\t\t\trawName=" << library->rawName()
- << "\n\t\t\tname=" << library->name()
- << "\n\t\t\tversion=" << library->version()
- << "\n\t\t\ttype=" << library->type()
- << "\n\t\t\tisActive=" << library->isActive()
- << "\n\t\t\tisNative=" << library->isNative()
- << "\n\t\t\tdownloadUrl=" << library->downloadUrl()
- << "\n\t\t\tstoragePath=" << library->storagePath()
- << "\n\t\t\tabsolutePath=" << library->absoluteUrl()
- << "\n\t\t\thint=" << library->hint();
- dbg.nospace() << "\n\t\t)";
- return dbg.maybeSpace();
-}
diff --git a/logic/DerpVersion.h b/logic/DerpVersion.h
deleted file mode 100644
index 4481d146..00000000
--- a/logic/DerpVersion.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Copyright 2013 MultiMC Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include <QAbstractListModel>
-
-#include <QString>
-#include <QList>
-#include <memory>
-
-#include "DerpLibrary.h"
-
-class DerpInstance;
-
-class DerpVersion : public QAbstractListModel
-{
- Q_OBJECT
-public:
- explicit DerpVersion(DerpInstance *instance, QObject *parent = 0);
-
- virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
- virtual QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const;
- virtual int columnCount(const QModelIndex &parent) const;
- virtual Qt::ItemFlags flags(const QModelIndex &index) const;
-
- bool reload(QWidget *widgetParent);
- void clear();
-
- void dump() const;
-
-public:
- QList<std::shared_ptr<DerpLibrary>> getActiveNormalLibs();
- QList<std::shared_ptr<DerpLibrary>> getActiveNativeLibs();
-
- static std::shared_ptr<DerpVersion> fromJson(const QJsonObject &obj);
-
- // data members
-public:
- /// the ID - determines which jar to use! ACTUALLY IMPORTANT!
- QString id;
- /// Last updated time - as a string
- QString time;
- /// Release time - as a string
- QString releaseTime;
- /// Release type - "release" or "snapshot"
- QString type;
- /// Assets type - "legacy" or a version ID
- QString assets;
- /**
- * DEPRECATED: Old versions of the new vanilla launcher used this
- * ex: "username_session_version"
- */
- QString processArguments;
- /**
- * arguments that should be used for launching minecraft
- *
- * ex: "--username ${auth_player_name} --session ${auth_session}
- * --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets}"
- */
- QString minecraftArguments;
- /**
- * the minimum launcher version required by this version ... current is 4 (at point of
- * writing)
- */
- int minimumLauncherVersion = 0xDEADBEEF;
- /**
- * The main class to load first
- */
- QString mainClass;
-
- /// the list of libs - both active and inactive, native and java
- QList<std::shared_ptr<DerpLibrary>> libraries;
-
- /*
- FIXME: add support for those rules here? Looks like a pile of quick hacks to me though.
-
- "rules": [
- {
- "action": "allow"
- },
- {
- "action": "disallow",
- "os": {
- "name": "osx",
- "version": "^10\\.5\\.\\d$"
- }
- }
- ],
- "incompatibilityReason": "There is a bug in LWJGL which makes it incompatible with OSX
- 10.5.8. Please go to New Profile and use 1.5.2 for now. Sorry!"
- }
- */
- // QList<Rule> rules;
-
-private:
- DerpInstance *m_instance;
-};
-
-QDebug operator<<(QDebug &dbg, const DerpVersion *version);
-QDebug operator<<(QDebug &dbg, const DerpLibrary *library);
diff --git a/logic/ForgeInstaller.cpp b/logic/ForgeInstaller.cpp
index 35663ddd..863c3dfd 100644
--- a/logic/ForgeInstaller.cpp
+++ b/logic/ForgeInstaller.cpp
@@ -14,15 +14,15 @@
*/
#include "ForgeInstaller.h"
-#include "DerpVersion.h"
-#include "DerpLibrary.h"
+#include "OneSixVersion.h"
+#include "OneSixLibrary.h"
#include "net/HttpMetaCache.h"
#include <quazip.h>
#include <quazipfile.h>
#include <pathutils.h>
#include <QStringList>
#include "MultiMC.h"
-#include "DerpInstance.h"
+#include "OneSixInstance.h"
#include <QJsonDocument>
#include <QJsonArray>
@@ -31,7 +31,7 @@
ForgeInstaller::ForgeInstaller(QString filename, QString universal_url)
{
- std::shared_ptr<DerpVersion> newVersion;
+ std::shared_ptr<OneSixVersion> newVersion;
m_universal_url = universal_url;
QuaZip zip(filename);
@@ -64,7 +64,7 @@ ForgeInstaller::ForgeInstaller(QString filename, QString universal_url)
// read the forge version info
{
- newVersion = DerpVersion::fromJson(versionInfoVal.toObject());
+ newVersion = OneSixVersion::fromJson(versionInfoVal.toObject());
if (!newVersion)
return;
}
@@ -74,7 +74,7 @@ ForgeInstaller::ForgeInstaller(QString filename, QString universal_url)
internalPath = installObj.value("filePath").toString();
// where do we put the library? decode the mojang path
- DerpLibrary lib(libraryName);
+ OneSixLibrary lib(libraryName);
lib.finalize();
auto cacheentry = MMC->metacache()->resolveEntry("libraries", lib.storagePath());
@@ -109,7 +109,7 @@ ForgeInstaller::ForgeInstaller(QString filename, QString universal_url)
realVersionId = m_forge_version->id = installObj.value("minecraft").toString();
}
-bool ForgeInstaller::add(DerpInstance *to)
+bool ForgeInstaller::add(OneSixInstance *to)
{
if (!BaseInstaller::add(to))
{
diff --git a/logic/ForgeInstaller.h b/logic/ForgeInstaller.h
index 6490b5bf..eb8ecd79 100644
--- a/logic/ForgeInstaller.h
+++ b/logic/ForgeInstaller.h
@@ -20,20 +20,20 @@
#include <QString>
#include <memory>
-class DerpVersion;
+class OneSixVersion;
class ForgeInstaller : public BaseInstaller