issue #3404 - Log path needs to be in quotes on windows

issue solved.
This commit is contained in:
jerry 2014-06-18 12:59:30 +00:00
parent 507abdcbfb
commit 559237f930
3 changed files with 13 additions and 7 deletions

View File

@ -93,6 +93,16 @@ void AppConfig::persistLogDir()
} }
} }
const QString logFilenameCmd() const
{
QString filename = m_LogFilename;
#if defined(Q_OS_WIN)
// wrap in quotes in case username contains spaces.
filename = QString("\"%1\"").arg(filename);
#endif
return filename;
}
QString AppConfig::logLevelText() const QString AppConfig::logLevelText() const
{ {
return logLevelNames[logLevel()]; return logLevelNames[logLevel()];

View File

@ -59,6 +59,7 @@ class AppConfig
int logLevel() const { return m_LogLevel; } int logLevel() const { return m_LogLevel; }
bool logToFile() const { return m_LogToFile; } bool logToFile() const { return m_LogToFile; }
const QString& logFilename() const { return m_LogFilename; } const QString& logFilename() const { return m_LogFilename; }
const QString logFilenameCmd() const;
QString logLevelText() const; QString logLevelText() const;
const QString& cryptoPass() const { return m_CryptoPass; } const QString& cryptoPass() const { return m_CryptoPass; }
bool cryptoEnabled() const { return m_CryptoEnabled; } bool cryptoEnabled() const { return m_CryptoEnabled; }

View File

@ -508,7 +508,7 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
if (appConfig().logToFile()) if (appConfig().logToFile())
{ {
appConfig().persistLogDir(); appConfig().persistLogDir();
args << "--log" << appConfig().logFilename(); args << "--log" << appConfig().logFilenameCmd();
} }
args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port()); args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port());
@ -581,12 +581,7 @@ bool MainWindow::serverArgs(QStringList& args, QString& app)
{ {
appConfig().persistLogDir(); appConfig().persistLogDir();
QString logFilename = appConfig().logFilename(); args << "--log" << appConfig().logFilenameCmd();
#if defined(Q_OS_WIN)
// wrap in quotes in case username contains spaces.
logFilename = QString("\"%1\"").arg(logFilename);
#endif
args << "--log" << logFilename;
} }
QString configFilename = this->configFilename(); QString configFilename = this->configFilename();