diff -r 2aa15daa0216 -r 3ea38fd469ca src/parser.cpp --- a/src/parser.cpp Sun Jul 03 22:32:50 2022 +0300 +++ b/src/parser.cpp Sun Jul 03 23:54:22 2022 +0300 @@ -30,16 +30,16 @@ /* * Constructs an LDraw parser */ -Parser::Parser(QIODevice& device, QObject* parent) : +Parser::Parser(QTextStream& stream, QObject* parent) : QObject {parent}, - device {device} {} + stream {stream} {} /* * Reads a single line from the device. */ QString Parser::readLine() { - return QString::fromUtf8(this->device.readLine()).trimmed(); + return this->stream.readLine().trimmed(); } /** @@ -49,7 +49,7 @@ void Parser::parseBody(Model& model) { bool invertNext = false; - while (not this->device.atEnd()) + while (not this->stream.atEnd()) { // Some LDraw parts such as 53588.dat can contain "BFC INVERTNEXT" with multiple inner whitespaces. // So we need to pass the string through QString::simplified to catch these cases.