mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
refactor!!!: migrate from shared pointers
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
c64d871a28
commit
549405ab2f
199 changed files with 742 additions and 709 deletions
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
#include "Application.h"
|
||||
#include "Json.h"
|
||||
#include "launch/LaunchTask.h"
|
||||
#include "settings/INISettingsObject.h"
|
||||
#include "settings/OverrideSetting.h"
|
||||
#include "settings/Setting.h"
|
||||
|
|
@ -53,7 +54,7 @@
|
|||
#include "Commandline.h"
|
||||
#include "FileSystem.h"
|
||||
|
||||
int getConsoleMaxLines(SettingsObjectPtr settings)
|
||||
int getConsoleMaxLines(SettingsObject* settings)
|
||||
{
|
||||
auto lineSetting = settings->getSetting("ConsoleMaxLines");
|
||||
bool conversionOk = false;
|
||||
|
|
@ -65,14 +66,14 @@ int getConsoleMaxLines(SettingsObjectPtr settings)
|
|||
return maxLines;
|
||||
}
|
||||
|
||||
bool shouldStopOnConsoleOverflow(SettingsObjectPtr settings)
|
||||
bool shouldStopOnConsoleOverflow(SettingsObject* settings)
|
||||
{
|
||||
return settings->get("ConsoleOverflowStop").toBool();
|
||||
}
|
||||
|
||||
BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString& rootDir) : QObject()
|
||||
BaseInstance::BaseInstance(SettingsObject* globalSettings, std::unique_ptr<SettingsObject> settings, const QString& rootDir) : QObject()
|
||||
{
|
||||
m_settings = settings;
|
||||
m_settings = std::move(settings);
|
||||
m_global_settings = globalSettings;
|
||||
m_rootDir = rootDir;
|
||||
|
||||
|
|
@ -126,6 +127,8 @@ BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr s
|
|||
m_settings->registerSetting("Profiler", "");
|
||||
}
|
||||
|
||||
BaseInstance::~BaseInstance() {}
|
||||
|
||||
QString BaseInstance::getPreLaunchCommand()
|
||||
{
|
||||
return settings()->get("PreLaunchCommand").toString();
|
||||
|
|
@ -335,11 +338,11 @@ QString BaseInstance::instanceRoot() const
|
|||
return m_rootDir;
|
||||
}
|
||||
|
||||
SettingsObjectPtr BaseInstance::settings()
|
||||
SettingsObject* BaseInstance::settings()
|
||||
{
|
||||
loadSpecificSettings();
|
||||
|
||||
return m_settings;
|
||||
return m_settings.get();
|
||||
}
|
||||
|
||||
bool BaseInstance::canLaunch() const
|
||||
|
|
@ -467,9 +470,9 @@ QStringList BaseInstance::extraArguments()
|
|||
return Commandline::splitArgs(settings()->get("JvmArgs").toString());
|
||||
}
|
||||
|
||||
shared_qobject_ptr<LaunchTask> BaseInstance::getLaunchTask()
|
||||
LaunchTask* BaseInstance::getLaunchTask()
|
||||
{
|
||||
return m_launchProcess;
|
||||
return m_launchProcess.get();
|
||||
}
|
||||
|
||||
void BaseInstance::updateRuntimeContext()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue