refactor: CoreProcess::processModeToString use QVariant::fromValue().toString().toLower() to create the string, make method static member of CoreProcess
This commit is contained in:
parent
26c2f672be
commit
a120441a10
2 changed files with 3 additions and 10 deletions
|
|
@ -35,17 +35,9 @@ const auto kLineSplitRegex = QRegularExpression("\r|\n|\r\n");
|
||||||
// free functions
|
// free functions
|
||||||
//
|
//
|
||||||
|
|
||||||
QString processModeToString(Settings::ProcessMode mode)
|
QString CoreProcess::processModeToString(const Settings::ProcessMode mode)
|
||||||
{
|
{
|
||||||
switch (mode) {
|
return QVariant::fromValue(mode).toString().toLower();
|
||||||
case Settings::ProcessMode::Desktop:
|
|
||||||
return "desktop";
|
|
||||||
case Settings::ProcessMode::Service:
|
|
||||||
return "service";
|
|
||||||
default:
|
|
||||||
qFatal("invalid process mode");
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString processStateToString(CoreProcess::ProcessState state)
|
QString processStateToString(CoreProcess::ProcessState state)
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,7 @@ private:
|
||||||
QString requestDaemonLogPath();
|
QString requestDaemonLogPath();
|
||||||
void persistLogDir() const;
|
void persistLogDir() const;
|
||||||
static QString makeQuotedArgs(const QString &app, const QStringList &args);
|
static QString makeQuotedArgs(const QString &app, const QStringList &args);
|
||||||
|
static QString processModeToString(const Settings::ProcessMode mode);
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
void checkOSXNotification(const QString &line);
|
void checkOSXNotification(const QString &line);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue