diff options
Diffstat (limited to 'logic')
30 files changed, 83 insertions, 70 deletions
diff --git a/logic/BaseInstance_p.h b/logic/BaseInstance_p.h index edaee7d7..999ff545 100644 --- a/logic/BaseInstance_p.h +++ b/logic/BaseInstance_p.h @@ -24,8 +24,10 @@ #define I_D(Class) Class##Private *const d = (Class##Private * const)inst_d.get() -struct BaseInstancePrivate +class BaseInstancePrivate { +public: + virtual ~BaseInstancePrivate(){}; QString m_rootDir; QString m_group; std::shared_ptr<SettingsObject> m_settings; diff --git a/logic/InstanceFactory.cpp b/logic/InstanceFactory.cpp index d6e06133..4f65221c 100644 --- a/logic/InstanceFactory.cpp +++ b/logic/InstanceFactory.cpp @@ -41,7 +41,7 @@ InstanceFactory::InstanceFactory() : QObject(NULL) { } -InstanceFactory::InstLoadError InstanceFactory::loadInstance(BaseInstance *&inst, +InstanceFactory::InstLoadError InstanceFactory::loadInstance(InstancePtr &inst, const QString &instDir) { auto m_settings = new INISettingsObject(PathCombine(instDir, "instance.cfg")); @@ -53,23 +53,23 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(BaseInstance *&inst // FIXME: replace with a map lookup, where instance classes register their types if (inst_type == "OneSix") { - inst = new OneSixInstance(instDir, m_settings, this); + inst.reset(new OneSixInstance(instDir, m_settings, this)); } else if (inst_type == "Legacy") { - inst = new LegacyInstance(instDir, m_settings, this); + inst.reset(new LegacyInstance(instDir, m_settings, this)); } else if (inst_type == "Nostalgia") { - inst = new NostalgiaInstance(instDir, m_settings, this); + inst.reset(new NostalgiaInstance(instDir, m_settings, this)); } else if (inst_type == "LegacyFTB") { - inst = new LegacyFTBInstance(instDir, m_settings, this); + inst.reset(new LegacyFTBInstance(instDir, m_settings, this)); } else if (inst_type == "OneSixFTB") { - inst = new OneSixFTBInstance(instDir, m_settings, this); + inst.reset(new OneSixFTBInstance(instDir, m_settings, this)); } else { @@ -79,10 +79,8 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(BaseInstance *&inst return NoLoadError; } -InstanceFactory::InstCreateError InstanceFactory::createInstance(BaseInstance *&inst, - BaseVersionPtr version, - const QString &instDir, - const InstType type) +InstanceFactory::InstCreateError InstanceFactory::createInstance(InstancePtr &inst, BaseVersionPtr version, + const QString &instDir, const InstanceFactory::InstType type) { QDir rootDir(instDir); @@ -105,19 +103,19 @@ InstanceFactory::InstCreateError InstanceFactory::createInstance(BaseInstance *& case MinecraftVersion::Legacy: // TODO new instance type m_settings->set("InstanceType", "Legacy"); - inst = new LegacyInstance(instDir, m_settings, this); + inst.reset(new LegacyInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); break; case MinecraftVersion::OneSix: m_settings->set("InstanceType", "OneSix"); - inst = new OneSixInstance(instDir, m_settings, this); + inst.reset(new OneSixInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); break; case MinecraftVersion::Nostalgia: m_settings->set("InstanceType", "Nostalgia"); - inst = new NostalgiaInstance(instDir, m_settings, this); + inst.reset(new NostalgiaInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); break; @@ -134,13 +132,13 @@ InstanceFactory::InstCreateError InstanceFactory::createInstance(BaseInstance *& { case MinecraftVersion::Legacy: m_settings->set("InstanceType", "LegacyFTB"); - inst = new LegacyFTBInstance(instDir, m_settings, this); + inst.reset(new LegacyFTBInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); break; case MinecraftVersion::OneSix: m_settings->set("InstanceType", "OneSixFTB"); - inst = new OneSixFTBInstance(instDir, m_settings, this); + inst.reset(new OneSixFTBInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); break; @@ -163,8 +161,8 @@ InstanceFactory::InstCreateError InstanceFactory::createInstance(BaseInstance *& return InstanceFactory::NoCreateError; } -InstanceFactory::InstCreateError InstanceFactory::copyInstance(BaseInstance *&newInstance, - BaseInstance *&oldInstance, +InstanceFactory::InstCreateError InstanceFactory::copyInstance(InstancePtr &newInstance, + InstancePtr &oldInstance, const QString &instDir) { QDir rootDir(instDir); @@ -175,14 +173,6 @@ InstanceFactory::InstCreateError InstanceFactory::copyInstance(BaseInstance *&ne rootDir.removeRecursively(); return InstanceFactory::CantCreateDir; } - auto m_settings = new INISettingsObject(PathCombine(instDir, "instance.cfg")); - m_settings->registerSetting("InstanceType", "Legacy"); - QString inst_type = m_settings->get("InstanceType").toString(); - - if(inst_type == "OneSixFTB") - m_settings->set("InstanceType", "OneSix"); - if(inst_type == "LegacyFTB") - m_settings->set("InstanceType", "Legacy"); oldInstance->copy(instDir); @@ -198,6 +188,7 @@ InstanceFactory::InstCreateError InstanceFactory::copyInstance(BaseInstance *&ne default: case UnknownLoadError: rootDir.removeRecursively(); - return UnknownCreateError; + return UnknownCreateError; } + return UnknownCreateError; } diff --git a/logic/InstanceFactory.h b/logic/InstanceFactory.h index 5ff4c7ec..96e2375e 100644 --- a/logic/InstanceFactory.h +++ b/logic/InstanceFactory.h @@ -20,6 +20,7 @@ #include <QList> #include "BaseVersion.h" +#include "BaseInstance.h" class BaseVersion; class BaseInstance; @@ -72,7 +73,7 @@ public: * - InstExists if the given instance directory is already an instance. * - CantCreateDir if the given instance directory cannot be created. */ - InstCreateError createInstance(BaseInstance *&inst, BaseVersionPtr version, + InstCreateError createInstance(InstancePtr &inst, BaseVersionPtr version, const QString &instDir, const InstType type = NormalInst); /*! @@ -85,7 +86,7 @@ public: * - InstExists if the given instance directory is already an instance. * - CantCreateDir if the given instance directory cannot be created. */ - InstCreateError copyInstance(BaseInstance *&newInstance, BaseInstance *&oldInstance, + InstCreateError copyInstance(InstancePtr &newInstance, InstancePtr &oldInstance, const QString &instDir); /*! @@ -96,7 +97,7 @@ public: * \return An InstLoadError error code. * - NotAnInstance if the given instance directory isn't a valid instance. */ - InstLoadError loadInstance(BaseInstance *&inst, const QString &instDir); + InstLoadError loadInstance(InstancePtr &inst, const QString &instDir); private: InstanceFactory(); diff --git a/logic/LegacyInstance_p.h b/logic/LegacyInstance_p.h index ed97ccd3..061847de 100644 --- a/logic/LegacyInstance_p.h +++ b/logic/LegacyInstance_p.h @@ -21,8 +21,10 @@ #include "BaseInstance_p.h" #include "ModList.h" -struct LegacyInstancePrivate : public BaseInstancePrivate +class LegacyInstancePrivate : public BaseInstancePrivate { +public: + virtual ~LegacyInstancePrivate() {}; std::shared_ptr<ModList> jar_mod_list; std::shared_ptr<ModList> core_mod_list; std::shared_ptr<ModList> loader_mod_list; diff --git a/logic/NostalgiaInstance.h b/logic/NostalgiaInstance.h index a26f7f0a..f95531d2 100644 --- a/logic/NostalgiaInstance.h +++ b/logic/NostalgiaInstance.h @@ -23,6 +23,7 @@ class NostalgiaInstance : public OneSixInstance public: explicit NostalgiaInstance(const QString &rootDir, SettingsObject *settings, QObject *parent = 0); + virtual ~NostalgiaInstance() {}; virtual QString getStatusbarDescription(); virtual bool menuActionEnabled(QString action_name) const; }; diff --git a/logic/OneSixFTBInstance.h b/logic/OneSixFTBInstance.h index c4f845e0..440dc9f1 100644 --- a/logic/OneSixFTBInstance.h +++ b/logic/OneSixFTBInstance.h @@ -10,6 +10,7 @@ class OneSixFTBInstance : public OneSixInstance public: explicit OneSixFTBInstance(const QString &rootDir, SettingsObject *settings, QObject *parent = 0); + virtual ~OneSixFTBInstance(){}; void init() override; void copy(const QDir &newDir) override; diff --git a/logic/OneSixInstance.h b/logic/OneSixInstance.h index 7a049922..677459ae 100644 --- a/logic/OneSixInstance.h +++ b/logic/OneSixInstance.h @@ -26,6 +26,7 @@ class OneSixInstance : public BaseInstance public: explicit OneSixInstance(const QString &rootDir, SettingsObject *settings, QObject *parent = 0); + virtual ~OneSixInstance(){}; virtual void init() override; diff --git a/logic/OneSixInstance_p.h b/logic/OneSixInstance_p.h index 2dffa62c..c70de07c 100644 --- a/logic/OneSixInstance_p.h +++ b/logic/OneSixInstance_p.h @@ -19,8 +19,10 @@ #include "VersionFinal.h" #include "ModList.h" -struct OneSixInstancePrivate : public BaseInstancePrivate +class OneSixInstancePrivate : public BaseInstancePrivate { +public: + virtual ~OneSixInstancePrivate() {}; std::shared_ptr<VersionFinal> version; std::shared_ptr<VersionFinal> vanillaVersion; std::shared_ptr<ModList> loader_mod_list; diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp index 34e6d87b..1ff0d2ec 100644 --- a/logic/lists/InstanceList.cpp +++ b/logic/lists/InstanceList.cpp @@ -90,6 +90,10 @@ QVariant InstanceList::data(const QModelIndex &index, int role) const QVariant v = qVariantFromValue((void *)pdata); return v; } + case InstanceIDRole: + { + return pdata->id(); + } case Qt::DisplayRole: { return pdata->name(); @@ -378,7 +382,7 @@ void InstanceList::loadFTBInstances(QMap<QString, QString> &groupMap, if (!QFileInfo(PathCombine(record.instanceDir, "instance.cfg")).exists()) { QLOG_INFO() << "Converting " << record.name << " as new."; - BaseInstance *instPtr = NULL; + InstancePtr instPtr; auto &factory = InstanceFactory::get(); auto version = MMC->minecraftlist()->findVersion(record.mcVersion); if (!version) @@ -406,7 +410,7 @@ void InstanceList::loadFTBInstances(QMap<QString, QString> &groupMap, else { QLOG_INFO() << "Loading existing " << record.name; - BaseInstance *instPtr = NULL; + InstancePtr instPtr; auto error = InstanceFactory::get().loadInstance(instPtr, record.instanceDir); if (!instPtr || error != InstanceFactory::NoLoadError) continue; @@ -439,11 +443,11 @@ InstanceList::InstListError InstanceList::loadList() if (!QFileInfo(PathCombine(subDir, "instance.cfg")).exists()) continue; QLOG_INFO() << "Loading MultiMC instance from " << subDir; - BaseInstance *instPtr = NULL; + InstancePtr instPtr; auto error = InstanceFactory::get().loadInstance(instPtr, subDir); if(!continueProcessInstance(instPtr, error, subDir, groupMap)) continue; - tempList.append(InstancePtr(instPtr)); + tempList.append(instPtr); } } @@ -536,7 +540,7 @@ int InstanceList::getInstIndex(BaseInstance *inst) const return -1; } -bool InstanceList::continueProcessInstance(BaseInstance *instPtr, const int error, +bool InstanceList::continueProcessInstance(InstancePtr instPtr, const int error, const QDir &dir, QMap<QString, QString> &groupMap) { if (error != InstanceFactory::NoLoadError && error != InstanceFactory::NotAnInstance) diff --git a/logic/lists/InstanceList.h b/logic/lists/InstanceList.h index ebe3e051..f0bbb7ec 100644 --- a/logic/lists/InstanceList.h +++ b/logic/lists/InstanceList.h @@ -62,7 +62,8 @@ public: enum AdditionalRoles { - InstancePointerRole = 0x34B1CB48 ///< Return pointer to real instance + InstancePointerRole = 0x34B1CB48, ///< Return pointer to real instance + InstanceIDRole = 0x34B1CB49 ///< Return id if the instance }; /*! * \brief Error codes returned by functions in the InstanceList class. @@ -132,7 +133,7 @@ slots: private: int getInstIndex(BaseInstance *inst) const; - bool continueProcessInstance(BaseInstance *instPtr, const int error, const QDir &dir, + bool continueProcessInstance(InstancePtr instPtr, const int error, const QDir &dir, QMap<QString, QString> &groupMap); protected: diff --git a/logic/net/ByteArrayDownload.h b/logic/net/ByteArrayDownload.h index 0d90abc2..76e2e279 100644 --- a/logic/net/ByteArrayDownload.h +++ b/logic/net/ByteArrayDownload.h @@ -26,7 +26,7 @@ public: { return ByteArrayDownloadPtr(new ByteArrayDownload(url)); } - + virtual ~ByteArrayDownload() {}; public: /// if not saving to file, downloaded data is placed here QByteArray m_data; diff --git a/logic/net/CacheDownload.h b/logic/net/CacheDownload.h index 154f5988..d446d23e 100644 --- a/logic/net/CacheDownload.h +++ b/logic/net/CacheDownload.h @@ -41,6 +41,7 @@ public: { return CacheDownloadPtr(new CacheDownload(url, entry)); } + virtual ~CacheDownload(){}; QString getTargetFilepath() { return m_target_path; diff --git a/logic/net/ForgeMirrors.h b/logic/net/ForgeMirrors.h index 990e49d6..6784fba1 100644 --- a/logic/net/ForgeMirrors.h +++ b/logic/net/ForgeMirrors.h @@ -39,7 +39,7 @@ public: { return ForgeMirrorsPtr(new ForgeMirrors(libs, parent_job, mirrorlist)); } - + virtual ~ForgeMirrors(){}; protected slots: virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); diff --git a/logic/net/ForgeXzDownload.h b/logic/net/ForgeXzDownload.h index 990f91f0..7bdfb6d9 100644 --- a/logic/net/ForgeXzDownload.h +++ b/logic/net/ForgeXzDownload.h @@ -45,6 +45,7 @@ public: { return ForgeXzDownloadPtr(new ForgeXzDownload(relative_path, entry)); } + virtual ~ForgeXzDownload(){}; void setMirrors(QList<ForgeMirror> & mirrors); protected diff --git a/logic/net/MD5EtagDownload.h b/logic/net/MD5EtagDownload.h index d5aed0ca..f5031e46 100644 --- a/logic/net/MD5EtagDownload.h +++ b/logic/net/MD5EtagDownload.h @@ -38,6 +38,7 @@ public: { return Md5EtagDownloadPtr(new MD5EtagDownload(url, target_path)); } + virtual ~MD5EtagDownload(){}; protected slots: virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); diff --git a/logic/net/NetJob.h b/logic/net/NetJob.h index 03d6a36e..2df8428b 100644 --- a/logic/net/NetJob.h +++ b/logic/net/NetJob.h @@ -32,7 +32,7 @@ class NetJob : public ProgressProvider Q_OBJECT public: explicit NetJob(QString job_name) : ProgressProvider(), m_job_name(job_name) {}; - + virtual ~NetJob() {}; template <typename T> bool addNetAction(T action) { NetActionPtr base = std::static_pointer_cast<NetAction>(action); diff --git a/logic/net/PasteUpload.h b/logic/net/PasteUpload.h index 83876c17..55cfabf4 100644 --- a/logic/net/PasteUpload.h +++ b/logic/net/PasteUpload.h @@ -9,6 +9,7 @@ class PasteUpload : public Task Q_OBJECT public: PasteUpload(QWidget *window, QString text); + virtual ~PasteUpload(){}; protected: virtual void executeTask(); diff --git a/logic/screenshots/ScreenshotList.cpp b/logic/screenshots/ScreenshotList.cpp index 8a64dc36..a34f4d46 100644 --- a/logic/screenshots/ScreenshotList.cpp +++ b/logic/screenshots/ScreenshotList.cpp @@ -7,7 +7,7 @@ #include "gui/dialogs/ProgressDialog.h" #include "gui/dialogs/CustomMessageBox.h" -ScreenshotList::ScreenshotList(BaseInstance *instance, QObject *parent) +ScreenshotList::ScreenshotList(InstancePtr instance, QObject *parent) : QAbstractListModel(parent), m_instance(instance) { } diff --git a/logic/screenshots/ScreenshotList.h b/logic/screenshots/ScreenshotList.h index ca6314e9..dc26a698 100644 --- a/logic/screenshots/ScreenshotList.h +++ b/logic/screenshots/ScreenshotList.h @@ -10,7 +10,7 @@ class ScreenshotList : public QAbstractListModel { Q_OBJECT public: - ScreenshotList(BaseInstance *instance, QObject *parent = 0); + ScreenshotList(InstancePtr instance, QObject *parent = 0); QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; @@ -31,7 +31,7 @@ public: return m_screenshots; } - BaseInstance *instance() const + InstancePtr instance() const { return m_instance; } @@ -45,7 +45,7 @@ slots: private: QList<ScreenshotPtr> m_screenshots; - BaseInstance *m_instance; + InstancePtr m_instance; }; class ScreenshotLoadTask : public Task diff --git a/logic/tasks/Task.h b/logic/tasks/Task.h index 84775407..063eeeda 100644 --- a/logic/tasks/Task.h +++ b/logic/tasks/Task.h @@ -24,6 +24,7 @@ class Task : public ProgressProvider Q_OBJECT public: explicit Task(QObject *parent = 0); + virtual ~Task() {}; virtual QString getStatus() const; virtual void getProgress(qint64 ¤t, qint64 &total); diff --git a/logic/tools/BaseExternalTool.cpp b/logic/tools/BaseExternalTool.cpp index 69cddd00..23f154e2 100644 --- a/logic/tools/BaseExternalTool.cpp +++ b/logic/tools/BaseExternalTool.cpp @@ -11,7 +11,7 @@ #include "logic/BaseInstance.h" #include "MultiMC.h" -BaseExternalTool::BaseExternalTool(BaseInstance *instance, QObject *parent) +BaseExternalTool::BaseExternalTool(InstancePtr instance, QObject *parent) : QObject(parent), m_instance(instance) { } @@ -55,7 +55,7 @@ QString BaseExternalTool::getSave() const } -BaseDetachedTool::BaseDetachedTool(BaseInstance *instance, QObject *parent) +BaseDetachedTool::BaseDetachedTool(InstancePtr instance, QObject *parent) : BaseExternalTool(instance, parent) { @@ -71,7 +71,8 @@ BaseExternalToolFactory::~BaseExternalToolFactory() { } -BaseDetachedTool *BaseDetachedToolFactory::createDetachedTool(BaseInstance *instance, QObject *parent) +BaseDetachedTool *BaseDetachedToolFactory::createDetachedTool(InstancePtr instance, + QObject *parent) { return qobject_cast<BaseDetachedTool *>(createTool(instance, parent)); } diff --git a/logic/tools/BaseExternalTool.h b/logic/tools/BaseExternalTool.h index e8965bfd..7672bf10 100644 --- a/logic/tools/BaseExternalTool.h +++ b/logic/tools/BaseExternalTool.h @@ -1,6 +1,7 @@ #pragma once #include <QObject> +#include <logic/BaseInstance.h> class BaseInstance; class SettingsObject; @@ -11,11 +12,11 @@ class BaseExternalTool : public QObject { Q_OBJECT public: - explicit BaseExternalTool(BaseInstance *instance, QObject *parent = 0); + explicit BaseExternalTool(InstancePtr instance, QObject *parent = 0); virtual ~BaseExternalTool(); protected: - BaseInstance *m_instance; + InstancePtr m_instance; qint64 pid(QProcess *process); QString getSave() const; @@ -25,7 +26,7 @@ class BaseDetachedTool : public BaseExternalTool { Q_OBJECT public: - explicit BaseDetachedTool(BaseInstance *instance, QObject *parent = 0); + explicit BaseDetachedTool(InstancePtr instance, QObject *parent = 0); public slots: @@ -44,7 +45,7 @@ public: virtual void registerSettings(SettingsObject *settings) = 0; - virtual BaseExternalTool *createTool(BaseInstance *instance, QObject *parent = 0) = 0; + virtual BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) = 0; virtual bool check(QString *error) = 0; virtual bool check(const QString &path, QString *error) = 0; @@ -53,5 +54,5 @@ public: class BaseDetachedToolFactory : public BaseExternalToolFactory { public: - virtual BaseDetachedTool *createDetachedTool(BaseInstance *instance, QObject *parent = 0); + virtual BaseDetachedTool *createDetachedTool(InstancePtr instance, QObject *parent = 0); }; diff --git a/logic/tools/BaseProfiler.cpp b/logic/tools/BaseProfiler.cpp index 9aaca793..7cd1c5c7 100644 --- a/logic/tools/BaseProfiler.cpp +++ b/logic/tools/BaseProfiler.cpp @@ -2,7 +2,7 @@ #include <QProcess> -BaseProfiler::BaseProfiler(BaseInstance *instance, QObject *parent) +BaseProfiler::BaseProfiler(InstancePtr instance, QObject *parent) : BaseExternalTool(instance, parent) { } @@ -29,7 +29,7 @@ void BaseProfiler::abortProfilingImpl() emit abortLaunch(tr("Profiler aborted")); } -BaseProfiler *BaseProfilerFactory::createProfiler(BaseInstance *instance, QObject *parent) +BaseProfiler *BaseProfilerFactory::createProfiler(InstancePtr instance, QObject *parent) { return qobject_cast<BaseProfiler *>(createTool(instance, parent)); } diff --git a/logic/tools/BaseProfiler.h b/logic/tools/BaseProfiler.h index ec57578e..dd841da4 100644 --- a/logic/tools/BaseProfiler.h +++ b/logic/tools/BaseProfiler.h @@ -11,7 +11,7 @@ class BaseProfiler : public BaseExternalTool { Q_OBJECT public: - explicit BaseProfiler(BaseInstance *instance, QObject *parent = 0); + explicit BaseProfiler(InstancePtr instance, QObject *parent = 0); public slots: @@ -32,5 +32,5 @@ signals: class BaseProfilerFactory : public BaseExternalToolFactory { public: - virtual BaseProfiler *createProfiler(BaseInstance *instance, QObject *parent = 0); + virtual BaseProfiler *createProfiler(InstancePtr instance, QObject *parent = 0); }; diff --git a/logic/tools/JProfiler.cpp b/logic/tools/JProfiler.cpp index bb851f0b..35d5d304 100644 --- a/logic/tools/JProfiler.cpp +++ b/logic/tools/JProfiler.cpp @@ -8,7 +8,7 @@ #include "logic/BaseInstance.h" #include "MultiMC.h" -JProfiler::JProfiler(BaseInstance *instance, QObject *parent) : BaseProfiler(instance, parent) +JProfiler::JProfiler(InstancePtr instance, QObject *parent) : BaseProfiler(instance, parent) { } @@ -46,7 +46,7 @@ void JProfilerFactory::registerSettings(SettingsObject *settings) settings->registerSetting("JProfilerPort", 42042); } -BaseExternalTool *JProfilerFactory::createTool(BaseInstance *instance, QObject *parent) +BaseExternalTool *JProfilerFactory::createTool(InstancePtr instance, QObject *parent) { return new JProfiler(instance, parent); } diff --git a/logic/tools/JProfiler.h b/logic/tools/JProfiler.h index 88a02462..b3fa6ec7 100644 --- a/logic/tools/JProfiler.h +++ b/logic/tools/JProfiler.h @@ -6,7 +6,7 @@ class JProfiler : public BaseProfiler { Q_OBJECT public: - JProfiler(BaseInstance *instance, QObject *parent = 0); + JProfiler(InstancePtr instance, QObject *parent = 0); protected: void beginProfilingImpl(MinecraftProcess *process); @@ -17,7 +17,7 @@ class JProfilerFactory : public BaseProfilerFactory public: QString name() const override { return "JProfiler"; } void registerSettings(SettingsObject *settings) override; - BaseExternalTool *createTool(BaseInstance *instance, QObject *parent = 0) override; + BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) override; bool check(QString *error) override; bool check(const QString &path, QString *error) override; }; diff --git a/logic/tools/JVisualVM.cpp b/logic/tools/JVisualVM.cpp index 02938028..02e7d8b5 100644 --- a/logic/tools/JVisualVM.cpp +++ b/logic/tools/JVisualVM.cpp @@ -8,7 +8,7 @@ #include "logic/BaseInstance.h" #include "MultiMC.h" -JVisualVM::JVisualVM(BaseInstance *instance, QObject *parent) : BaseProfiler(instance, parent) +JVisualVM::JVisualVM(InstancePtr instance, QObject *parent) : BaseProfiler(instance, parent) { } @@ -47,7 +47,7 @@ void JVisualVMFactory::registerSettings(SettingsObject *settings) settings->registerSetting("JVisualVMPath", defaultValue); } -BaseExternalTool *JVisualVMFactory::createTool(BaseInstance *instance, QObject *parent) +BaseExternalTool *JVisualVMFactory::createTool(InstancePtr instance, QObject *parent) { return new JVisualVM(instance, parent); } diff --git a/logic/tools/JVisualVM.h b/logic/tools/JVisualVM.h index af94fe55..dffdde36 100644 --- a/logic/tools/JVisualVM.h +++ b/logic/tools/JVisualVM.h @@ -6,7 +6,7 @@ class JVisualVM : public BaseProfiler { Q_OBJECT public: - JVisualVM(BaseInstance *instance, QObject *parent = 0); + JVisualVM(InstancePtr instance, QObject *parent = 0); protected: void beginProfilingImpl(MinecraftProcess *process); @@ -17,7 +17,7 @@ class JVisualVMFactory : public BaseProfilerFactory public: QString name() const override { return "JVisualVM"; } void registerSettings(SettingsObject *settings) override; - BaseExternalTool *createTool(BaseInstance *instance, QObject *parent = 0) override; + BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) override; bool check(QString *error) override; bool check(const QString &path, QString *error) override; }; diff --git a/logic/tools/MCEditTool.cpp b/logic/tools/MCEditTool.cpp index e22a5d4a..36b8d5bd 100644 --- a/logic/tools/MCEditTool.cpp +++ b/logic/tools/MCEditTool.cpp @@ -9,7 +9,7 @@ #include "logic/BaseInstance.h" #include "MultiMC.h" -MCEditTool::MCEditTool(BaseInstance *instance, QObject *parent) +MCEditTool::MCEditTool(InstancePtr instance, QObject *parent) : BaseDetachedTool(instance, parent) { } @@ -47,7 +47,7 @@ void MCEditFactory::registerSettings(SettingsObject *settings) { settings->registerSetting("MCEditPath"); } -BaseExternalTool *MCEditFactory::createTool(BaseInstance *instance, QObject *parent) +BaseExternalTool *MCEditFactory::createTool(InstancePtr instance, QObject *parent) { return new MCEditTool(instance, parent); } diff --git a/logic/tools/MCEditTool.h b/logic/tools/MCEditTool.h index b0ed1ad4..9985bde1 100644 --- a/logic/tools/MCEditTool.h +++ b/logic/tools/MCEditTool.h @@ -6,7 +6,7 @@ class MCEditTool : public BaseDetachedTool { Q_OBJECT public: - explicit MCEditTool(BaseInstance *instance, QObject *parent = 0); + explicit MCEditTool(InstancePtr instance, QObject *parent = 0); protected: void runImpl() override; @@ -17,7 +17,7 @@ class MCEditFactory : public BaseDetachedToolFactory public: QString name() const override { return "MCEdit"; } void registerSettings(SettingsObject *settings) override; - BaseExternalTool *createTool(BaseInstance *instance, QObject *parent = 0) override; + BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) override; bool check(QString *error) override; bool check(const QString &path, QString *error) override; }; |