From d538dfb670d22de186c006ec2b13b5c95bf8da48 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 29 Dec 2021 00:23:43 -0800 Subject: [PATCH] fix unicode in recent projects list --- app/core.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/core.cpp b/app/core.cpp index c79d11a0a..31eed8bbc 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -199,10 +199,7 @@ void Core::Stop() { QFile recent_projects_file(GetRecentProjectsFilePath()); if (recent_projects_file.open(QFile::WriteOnly | QFile::Text)) { - QTextStream ts(&recent_projects_file); - - ts << recent_projects_.join('\n'); - + recent_projects_file.write(recent_projects_.join('\n').toUtf8()); recent_projects_file.close(); } } @@ -731,13 +728,10 @@ void Core::StartGUI(bool full_screen) { QFile recent_projects_file(GetRecentProjectsFilePath()); if (recent_projects_file.open(QFile::ReadOnly | QFile::Text)) { - QTextStream ts(&recent_projects_file); - - QString s; - while (!(s = ts.readLine()).isEmpty()) { - recent_projects_.append(s); + QString r = QString::fromUtf8(recent_projects_file.readAll()); + if (!r.isEmpty()) { + recent_projects_ = r.split('\n'); } - recent_projects_file.close(); }