X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.cpp;h=8b7a4f0f59ae35ac5d734c5e75bea4e888a15da1;hb=f9cd845a9119e0abf450a91d8802f5c1822dd638;hp=038dc8abbd97b3be952d47c854e1a674adae6bf6;hpb=41a136e99bffde8e203fb1abff7c9affbbb16a8b;p=quassel.git diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 038dc8ab..8b7a4f0f 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -709,7 +709,7 @@ UiStyle::StyledString UiStyle::styleString(const QString &s_, FormatType baseFor } else if (s[pos+1] == 'R') { // Reverse colors fgChar = (fgChar == 'f' ? 'b' : 'f'); - quint32 orig = static_cast(curfmt.type & 0xffc00000); + auto orig = static_cast(curfmt.type & 0xffc00000); curfmt.type &= 0x003fffff; curfmt.type |= (orig & 0x00400000) <<1; curfmt.type |= (orig & 0x0f000000) <<4; @@ -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)); @@ -1271,8 +1264,8 @@ UiStyle::ItemFormatType& operator|=(UiStyle::ItemFormatType &lhs, UiStyle::ItemF QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList) { out << static_cast(formatList.size()); - UiStyle::FormatList::const_iterator it = formatList.begin(); - while (it != formatList.end()) { + auto it = formatList.cbegin(); + while (it != formatList.cend()) { out << it->first << static_cast(it->second.type) << it->second.foreground