snake_case to m_camelCase

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2024-08-09 11:06:31 +03:00
parent a9c7e95c66
commit dcca175b36
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
9 changed files with 34 additions and 28 deletions

View File

@ -250,8 +250,8 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
parser.process(arguments()); parser.process(arguments());
m_instanceIdToLaunch = parser.value("launch"); m_instanceIdToLaunch = parser.value("launch");
m_server_to_join = parser.value("server"); m_serverToJoin = parser.value("server");
m_world_to_join = parser.value("world"); m_worldToJoin = parser.value("world");
m_profileToUse = parser.value("profile"); m_profileToUse = parser.value("profile");
m_liveCheck = parser.isSet("alive"); m_liveCheck = parser.isSet("alive");
@ -267,7 +267,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
} }
// error if --launch is missing with --server or --profile // error if --launch is missing with --server or --profile
if (((!m_server_to_join.isEmpty() || !m_world_to_join.isEmpty()) || !m_profileToUse.isEmpty()) && m_instanceIdToLaunch.isEmpty()) { if (((!m_serverToJoin.isEmpty() || !m_worldToJoin.isEmpty()) || !m_profileToUse.isEmpty()) && m_instanceIdToLaunch.isEmpty()) {
std::cerr << "--server and --profile can only be used in combination with --launch!" << std::endl; std::cerr << "--server and --profile can only be used in combination with --launch!" << std::endl;
m_status = Application::Failed; m_status = Application::Failed;
return; return;
@ -385,10 +385,10 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
launch.command = "launch"; launch.command = "launch";
launch.args["id"] = m_instanceIdToLaunch; launch.args["id"] = m_instanceIdToLaunch;
if (!m_server_to_join.isEmpty()) { if (!m_serverToJoin.isEmpty()) {
launch.args["server"] = m_server_to_join; launch.args["server"] = m_serverToJoin;
} else if (!m_world_to_join.isEmpty()) { } else if (!m_worldToJoin.isEmpty()) {
launch.args["world"] = m_world_to_join; launch.args["world"] = m_worldToJoin;
} }
if (!m_profileToUse.isEmpty()) { if (!m_profileToUse.isEmpty()) {
launch.args["profile"] = m_profileToUse; launch.args["profile"] = m_profileToUse;
@ -525,10 +525,10 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
if (!m_instanceIdToLaunch.isEmpty()) { if (!m_instanceIdToLaunch.isEmpty()) {
qDebug() << "ID of instance to launch : " << m_instanceIdToLaunch; qDebug() << "ID of instance to launch : " << m_instanceIdToLaunch;
} }
if (!m_server_to_join.isEmpty()) { if (!m_serverToJoin.isEmpty()) {
qDebug() << "Address of server to join :" << m_server_to_join; qDebug() << "Address of server to join :" << m_serverToJoin;
} else if (!m_world_to_join.isEmpty()) { } else if (!m_worldToJoin.isEmpty()) {
qDebug() << "Name of the world to join :" << m_world_to_join; qDebug() << "Name of the world to join :" << m_worldToJoin;
} }
qDebug() << "<> Paths set."; qDebug() << "<> Paths set.";
} }
@ -1167,13 +1167,13 @@ void Application::performMainStartupAction()
MinecraftAccountPtr accountToUse = nullptr; MinecraftAccountPtr accountToUse = nullptr;
qDebug() << "<> Instance" << m_instanceIdToLaunch << "launching"; qDebug() << "<> Instance" << m_instanceIdToLaunch << "launching";
if (!m_server_to_join.isEmpty()) { if (!m_serverToJoin.isEmpty()) {
// FIXME: validate the server string // FIXME: validate the server string
targetToJoin.reset(new MinecraftTarget(MinecraftTarget::parse(m_server_to_join, false))); targetToJoin.reset(new MinecraftTarget(MinecraftTarget::parse(m_serverToJoin, false)));
qDebug() << " Launching with server" << m_server_to_join; qDebug() << " Launching with server" << m_serverToJoin;
} else if (!m_world_to_join.isEmpty()) { } else if (!m_worldToJoin.isEmpty()) {
targetToJoin.reset(new MinecraftTarget(MinecraftTarget::parse(m_world_to_join, true))); targetToJoin.reset(new MinecraftTarget(MinecraftTarget::parse(m_worldToJoin, true)));
qDebug() << " Launching with world" << m_world_to_join; qDebug() << " Launching with world" << m_worldToJoin;
} }
if (!m_profileToUse.isEmpty()) { if (!m_profileToUse.isEmpty()) {

View File

@ -289,8 +289,8 @@ class Application : public QApplication {
QString m_detectedGLFWPath; QString m_detectedGLFWPath;
QString m_detectedOpenALPath; QString m_detectedOpenALPath;
QString m_instanceIdToLaunch; QString m_instanceIdToLaunch;
QString m_server_to_join; QString m_serverToJoin;
QString m_world_to_join; QString m_worldToJoin;
QString m_profileToUse; QString m_profileToUse;
bool m_liveCheck = false; bool m_liveCheck = false;
QList<QUrl> m_urlsToImport; QList<QUrl> m_urlsToImport;

View File

@ -324,7 +324,7 @@ void LaunchController::launchInstance()
return; return;
} }
m_launcher = m_instance->createLaunchTask(m_session, m_target_to_join); m_launcher = m_instance->createLaunchTask(m_session, m_targetToJoin);
if (!m_launcher) { if (!m_launcher) {
emitFailed(tr("Couldn't instantiate a launcher.")); emitFailed(tr("Couldn't instantiate a launcher."));
return; return;

View File

@ -62,7 +62,7 @@ class LaunchController : public Task {
void setParentWidget(QWidget* widget) { m_parentWidget = widget; } void setParentWidget(QWidget* widget) { m_parentWidget = widget; }
void setTargetToJoin(MinecraftTarget::Ptr targetToJoin) { m_target_to_join = std::move(targetToJoin); } void setTargetToJoin(MinecraftTarget::Ptr targetToJoin) { m_targetToJoin = std::move(targetToJoin); }
void setAccountToUse(MinecraftAccountPtr accountToUse) { m_accountToUse = std::move(accountToUse); } void setAccountToUse(MinecraftAccountPtr accountToUse) { m_accountToUse = std::move(accountToUse); }
@ -94,5 +94,5 @@ class LaunchController : public Task {
MinecraftAccountPtr m_accountToUse = nullptr; MinecraftAccountPtr m_accountToUse = nullptr;
AuthSessionPtr m_session; AuthSessionPtr m_session;
shared_qobject_ptr<LaunchTask> m_launcher; shared_qobject_ptr<LaunchTask> m_launcher;
MinecraftTarget::Ptr m_target_to_join; MinecraftTarget::Ptr m_targetToJoin;
}; };

View File

@ -803,6 +803,7 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session, Minecr
auto profile = m_components->getProfile(); auto profile = m_components->getProfile();
// traits
auto alltraits = traits(); auto alltraits = traits();
if (alltraits.size()) { if (alltraits.size()) {
out << "Traits:"; out << "Traits:";
@ -812,6 +813,7 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session, Minecr
out << ""; out << "";
} }
// native libraries
auto settings = this->settings(); auto settings = this->settings();
bool nativeOpenAL = settings->get("UseNativeOpenAL").toBool(); bool nativeOpenAL = settings->get("UseNativeOpenAL").toBool();
bool nativeGLFW = settings->get("UseNativeGLFW").toBool(); bool nativeGLFW = settings->get("UseNativeGLFW").toBool();
@ -847,6 +849,7 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session, Minecr
out << ""; out << "";
} }
// mods and core mods
auto printModList = [&](const QString& label, ModFolderModel& model) { auto printModList = [&](const QString& label, ModFolderModel& model) {
if (model.size()) { if (model.size()) {
out << QString("%1:").arg(label); out << QString("%1:").arg(label);
@ -875,6 +878,7 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session, Minecr
printModList("Mods", *(loaderModList().get())); printModList("Mods", *(loaderModList().get()));
printModList("Core Mods", *(coreModList().get())); printModList("Core Mods", *(coreModList().get()));
// jar mods
auto& jarMods = profile->getJarMods(); auto& jarMods = profile->getJarMods();
if (jarMods.size()) { if (jarMods.size()) {
out << "Jar Mods:"; out << "Jar Mods:";
@ -890,11 +894,13 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session, Minecr
out << ""; out << "";
} }
// minecraft arguments
auto params = processMinecraftArgs(nullptr, targetToJoin); auto params = processMinecraftArgs(nullptr, targetToJoin);
out << "Params:"; out << "Params:";
out << " " + params.join(' '); out << " " + params.join(' ');
out << ""; out << "";
// window size
QString windowParams; QString windowParams;
if (settings->get("LaunchMaximized").toBool()) { if (settings->get("LaunchMaximized").toBool()) {
out << "Window size: max (if available)"; out << "Window size: max (if available)";

View File

@ -90,7 +90,7 @@ void LauncherPartLaunch::executeTask()
} }
} }
m_launchScript = minecraftInstance->createLaunchScript(m_session, m_target_to_join); m_launchScript = minecraftInstance->createLaunchScript(m_session, m_targetToJoin);
QStringList args = minecraftInstance->javaArguments(); QStringList args = minecraftInstance->javaArguments();
QString allArgs = args.join(", "); QString allArgs = args.join(", ");
emit logLine("Java Arguments:\n[" + m_parent->censorPrivateInfo(allArgs) + "]\n\n", MessageLevel::Launcher); emit logLine("Java Arguments:\n[" + m_parent->censorPrivateInfo(allArgs) + "]\n\n", MessageLevel::Launcher);

View File

@ -34,7 +34,7 @@ class LauncherPartLaunch : public LaunchStep {
void setWorkingDirectory(const QString& wd); void setWorkingDirectory(const QString& wd);
void setAuthSession(AuthSessionPtr session) { m_session = session; } void setAuthSession(AuthSessionPtr session) { m_session = session; }
void setTargetToJoin(MinecraftTarget::Ptr targetToJoin) { m_target_to_join = std::move(targetToJoin); } void setTargetToJoin(MinecraftTarget::Ptr targetToJoin) { m_targetToJoin = std::move(targetToJoin); }
private slots: private slots:
void on_state(LoggedProcess::State state); void on_state(LoggedProcess::State state);
@ -44,7 +44,7 @@ class LauncherPartLaunch : public LaunchStep {
QString m_command; QString m_command;
AuthSessionPtr m_session; AuthSessionPtr m_session;
QString m_launchScript; QString m_launchScript;
MinecraftTarget::Ptr m_target_to_join; MinecraftTarget::Ptr m_targetToJoin;
bool mayProceed = false; bool mayProceed = false;
}; };

View File

@ -129,6 +129,6 @@ void PrintInstanceInfo::executeTask()
#endif #endif
logLines(log, MessageLevel::Launcher); logLines(log, MessageLevel::Launcher);
logLines(instance->verboseDescription(m_session, m_target_to_join), MessageLevel::Launcher); logLines(instance->verboseDescription(m_session, m_targetToJoin), MessageLevel::Launcher);
emitSucceeded(); emitSucceeded();
} }

View File

@ -24,7 +24,7 @@ class PrintInstanceInfo : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit PrintInstanceInfo(LaunchTask* parent, AuthSessionPtr session, MinecraftTarget::Ptr targetToJoin) explicit PrintInstanceInfo(LaunchTask* parent, AuthSessionPtr session, MinecraftTarget::Ptr targetToJoin)
: LaunchStep(parent), m_session(session), m_target_to_join(targetToJoin) {}; : LaunchStep(parent), m_session(session), m_targetToJoin(targetToJoin) {};
virtual ~PrintInstanceInfo() = default; virtual ~PrintInstanceInfo() = default;
virtual void executeTask(); virtual void executeTask();
@ -32,5 +32,5 @@ class PrintInstanceInfo : public LaunchStep {
private: private:
AuthSessionPtr m_session; AuthSessionPtr m_session;
MinecraftTarget::Ptr m_target_to_join; MinecraftTarget::Ptr m_targetToJoin;
}; };