Replace {from,to}Ascii with {from,to}Latin1
[quassel.git] / src / uisupport / uistyle.cpp
index 0e00d51..975c79d 100644 (file)
@@ -491,12 +491,16 @@ QList<QTextLayout::FormatRange> 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 (;;) {
@@ -858,7 +862,7 @@ quint8 UiStyle::StyledMessage::senderHash() const
         if (chopCount < nick.size())
             nick.chop(chopCount);
     }
-    quint16 hash = qChecksum(nick.toAscii().data(), nick.toAscii().size());
+    quint16 hash = qChecksum(nick.toLatin1().data(), nick.toLatin1().size());
     return (_senderHash = (hash & 0xf) + 1);
 }