From 75d42184466d1e307fcd1cb3057f519ea2358a22 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Thu, 31 Mar 2022 16:37:16 +0200 Subject: BUILD(client): Use different compare operator Apparently the compare operator (operator==) between QCharRef and QString is not present in older versions of Qt. We can simply avoid using it, by making sure to only match a single char against another char instead of matching a string against a char. --- src/mumble/Markdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mumble/Markdown.cpp b/src/mumble/Markdown.cpp index 2b251a9fb..444af8f4d 100644 --- a/src/mumble/Markdown.cpp +++ b/src/mumble/Markdown.cpp @@ -344,7 +344,7 @@ void escapeCharacter(QString &str, int &offset) { tmp = tmp.toHtmlEscaped(); - if (tmp.size() == 1 && tmp == str[offset]) { + if (tmp.size() == 1 && tmp[0] == str[offset]) { // Nothing to escape return; } -- cgit v1.2.3 From c89610a794973394d988303e39da5b03b991187a Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Thu, 31 Mar 2022 16:40:23 +0200 Subject: BUILD: Add missing includes --- src/mumble/PluginManifest.cpp | 1 + src/mumble/QtWidgetUtils.cpp | 2 ++ src/mumble/QtWidgetUtils.h | 2 ++ 3 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/mumble/PluginManifest.cpp b/src/mumble/PluginManifest.cpp index fa69c0c3e..40acb29d3 100644 --- a/src/mumble/PluginManifest.cpp +++ b/src/mumble/PluginManifest.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/src/mumble/QtWidgetUtils.cpp b/src/mumble/QtWidgetUtils.cpp index c329d832f..32ab98edb 100644 --- a/src/mumble/QtWidgetUtils.cpp +++ b/src/mumble/QtWidgetUtils.cpp @@ -11,6 +11,8 @@ #include #include +#include + namespace Mumble { namespace QtUtils { QScreen *screenAt(QPoint point) { diff --git a/src/mumble/QtWidgetUtils.h b/src/mumble/QtWidgetUtils.h index 4702c94a0..3972131e3 100644 --- a/src/mumble/QtWidgetUtils.h +++ b/src/mumble/QtWidgetUtils.h @@ -6,6 +6,8 @@ #ifndef MUMBLE_MUMBLE_QTWIDGETUTILS_H_ #define MUMBLE_MUMBLE_QTWIDGETUTILS_H_ +#include + #include class QScreen; -- cgit v1.2.3 From 8afeaf693834988656a8bd8f95cfb0e5e87a386d Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Thu, 31 Mar 2022 16:43:42 +0200 Subject: BUILD(client): Make compilable with Qt < 5.6 --- src/mumble/SearchDialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/mumble/SearchDialog.cpp b/src/mumble/SearchDialog.cpp index dfc228b2c..009aa8829 100644 --- a/src/mumble/SearchDialog.cpp +++ b/src/mumble/SearchDialog.cpp @@ -489,7 +489,13 @@ void SearchDialog::keyPressEvent(QKeyEvent *event) { return; } +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) if (event->matches(QKeySequence::Cancel)) { +#else + // Before Qt 5.6, no standard key for the cancel operation was defined. Thus, in these cases, we hardcode it to be + // Escape + if (event->key() == Qt::Key_Escape) { +#endif event->accept(); // Mimic behavior of dialogs (close on Esc) close(); -- cgit v1.2.3