From d033bef1ded739c056243e673a9e3fbb6c57ef24 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 17 May 2025 08:22:13 +0200 Subject: fix build on Linux & Apple --- csv/csv.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'csv/csv.cpp') diff --git a/csv/csv.cpp b/csv/csv.cpp index 7361fdd1..d899e11a 100644 --- a/csv/csv.cpp +++ b/csv/csv.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include namespace { @@ -64,15 +65,19 @@ bool getGameData(int id, unsigned char* table, QString& gamename) return false; } QStringDecoder decoder{QStringConverter::Encoding::Utf8}; - QByteArray lineʹ; lineʹ.reserve(255); QStringList gameLine; gameLine.reserve(8); unsigned lineno = 0; + // TODO QIODevice::readLineInto() is Qt 6.9 - sh 20250515 + char buf[256]; - while (file.readLineInto(&lineʹ)) + while (auto sz = file.readLine(buf, sizeof(buf))) { - QString line = decoder.decode(lineʹ); + QString line = decoder.decode(QByteArrayView{buf, sz}); chomp(line); + if (line.isEmpty()) + continue; + gameLine = line.split(';', Qt::SplitBehaviorFlags::KeepEmptyParts); //qDebug() << "Column 0: " << gameLine.at(0); // No. -- cgit v1.2.3