From a81df9d634041b62b242201cd4cd9caeff4f8e24 Mon Sep 17 00:00:00 2001 From: segfault <128277930+memsecviolator@users.noreply.github.com> Date: Sun, 19 Mar 2023 03:33:53 -0500 Subject: [PATCH] Add compatibility code, suppress compiler warning lobby.cpp: * Added compatibility code so 2.10.1 can run on Qt versions older than 5.14, such as the version that ships with Ubuntu 20.04 courtroom.cpp: * Used a Q_UNUSED macro on an unused variable to suppress a compiler warning --- src/courtroom.cpp | 1 + src/lobby.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 66df08394..a357da249 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1736,6 +1736,7 @@ void Courtroom::list_areas() void Courtroom::debug_message_handler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { + Q_UNUSED(context); const QMap colors = { {QtDebugMsg, "debug"}, {QtInfoMsg, "info"}, diff --git a/src/lobby.cpp b/src/lobby.cpp index affde2e3a..6855b023b 100644 --- a/src/lobby.cpp +++ b/src/lobby.cpp @@ -199,10 +199,18 @@ void Lobby::loadUI() QFile l_changelog(get_base_path() + "changelog.md"); if (!l_changelog.open(QFile::ReadOnly)) { qDebug() << "Unable to locate changelog file. Does it even exist?"; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) ui_game_changelog_text->setMarkdown(l_changelog_text); +#else + ui_game_changelog_text->setPlainText(l_changelog_text); // imperfect solution, but implementing Markdown ourselves for this edge case is out of scope +#endif return; } +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) ui_game_changelog_text->setMarkdown(l_changelog.readAll()); +#else + ui_game_changelog_text->setPlainText((l_changelog.readAll())); +#endif l_changelog.close(); QTabWidget* l_tabbar = findChild("motd_changelog_tab");