[PATCH phonesim 2/3] Only call QTextStream::setCodec in Qt5

Andres Salomon <[email protected]> Sat, 28 Feb 2026 04:16:50 -0500
Newsgroups dev.linux.lists.ofono
Message-ID <20260228041650.37231ae6@5400>
From: Andres Salomon <[email protected]>

Qt6 defaults to UTF8, and setCodec was removed.
---
 src/control.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/control.cpp b/src/control.cpp
index b06dbc1..66a65ef 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -700,7 +700,9 @@ QString Script::Run(const QString &name, const QDBusMessage &msg)
     }
 
     QTextStream stream(&scriptFile);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
     stream.setCodec("UTF-8");
+#endif
     QString contents = stream.readAll();
     scriptFile.close();
 
-- 
2.51.0