refactor: CoreProcess remove addSeverArgs handle server config in CoreProcess::start
This commit is contained in:
parent
bd0c5a68f1
commit
173638d6f5
2 changed files with 6 additions and 18 deletions
|
|
@ -367,8 +367,12 @@ void CoreProcess::start(std::optional<ProcessMode> processModeOption)
|
||||||
|
|
||||||
if (mode() == Server) {
|
if (mode() == Server) {
|
||||||
args.prepend(QStringLiteral("server"));
|
args.prepend(QStringLiteral("server"));
|
||||||
if (!addServerArgs())
|
const auto configFilename = persistServerConfig();
|
||||||
qWarning("failed to add server args for core process, aborting start");
|
if (configFilename.isEmpty()) {
|
||||||
|
qFatal("config file name empty for server args");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
qInfo("core config file: %s", qPrintable(configFilename));
|
||||||
} else if (mode() == Client) {
|
} else if (mode() == Client) {
|
||||||
args.prepend(QStringLiteral("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
|
QString CoreProcess::persistServerConfig() const
|
||||||
{
|
{
|
||||||
if (Settings::value(Settings::Server::ExternalConfig).toBool()) {
|
if (Settings::value(Settings::Server::ExternalConfig).toBool()) {
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,6 @@ private:
|
||||||
void startProcessFromDaemon(const QStringList &args);
|
void startProcessFromDaemon(const QStringList &args);
|
||||||
void stopForegroundProcess() const;
|
void stopForegroundProcess() const;
|
||||||
void stopProcessFromDaemon();
|
void stopProcessFromDaemon();
|
||||||
bool addServerArgs();
|
|
||||||
QString persistServerConfig() const;
|
QString persistServerConfig() const;
|
||||||
QString modeString() const;
|
QString modeString() const;
|
||||||
QString processModeString() const;
|
QString processModeString() const;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue