refactor: Rename core process start/stop function names
This commit is contained in:
parent
92603df93d
commit
ac6809d40f
2 changed files with 12 additions and 12 deletions
|
|
@ -259,7 +259,7 @@ void CoreProcess::onProcessFinished(int exitCode, QProcess::ExitStatus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreProcess::startDesktop(const QString &app, const QStringList &args)
|
void CoreProcess::startForegroundProcess(const QString &app, const QStringList &args)
|
||||||
{
|
{
|
||||||
using enum ProcessState;
|
using enum ProcessState;
|
||||||
|
|
||||||
|
|
@ -282,7 +282,7 @@ void CoreProcess::startDesktop(const QString &app, const QStringList &args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreProcess::startService(const QString &app, const QStringList &args)
|
void CoreProcess::startProcessFromDaemon(const QString &app, const QStringList &args)
|
||||||
{
|
{
|
||||||
using enum ProcessState;
|
using enum ProcessState;
|
||||||
|
|
||||||
|
|
@ -304,7 +304,7 @@ void CoreProcess::startService(const QString &app, const QStringList &args)
|
||||||
setProcessState(Started);
|
setProcessState(Started);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreProcess::stopDesktop() const
|
void CoreProcess::stopForegroundProcess() const
|
||||||
{
|
{
|
||||||
if (m_processState != ProcessState::Stopping) {
|
if (m_processState != ProcessState::Stopping) {
|
||||||
qFatal("core process must be in stopping state");
|
qFatal("core process must be in stopping state");
|
||||||
|
|
@ -324,7 +324,7 @@ void CoreProcess::stopDesktop() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreProcess::stopService()
|
void CoreProcess::stopProcessFromDaemon()
|
||||||
{
|
{
|
||||||
if (m_processState != ProcessState::Stopping) {
|
if (m_processState != ProcessState::Stopping) {
|
||||||
qFatal("core process must be in stopping state");
|
qFatal("core process must be in stopping state");
|
||||||
|
|
@ -409,9 +409,9 @@ void CoreProcess::start(std::optional<ProcessMode> processModeOption)
|
||||||
qInfo("log file: %s", qPrintable(m_appConfig.logFilename()));
|
qInfo("log file: %s", qPrintable(m_appConfig.logFilename()));
|
||||||
|
|
||||||
if (processMode == ProcessMode::kDesktop) {
|
if (processMode == ProcessMode::kDesktop) {
|
||||||
startDesktop(app, args);
|
startForegroundProcess(app, args);
|
||||||
} else if (processMode == ProcessMode::kService) {
|
} else if (processMode == ProcessMode::kService) {
|
||||||
startService(app, args);
|
startProcessFromDaemon(app, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastProcessMode = processMode;
|
m_lastProcessMode = processMode;
|
||||||
|
|
@ -432,9 +432,9 @@ void CoreProcess::stop(std::optional<ProcessMode> processModeOption)
|
||||||
setProcessState(ProcessState::Stopping);
|
setProcessState(ProcessState::Stopping);
|
||||||
|
|
||||||
if (processMode == ProcessMode::kService) {
|
if (processMode == ProcessMode::kService) {
|
||||||
stopService();
|
stopProcessFromDaemon();
|
||||||
} else if (processMode == ProcessMode::kDesktop) {
|
} else if (processMode == ProcessMode::kDesktop) {
|
||||||
stopDesktop();
|
stopForegroundProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -136,10 +136,10 @@ private slots:
|
||||||
void onProcessReadyReadStandardError();
|
void onProcessReadyReadStandardError();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void startDesktop(const QString &app, const QStringList &args);
|
void startForegroundProcess(const QString &app, const QStringList &args);
|
||||||
void startService(const QString &app, const QStringList &args);
|
void startProcessFromDaemon(const QString &app, const QStringList &args);
|
||||||
void stopDesktop() const;
|
void stopForegroundProcess() const;
|
||||||
void stopService();
|
void stopProcessFromDaemon();
|
||||||
bool addGenericArgs(QStringList &args, const ProcessMode processMode) const;
|
bool addGenericArgs(QStringList &args, const ProcessMode processMode) const;
|
||||||
bool addServerArgs(QStringList &args, QString &app);
|
bool addServerArgs(QStringList &args, QString &app);
|
||||||
bool addClientArgs(QStringList &args, QString &app);
|
bool addClientArgs(QStringList &args, QString &app);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue