X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.cpp;h=f7edcbc88295718a9d794c0e3ad168f46162410a;hp=879fc3504810704d1074c7c83cf0745e7389eb79;hb=1a45f16a9734820fba42fe1db3f38dd1eee49df6;hpb=b7447afe8e836376776dac26704e227a678d2913 diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 879fc350..f7edcbc8 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -222,7 +222,7 @@ void UiStyle::updateSystemTimestampFormat() // Helpful interactive website for debugging and explaining: https://regex101.com/ const QRegExp regExpMatchAMPM(".*(\\b|_)(A|AP)(\\b|_).*", Qt::CaseInsensitive); - if (regExpMatchAMPM.exactMatch(QLocale::system().timeFormat(QLocale::ShortFormat))) { + if (regExpMatchAMPM.exactMatch(QLocale().timeFormat(QLocale::ShortFormat))) { // AM/PM style used _systemTimestampFormatString = " h:mm:ss ap"; } else { @@ -475,7 +475,7 @@ QTextCharFormat UiStyle::format(const Format &format, MessageLabel label) const // Merge all formats except mIRC and extended colors mergeFormat(charFormat, format, label & 0xffff0000); // keep nickhash in label - for (quint32 mask = 0x00000001; mask <= static_cast(MessageLabel::Selected); mask <<= 1) { + for (quint32 mask = 0x00000001; mask <= static_cast(MessageLabel::Last); mask <<= 1) { if (static_cast(label) & mask) { mergeFormat(charFormat, format, label & (mask | 0xffff0000)); } @@ -485,7 +485,7 @@ QTextCharFormat UiStyle::format(const Format &format, MessageLabel label) const // unless the AllowForegroundOverride or AllowBackgroundOverride properties are set (via stylesheet). if (_allowMircColors) { mergeColors(charFormat, format, MessageLabel::None); - for (quint32 mask = 0x00000001; mask <= static_cast(MessageLabel::Selected); mask <<= 1) { + for (quint32 mask = 0x00000001; mask <= static_cast(MessageLabel::Last); mask <<= 1) { if (static_cast(label) & mask) { mergeColors(charFormat, format, label & mask); } @@ -1150,25 +1150,18 @@ quint8 UiStyle::StyledMessage::senderHash() const /***********************************************************************************/ -#if QT_VERSION < 0x050000 -uint qHash(UiStyle::ItemFormatType key) -{ - return qHash(static_cast(key)); -} - -#else - uint qHash(UiStyle::ItemFormatType key, uint seed) { return qHash(static_cast(key), seed); } -#endif + UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs) { return static_cast(static_cast(lhs) | static_cast(rhs)); } + UiStyle::FormatType& operator|=(UiStyle::FormatType& lhs, UiStyle::FormatType rhs) { lhs = static_cast(static_cast(lhs) | static_cast(rhs));