refactor: CoreProcess remove addSeverArgs handle server config in CoreProcess::start

This commit is contained in:
sithlord48 2025-10-10 14:07:51 -04:00 committed by Chris Rizzitello
parent bd0c5a68f1
commit 173638d6f5
2 changed files with 6 additions and 18 deletions

View file

@ -367,8 +367,12 @@ void CoreProcess::start(std::optional<ProcessMode> processModeOption)
if (mode() == Server) {
args.prepend(QStringLiteral("server"));
if (!addServerArgs())
qWarning("failed to add server args for core process, aborting start");
const auto configFilename = persistServerConfig();
if (configFilename.isEmpty()) {
qFatal("config file name empty for server args");
return;
}
qInfo("core config file: %s", qPrintable(configFilename));
} else if (mode() == Client) {
args.prepend(QStringLiteral("client"));
}
@ -456,21 +460,6 @@ void CoreProcess::cleanup()
}
}
bool CoreProcess::addServerArgs()
{
QString configFilename = persistServerConfig();
if (configFilename.isEmpty()) {
qFatal("config file name empty for server args");
return false;
}
qInfo("core config file: %s", qPrintable(configFilename));
// bizarrely, the tls cert path arg was being given to the core client.
// since it's not clear why (it is only needed for the server), this has now
// been moved to server args.
return true;
}
QString CoreProcess::persistServerConfig() const
{
if (Settings::value(Settings::Server::ExternalConfig).toBool()) {

View file

@ -115,7 +115,6 @@ private:
void startProcessFromDaemon(const QStringList &args);
void stopForegroundProcess() const;
void stopProcessFromDaemon();
bool addServerArgs();
QString persistServerConfig() const;
QString modeString() const;
QString processModeString() const;