Commit 865042c8 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Enforce C Locale on Windows on rendering.

Related to #780
parent 74aa66e2
Pipeline #32311 passed with stage
in 17 minutes and 21 seconds
...@@ -568,9 +568,6 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene) ...@@ -568,9 +568,6 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene)
bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene) bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene)
{ {
QLocale currentLocale; // For restoring after XML export
qDebug() << "Current locale is " << currentLocale;
QLocale::setDefault(QLocale::c()); // Not sure if helpful …
QDomDocument sceneList = xmlSceneList(scene); QDomDocument sceneList = xmlSceneList(scene);
if (sceneList.isNull()) { if (sceneList.isNull()) {
// Make sure we don't save if scenelist is corrupted // Make sure we don't save if scenelist is corrupted
...@@ -618,7 +615,6 @@ bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene) ...@@ -618,7 +615,6 @@ bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene)
} }
const QByteArray sceneData = sceneList.toString().toUtf8(); const QByteArray sceneData = sceneList.toString().toUtf8();
QLocale::setDefault(currentLocale);
file.write(sceneData); file.write(sceneData);
if (!file.commit()) { if (!file.commit()) {
......
...@@ -1692,7 +1692,17 @@ void Monitor::resetConsumer(bool fullReset) ...@@ -1692,7 +1692,17 @@ void Monitor::resetConsumer(bool fullReset)
const QString Monitor::sceneList(const QString &root, const QString &fullPath) const QString Monitor::sceneList(const QString &root, const QString &fullPath)
{ {
return m_glMonitor->sceneList(root, fullPath); // on Windows, the xml consumer doesn't follow LC_NUMERIC, so enforce locale
#ifdef Q_OS_WIN
QLocale currentLocale; // For restoring after XML export
qDebug() << "Current locale is " << currentLocale;
QLocale::setDefault(QLocale::c()); // Not sure if helpful
#endif
const QString resultScene = m_glMonitor->sceneList(root, fullPath);
#ifdef Q_OS_WIN
QLocale::setDefault(currentLocale);
#endif
return resultScene;
} }
void Monitor::updateClipZone(const QPoint zone) void Monitor::updateClipZone(const QPoint zone)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment