Merge remote-tracking branch 'origin/release/22.04'

This commit is contained in:
Albert Astals Cid 2022-03-28 22:19:45 +02:00
commit d72d3a01a5

View file

@ -254,13 +254,7 @@ bool EBook_CHM::load(const QString &archiveName)
}
#if defined(WIN32)
// chm_open on Windows OS uses the following prototype:
// struct chmFile* chm_open(BSTR filename);
//
// however internally it simply passes the filename
// directly to CreateFileW function without any conversion.
// Thus we need to pass it as WCHAR * and not BSTR.
m_chmFile = chm_open((BSTR)filename.toStdWString().c_str());
m_chmFile = chm_open((BSTR)QFile::encodeName(filename).constData());
#else
m_chmFile = chm_open(QFile::encodeName(filename));
#endif