mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure the runtime can startup properly if there are wide characters in the logfile path on Windows. Fixes #3464
This commit is contained in:
parent
003889f15e
commit
6a46e43567
@ -17,6 +17,7 @@ Features
|
|||||||
Bug fixes
|
Bug fixes
|
||||||
*********
|
*********
|
||||||
|
|
||||||
|
| `Bug #3464 <https://redmine.postgresql.org/issues/3464>`_ - Ensure the runtime can startup properly if there are wide characters in the logfile path on Windows.
|
||||||
| `Bug #3576 <https://redmine.postgresql.org/issues/3576>`_ - Ensure queries are no longer executed when dashboards are closed.
|
| `Bug #3576 <https://redmine.postgresql.org/issues/3576>`_ - Ensure queries are no longer executed when dashboards are closed.
|
||||||
| `Bug #3596 <https://redmine.postgresql.org/issues/3596>`_ - Fix support for the CLOB datatype in EPAS.
|
| `Bug #3596 <https://redmine.postgresql.org/issues/3596>`_ - Fix support for the CLOB datatype in EPAS.
|
||||||
| `Bug #3607 <https://redmine.postgresql.org/issues/3607>`_ - Fix logic around validation and highlighting of Sort/Filter in the Query Tool.
|
| `Bug #3607 <https://redmine.postgresql.org/issues/3607>`_ - Fix logic around validation and highlighting of Sort/Filter in the Query Tool.
|
||||||
|
@ -230,7 +230,18 @@ Server::Server(quint16 port, QString key, QString logFileName)
|
|||||||
#ifdef PYTHON2
|
#ifdef PYTHON2
|
||||||
err = PyFile_FromString(m_logFileName.toUtf8().data(), (char *)"w");
|
err = PyFile_FromString(m_logFileName.toUtf8().data(), (char *)"w");
|
||||||
#else
|
#else
|
||||||
FILE *log = fopen(m_logFileName.toUtf8().data(), (char *)"w");
|
FILE *log = NULL;
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
char *logFile = m_logFileName.toUtf8().data();
|
||||||
|
size_t fileSize = strlen(logFile) + 1;
|
||||||
|
wchar_t * wcLogFileName = new wchar_t[fileSize];
|
||||||
|
mbstowcs (wcLogFileName, logFile, fileSize);
|
||||||
|
|
||||||
|
log = _wfopen(wcLogFileName, (wchar_t *)"w");
|
||||||
|
#else
|
||||||
|
log = fopen(m_logFileName.toUtf8().data(), (char *)"w");
|
||||||
|
#endif
|
||||||
if (log != NULL)
|
if (log != NULL)
|
||||||
{
|
{
|
||||||
int fd = fileno(log);
|
int fd = fileno(log);
|
||||||
@ -238,6 +249,14 @@ Server::Server(quint16 port, QString key, QString logFileName)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Logger::GetLogger()->Log(QString("Failed to open log file: %1").arg(m_logFileName));
|
Logger::GetLogger()->Log(QString("Failed to open log file: %1").arg(m_logFileName));
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
if (wcLogFileName != NULL)
|
||||||
|
{
|
||||||
|
delete wcLogFileName;
|
||||||
|
wcLogFileName = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
QFile(m_logFileName).setPermissions(QFile::ReadOwner|QFile::WriteOwner);
|
QFile(m_logFileName).setPermissions(QFile::ReadOwner|QFile::WriteOwner);
|
||||||
if (err != NULL)
|
if (err != NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user