From f93f867c3da084c6d6c5e3ed23896609cff0e692 Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Mon, 5 Oct 2015 01:47:27 +0200 Subject: NOISSUE dissolve util library --- logic/ftb/FTBPlugin.cpp | 10 +++++----- logic/ftb/FTBProfileStrategy.cpp | 8 ++++---- logic/ftb/OneSixFTBInstance.cpp | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'logic/ftb') diff --git a/logic/ftb/FTBPlugin.cpp b/logic/ftb/FTBPlugin.cpp index aa2c3ca9..201b5d3b 100644 --- a/logic/ftb/FTBPlugin.cpp +++ b/logic/ftb/FTBPlugin.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "QDebug" #include #include @@ -137,7 +137,7 @@ InstancePtr loadInstance(SettingsObjectPtr globalSettings, QMap(PathCombine(record.instanceDir, "instance.cfg")); + auto m_settings = std::make_shared(FS::PathCombine(record.instanceDir, "instance.cfg")); m_settings->registerSetting("InstanceType", "Legacy"); qDebug() << "Loading existing " << record.name; @@ -206,7 +206,7 @@ InstancePtr createInstance(SettingsObjectPtr globalSettings, QMap(PathCombine(record.instanceDir, "instance.cfg")); + auto m_settings = std::make_shared(FS::PathCombine(record.instanceDir, "instance.cfg")); m_settings->registerSetting("InstanceType", "Legacy"); if (mcVersion->usesLegacyLauncher()) @@ -257,8 +257,8 @@ void FTBPlugin::loadInstances(SettingsObjectPtr globalSettings, QMapaddIcon(iconKey, iconKey, PathCombine(record.templateDir, record.logo), MMCIcon::Transient); - auto settingsFilePath = PathCombine(record.instanceDir, "instance.cfg"); + ENV.icons()->addIcon(iconKey, iconKey, FS::PathCombine(record.templateDir, record.logo), MMCIcon::Transient); + auto settingsFilePath = FS::PathCombine(record.instanceDir, "instance.cfg"); qDebug() << "ICON get!"; if (QFileInfo(settingsFilePath).exists()) diff --git a/logic/ftb/FTBProfileStrategy.cpp b/logic/ftb/FTBProfileStrategy.cpp index 293d0fdc..ac55bbe7 100644 --- a/logic/ftb/FTBProfileStrategy.cpp +++ b/logic/ftb/FTBProfileStrategy.cpp @@ -2,8 +2,8 @@ #include "minecraft/VersionBuildError.h" #include "ftb/OneSixFTBInstance.h" #include "minecraft/MinecraftVersionList.h" +#include -#include #include #include #include @@ -67,7 +67,7 @@ void FTBProfileStrategy::loadDefaultBuiltinPatches() if(file->version.isEmpty()) { file->version = QObject::tr("Unknown"); - QFile versionFile (PathCombine(m_instance->instanceRoot(), "version")); + QFile versionFile (FS::PathCombine(m_instance->instanceRoot(), "version")); if(versionFile.exists()) { if(versionFile.open(QIODevice::ReadOnly)) @@ -94,8 +94,8 @@ void FTBProfileStrategy::loadUserPatches() { // load all patches, put into map for ordering, apply in the right order ProfileUtils::PatchOrder userOrder; - ProfileUtils::readOverrideOrders(PathCombine(m_instance->instanceRoot(), "order.json"), userOrder); - QDir patches(PathCombine(m_instance->instanceRoot(),"patches")); + ProfileUtils::readOverrideOrders(FS::PathCombine(m_instance->instanceRoot(), "order.json"), userOrder); + QDir patches(FS::PathCombine(m_instance->instanceRoot(),"patches")); // first, load things by sort order. for (auto id : userOrder) diff --git a/logic/ftb/OneSixFTBInstance.cpp b/logic/ftb/OneSixFTBInstance.cpp index 1fc5b49b..7a0fdf4d 100644 --- a/logic/ftb/OneSixFTBInstance.cpp +++ b/logic/ftb/OneSixFTBInstance.cpp @@ -7,7 +7,7 @@ #include "forge/ForgeInstaller.h" #include "forge/ForgeVersionList.h" #include -#include "pathutils.h" +#include OneSixFTBInstance::OneSixFTBInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : OneSixInstance(globalSettings, settings, rootDir) @@ -63,7 +63,7 @@ void OneSixFTBInstance::copy(const QDir &newDir) root.insert("name", name()); root.insert("mcVersion", intendedVersionId()); root.insert("version", intendedVersionId()); - ensureFilePathExists(newDir.absoluteFilePath("patches/ftb.json")); + FS::ensureFilePathExists(newDir.absoluteFilePath("patches/ftb.json")); QFile out(newDir.absoluteFilePath("patches/ftb.json")); if (!out.open(QFile::WriteOnly | QFile::Truncate)) { @@ -83,7 +83,7 @@ void OneSixFTBInstance::copy(const QDir &newDir) { continue; } - if (!ensureFilePathExists(out)) + if (!FS::ensureFilePathExists(out)) { qCritical() << "Couldn't create folder structure for" << out; } -- cgit