# HG changeset patch # User Markus Mützel # Date 1682240896 -7200 # Node ID 17a09d2bbe0f98b7a6518ceddba234fceba3ccaf # Parent c00d842608f7c3e4ff5a569c26940c8a69fd01de gui: Remove usage of QTextCodec from some more places. * libgui/src/gui-preference.h: Remove unused header. * libgui/src/octave-qobject.cc: Include header only if function from it are used. * m4/acinclude.m4: Do not require Qt6Core5Compat on platforms that don't need it. diff -r c00d842608f7 -r 17a09d2bbe0f libgui/src/gui-preferences.h --- a/libgui/src/gui-preferences.h Sat Apr 22 20:59:48 2023 +0200 +++ b/libgui/src/gui-preferences.h Sun Apr 23 11:08:16 2023 +0200 @@ -31,7 +31,6 @@ #include #include #include -#include #include // FIXME: Would it be possible/make sense to merge gui_pref and sc_pref diff -r c00d842608f7 -r 17a09d2bbe0f libgui/src/octave-qobject.cc --- a/libgui/src/octave-qobject.cc Sat Apr 22 20:59:48 2023 +0200 +++ b/libgui/src/octave-qobject.cc Sun Apr 23 11:08:16 2023 +0200 @@ -32,7 +32,9 @@ #include #include #include -#include +#if ! defined (Q_OS_WIN32) +# include +#endif #include #include #include @@ -198,8 +200,8 @@ if (show_gui_msgs.empty ()) qInstallMessageHandler (message_handler); +#if ! defined (Q_OS_WIN32) // Set the codec for all strings (before wizard or any GUI object) -#if ! defined (Q_OS_WIN32) QTextCodec::setCodecForLocale (QTextCodec::codecForName ("UTF-8")); #endif diff -r c00d842608f7 -r 17a09d2bbe0f m4/acinclude.m4 --- a/m4/acinclude.m4 Sat Apr 22 20:59:48 2023 +0200 +++ b/m4/acinclude.m4 Sun Apr 23 11:08:16 2023 +0200 @@ -1981,10 +1981,19 @@ QT_MODULES="Qt5Core Qt5Gui Qt5Help Qt5Network Qt5OpenGL Qt5PrintSupport Qt5Xml" ;; 6) - # FIXME: Remove Qt6Core5Compat when we no longer rely on classes that - # have been removed in Qt6: - # https://www.qt.io/blog/porting-from-qt-5-to-qt-6-using-qt5compat-library - QT_MODULES="Qt6Core Qt6Core5Compat Qt6Gui Qt6Help Qt6Network Qt6OpenGL Qt6OpenGLWidgets Qt6PrintSupport Qt6Xml" + QT_MODULES="Qt6Core Qt6Gui Qt6Help Qt6Network Qt6OpenGL Qt6OpenGLWidgets Qt6PrintSupport Qt6Xml" + case $host_os in + mingw* | msdosmsvc*) + ;; + *) + # FIXME: Remove Qt6Core5Compat when we no longer rely on classes that + # have been removed in Qt6: + # https://www.qt.io/blog/porting-from-qt-5-to-qt-6-using-qt5compat-library + # It is still needed for the terminal implementation in + # libgui/qterminal/libqterminal/unix + QT_MODULES="$QT_MODULES Qt6Core5Compat" + ;; + esac ;; *) AC_MSG_ERROR([Unrecognized Qt version $qt_version])