diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-06-28 21:34:56 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-06-28 21:34:56 +0200 |
commit | b5f636b3d57a63f634c4efe5a4ccd9a91f53df04 (patch) | |
tree | e251a4725feefd93d99ebc62b150bce2a60ecda2 /api/logic/minecraft/legacy/LegacyInstance.cpp | |
parent | 19bb50b872da2702b8e0b65f3f7b6b54c1c5b071 (diff) | |
download | PrismLauncher-b5f636b3d57a63f634c4efe5a4ccd9a91f53df04.tar.gz PrismLauncher-b5f636b3d57a63f634c4efe5a4ccd9a91f53df04.tar.bz2 PrismLauncher-b5f636b3d57a63f634c4efe5a4ccd9a91f53df04.zip |
NOISSUE do not keep downloads in memory, add (some) missing virtual dtors
Diffstat (limited to 'api/logic/minecraft/legacy/LegacyInstance.cpp')
-rw-r--r-- | api/logic/minecraft/legacy/LegacyInstance.cpp | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/api/logic/minecraft/legacy/LegacyInstance.cpp b/api/logic/minecraft/legacy/LegacyInstance.cpp index 5338763c..6e6d9ae6 100644 --- a/api/logic/minecraft/legacy/LegacyInstance.cpp +++ b/api/logic/minecraft/legacy/LegacyInstance.cpp @@ -96,86 +96,6 @@ shared_qobject_ptr<Task> LegacyInstance::createUpdateTask(Net::Mode) return nullptr; } -/* -class LegacyJarModTask : public Task -{ - //Q_OBJECT -public: - explicit LegacyJarModTask(std::shared_ptr<LegacyInstance> inst) : Task(nullptr), m_inst(inst) - { - } - virtual void executeTask() - { - if (!m_inst->shouldRebuild()) - { - emitSucceeded(); - return; - } - - // Get the mod list - auto modList = m_inst->getJarMods(); - - QFileInfo runnableJar(m_inst->runnableJar()); - QFileInfo baseJar(m_inst->baseJar()); - bool base_is_custom = m_inst->shouldUseCustomBaseJar(); - - // Nothing to do if there are no jar mods to install, no backup and just the mc jar - if (base_is_custom) - { - // yes, this can happen if the instance only has the runnable jar and not the base jar - // it *could* be assumed that such an instance is vanilla, but that wouldn't be safe - // because that's not something mmc4 guarantees - if (runnableJar.isFile() && !baseJar.exists() && modList.empty()) - { - m_inst->setShouldRebuild(false); - emitSucceeded(); - return; - } - - setStatus(tr("Installing mods: Backing up minecraft.jar ...")); - if (!baseJar.exists() && !QFile::copy(runnableJar.filePath(), baseJar.filePath())) - { - emitFailed("It seems both the active and base jar are gone. A fresh base jar will " - "be used on next run."); - m_inst->setShouldRebuild(true); - m_inst->setShouldUpdate(true); - m_inst->setShouldUseCustomBaseJar(false); - return; - } - } - - if (!baseJar.exists()) - { - emitFailed("The base jar " + baseJar.filePath() + " does not exist"); - return; - } - - if (runnableJar.exists() && !QFile::remove(runnableJar.filePath())) - { - emitFailed("Failed to delete old minecraft.jar"); - return; - } - - setStatus(tr("Installing mods: Opening minecraft.jar ...")); - - QString outputJarPath = runnableJar.filePath(); - QString inputJarPath = baseJar.filePath(); - - if(!MMCZip::createModdedJar(inputJarPath, outputJarPath, modList)) - { - emitFailed(tr("Failed to create the custom Minecraft jar file.")); - return; - } - m_inst->setShouldRebuild(false); - // inst->UpdateVersion(true); - emitSucceeded(); - return; - - } - std::shared_ptr<LegacyInstance> m_inst; -}; -*/ - std::shared_ptr<LegacyModList> LegacyInstance::jarModList() const { if (!jar_mod_list) |