QLibrary/Unix: fix mojibake of dlerror()

Amends a6a56814702612d8981f594a6158d70a7928cb99 where I replaced a
function that correctly did QString::fromLocal8Bit() with
QLatin1StringView.

Pick-to: 6.7
Change-Id: Ic0adfa808d28487a8303fffd17d9ec0817eda3e8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0a1a8355f313ac951e3e615f47aca40f421fc4bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2024-06-17 15:44:12 -07:00 committed by Qt Cherry-pick Bot
parent 63aece5ae7
commit e3b0d2f93c

View File

@ -236,8 +236,8 @@ bool QLibraryPrivate::load_sys()
locker.relock();
if (!hnd) {
errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName,
QLatin1StringView(dlerror()));
errorString = QLibrary::tr("Cannot load library %1: %2")
.arg(fileName, QString::fromLocal8Bit(dlerror()));
}
if (hnd) {
qualifiedFileName = attempt;
@ -262,8 +262,8 @@ bool QLibraryPrivate::unload_sys()
if (!qstrcmp(error, "Shared objects still referenced")) // On QNX that's only "informative"
return true;
#endif
errorString = QLibrary::tr("Cannot unload library %1: %2").arg(fileName,
QLatin1StringView(error));
errorString = QLibrary::tr("Cannot unload library %1: %2")
.arg(fileName, QString::fromLocal8Bit(error));
return false;
}
errorString.clear();