common: Fix build with Qt4 and/or MSVC
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 3 Sep 2017 23:43:24 +0000 (01:43 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 3 Sep 2017 23:43:24 +0000 (01:43 +0200)
The previous commit caused a build failure for some combinations of
our build matrix, as QChar is not actually a literal usable in a
constexpr (unless you enable Qt5, for some bizarre reason...).

src/common/util.cpp

index 695ca4a..3d199a1 100644 (file)
@@ -64,8 +64,8 @@ QString hostFromMask(const QString &mask)
 
 bool isChannelName(const QString &str)
 {
-    static constexpr std::array<QChar, 4> prefixes{{'#', '&', '!', '+'}};
-    return std::any_of(prefixes.cbegin(), prefixes.cend(), [&str](QChar c) { return c == str[0]; });
+    static constexpr std::array<quint8, 4> prefixes{{'#', '&', '!', '+'}};
+    return std::any_of(prefixes.cbegin(), prefixes.cend(), [&str](quint8 c) { return c == str[0]; });
 }