/***************************************************************************
- * Copyright (C) 2005-2013 by the Quassel Project *
+ * Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
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 (;;) {
case '\x0f':
mirc += "%O";
break;
+ case '\x09':
+ mirc += " ";
+ break;
case '\x12':
case '\x16':
mirc += "%R";
mirc += QChar(0x2400 + c.unicode());
}
} else {
- if (c == '\t') {
- mirc += " ";
- continue;
- }
if (c == '%')
mirc += c;
mirc += c;