summaryrefslogtreecommitdiffstats
path: root/src/library
diff options
context:
space:
mode:
authorBe <be@mixxx.org>2021-10-13 00:13:09 -0500
committerBe <be@mixxx.org>2021-10-13 07:45:31 -0500
commitb46d29816004326e6e902a66c702a3a392cffa6b (patch)
tree2a2e4db8e014d9e5341540a30e76db3bd1fbb8a3 /src/library
parent4106b5fbbd5a44fdf928594269fa412767ad9b97 (diff)
ParserCSV: guard use of QTextStream::setCodec
QTextStream::setCodec was removed in Qt6. https://bugreports.qt.io/browse/QTBUG-75665
Diffstat (limited to 'src/library')
-rw-r--r--src/library/parsercsv.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/library/parsercsv.cpp b/src/library/parsercsv.cpp
index 646c9f2c2d..f34e5ea2d6 100644
--- a/src/library/parsercsv.cpp
+++ b/src/library/parsercsv.cpp
@@ -140,9 +140,14 @@ bool ParserCsv::writeCSVFile(const QString &file_str, BaseSqlTableModel* pPlayli
qDebug() << "Basepath: " << base;
QTextStream out(&file);
- out.setCodec("UTF-8"); // rfc4180: Common usage of CSV is US-ASCII ...
- // Using UTF-8 to get around codepage issues
- // and it's the default encoding in Ooo Calc
+ // rfc4180: Common usage of CSV is US-ASCII ...
+ // Using UTF-8 to get around codepage issues
+ // and it's the default encoding in Ooo Calc
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ DEBUG_ASSERT(out.encoding() == QStringConverter::Utf8);
+#else
+ out.setCodec("UTF-8");
+#endif
// writing header section
bool first = true;