X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.cpp;h=8c5ce840a530f90174d52a630d90180904357b9c;hb=05c43ed7ab8eca002538670970cff4edb66f1011;hp=df23a62e52c5bf1a303c26e7001353bde1cbe93e;hpb=4c80eeb2d07b5ca75fd399b51c939961fdff1670;p=quassel.git diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index df23a62e..8c5ce840 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -491,12 +491,16 @@ QList UiStyle::toTextLayoutList(const FormatList &form UiStyle::StyledString UiStyle::styleString(const QString &s_, quint32 baseFormat) { QString s = s_; + StyledString result; + result.formatList.append(qMakePair((quint16)0, baseFormat)); + if (s.length() > 65535) { + // We use quint16 for indexes qWarning() << QString("String too long to be styled: %1").arg(s); - return StyledString(); + result.plainText = s; + return result; } - StyledString result; - result.formatList.append(qMakePair((quint16)0, baseFormat)); + quint32 curfmt = baseFormat; int pos = 0; quint16 length = 0; for (;;) { @@ -572,6 +576,9 @@ QString UiStyle::mircToInternal(const QString &mirc_) case '\x0f': mirc += "%O"; break; + case '\x09': + mirc += " "; + break; case '\x12': case '\x16': mirc += "%R"; @@ -589,10 +596,6 @@ QString UiStyle::mircToInternal(const QString &mirc_) mirc += QChar(0x2400 + c.unicode()); } } else { - if (c == '\t') { - mirc += " "; - continue; - } if (c == '%') mirc += c; mirc += c; @@ -717,7 +720,7 @@ void UiStyle::StyledMessage::style() const case Message::DayChange: { //: Day Change Message - t = tr("{Day changed to %1}").arg(QLocale().toString(timestamp(), QLocale().dateFormat())); + t = tr("{Day changed to %1}").arg(timestamp().date().toString(Qt::DefaultLocaleLongDate)); } break; case Message::Topic: