diff options
| author | 2023-10-05 17:50:54 +0200 | |
|---|---|---|
| committer | 2023-10-18 10:26:35 +0200 | |
| commit | 2d1bc24d6b6b032dc7db5a2ef7e63bcef43fd511 (patch) | |
| tree | 9181ee4ba29dc99e652f0ff07d4f95642607c4f4 /src/modules/logview/LogFile.cpp | |
| parent | Misc Qt6 port for slightly changed class names and method signatures (diff) | |
| download | KVIrc-2d1bc24d6b6b032dc7db5a2ef7e63bcef43fd511.tar.gz KVIrc-2d1bc24d6b6b032dc7db5a2ef7e63bcef43fd511.tar.bz2 KVIrc-2d1bc24d6b6b032dc7db5a2ef7e63bcef43fd511.zip | |
Changes that will need to be reworked.
QFont changed the weight scale in Qt6, in order to use them we'd need to fix all configuration files in all themes.
QStreamConverter only supports Utf8/16/32 and Latin1 before Qt6.5. Stick to qt5compat's QTextCodec by now
Diffstat (limited to 'src/modules/logview/LogFile.cpp')
| -rw-r--r-- | src/modules/logview/LogFile.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/logview/LogFile.cpp b/src/modules/logview/LogFile.cpp index 471099b73..200a2cb0c 100644 --- a/src/modules/logview/LogFile.cpp +++ b/src/modules/logview/LogFile.cpp @@ -40,6 +40,11 @@ #include <QDir> #include <QTextStream> #include <QLocale> +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) +#include <QTextCodec> +#else +#include <QStringConverter> +#endif #ifdef COMPILE_ZLIB_SUPPORT #include <zlib.h> @@ -431,7 +436,11 @@ void LogFile::createLog(ExportType exportType, QString szLog, QString * pszFile) // Ensure we're writing in UTF-8 QTextStream output(&log); - output.setCodec("UTF-8"); +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + output.setCodec(QTextCodec::codecForMib(106)); +#else + output.setEncoding(QStringConverter::Utf8); +#endif output << szOutputBuffer; // Close file descriptors |
