From: Claudio Cambra Date: Thu, 31 Aug 2023 05:36:10 +0000 (+0800) Subject: Use a standardised locale to create log file filenames, fixing issues with certain... X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~9^2~6^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=704a4ec511961ea6783357a89128084f2e536855;p=nextcloud-desktop.git Use a standardised locale to create log file filenames, fixing issues with certain locales Signed-off-by: Claudio Cambra --- diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index 7a050a103..2bfaa8aaf 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -289,8 +289,9 @@ void Logger::enterNextLogFileNoLock() } // Tentative new log name, will be adjusted if one like this already exists - QDateTime now = QDateTime::currentDateTime(); - QString newLogName = now.toString("yyyyMMdd_HHmm") + "_nextcloud.log"; + const auto now = QDateTime::currentDateTime(); + const auto cLocale = QLocale::c(); // Some system locales generate strings that are incompatible with filesystem + QString newLogName = cLocale.toString(now, QStringLiteral("yyyyMMdd_HHmm")) + QStringLiteral("_nextcloud.log"); // Expire old log files and deal with conflicts QStringList files = dir.entryList(QStringList("*owncloud.log.*"), QDir::Files, QDir::Name) +