refactor: Coreprocess remove single use one liner persistLogDir, make dir in start if needed
This commit is contained in:
parent
13990438d3
commit
004089f887
2 changed files with 3 additions and 7 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
|
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||||
* SPDX-FileCopyrightText: (C) 2024 - 2025 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2024 - 2025 Symless Ltd.
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
*/
|
*/
|
||||||
|
|
@ -347,8 +348,8 @@ void CoreProcess::start(std::optional<ProcessMode> processModeOption)
|
||||||
qDebug().noquote() << "log level:" << Settings::logLevelText();
|
qDebug().noquote() << "log level:" << Settings::logLevelText();
|
||||||
|
|
||||||
if (Settings::value(Settings::Log::ToFile).toBool()) {
|
if (Settings::value(Settings::Log::ToFile).toBool()) {
|
||||||
persistLogDir();
|
|
||||||
const auto logFile = Settings::value(Settings::Log::File).toString();
|
const auto logFile = Settings::value(Settings::Log::File).toString();
|
||||||
|
QDir(QFileInfo(logFile).absolutePath()).mkpath(".");
|
||||||
args.append({QStringLiteral("--log"), logFile});
|
args.append({QStringLiteral("--log"), logFile});
|
||||||
qInfo().noquote() << "log file:" << logFile;
|
qInfo().noquote() << "log file:" << logFile;
|
||||||
}
|
}
|
||||||
|
|
@ -550,11 +551,6 @@ QString CoreProcess::requestDaemonLogPath()
|
||||||
return logPath;
|
return logPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreProcess::persistLogDir() const
|
|
||||||
{
|
|
||||||
QDir(QFileInfo(Settings::value(Settings::Log::File).toString()).absolutePath()).mkpath(".");
|
|
||||||
}
|
|
||||||
|
|
||||||
void CoreProcess::clearSettings()
|
void CoreProcess::clearSettings()
|
||||||
{
|
{
|
||||||
const auto processMode = Settings::value(Settings::Core::ProcessMode).value<ProcessMode>();
|
const auto processMode = Settings::value(Settings::Core::ProcessMode).value<ProcessMode>();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
|
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||||
* SPDX-FileCopyrightText: (C) 2024 - 2025 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2024 - 2025 Symless Ltd.
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
*/
|
*/
|
||||||
|
|
@ -125,7 +126,6 @@ private:
|
||||||
void handleLogLines(const QString &text);
|
void handleLogLines(const QString &text);
|
||||||
QString correctedAddress() const;
|
QString correctedAddress() const;
|
||||||
QString requestDaemonLogPath();
|
QString requestDaemonLogPath();
|
||||||
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);
|
static QString processModeToString(const Settings::ProcessMode mode);
|
||||||
static QString processStateToString(const CoreProcess::ProcessState state);
|
static QString processStateToString(const CoreProcess::ProcessState state);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue