projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modernize: Use auto where the type is clear from context
[quassel.git]
/
src
/
uisupport
/
uistyle.cpp
diff --git
a/src/uisupport/uistyle.cpp
b/src/uisupport/uistyle.cpp
index
cbae7e6
..
8b7a4f0
100644
(file)
--- 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);
// 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 {
// AM/PM style used
_systemTimestampFormatString = " h:mm:ss ap";
} else {
@@
-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');
}
else if (s[pos+1] == 'R') { // Reverse colors
fgChar = (fgChar == 'f' ? 'b' : 'f');
-
quint32
orig = static_cast<quint32>(curfmt.type & 0xffc00000);
+
auto
orig = static_cast<quint32>(curfmt.type & 0xffc00000);
curfmt.type &= 0x003fffff;
curfmt.type |= (orig & 0x00400000) <<1;
curfmt.type |= (orig & 0x0f000000) <<4;
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<quint32>(key));
-}
-
-#else
-
uint qHash(UiStyle::ItemFormatType key, uint seed)
{
return qHash(static_cast<quint32>(key), seed);
}
uint qHash(UiStyle::ItemFormatType key, uint seed)
{
return qHash(static_cast<quint32>(key), seed);
}
-#endif
+
UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs)
{
return static_cast<UiStyle::FormatType>(static_cast<quint32>(lhs) | static_cast<quint32>(rhs));
}
UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs)
{
return static_cast<UiStyle::FormatType>(static_cast<quint32>(lhs) | static_cast<quint32>(rhs));
}
+
UiStyle::FormatType& operator|=(UiStyle::FormatType& lhs, UiStyle::FormatType rhs)
{
lhs = static_cast<UiStyle::FormatType>(static_cast<quint32>(lhs) | static_cast<quint32>(rhs));
UiStyle::FormatType& operator|=(UiStyle::FormatType& lhs, UiStyle::FormatType rhs)
{
lhs = static_cast<UiStyle::FormatType>(static_cast<quint32>(lhs) | static_cast<quint32>(rhs));
@@
-1271,8
+1264,8
@@
UiStyle::ItemFormatType& operator|=(UiStyle::ItemFormatType &lhs, UiStyle::ItemF
QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList)
{
out << static_cast<quint16>(formatList.size());
QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList)
{
out << static_cast<quint16>(formatList.size());
-
UiStyle::FormatList::const_iterator it = formatList.
begin();
- while (it != formatList.end()) {
+
auto it = formatList.c
begin();
+ while (it != formatList.
c
end()) {
out << it->first
<< static_cast<quint32>(it->second.type)
<< it->second.foreground
out << it->first
<< static_cast<quint32>(it->second.type)
<< it->second.foreground