X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fold-uistyle.cpp;h=bbbe48e66f8982876935ee071a9f5085d3ab3c68;hp=94c9742bef3b9e57042922eb82cddca07006cb63;hb=63af36e607d250637aaba0bba14d2158e79c7bed;hpb=e017aca90eb3444df68fb365a5d50b05881b1c5c diff --git a/src/uisupport/old-uistyle.cpp b/src/uisupport/old-uistyle.cpp index 94c9742b..bbbe48e6 100644 --- a/src/uisupport/old-uistyle.cpp +++ b/src/uisupport/old-uistyle.cpp @@ -139,7 +139,7 @@ UiStyle::StyledText UiStyle::styleString(const QString &_s) { QTextLayout::FormatRange curFmtRng; curFmtRng.format = format(None); curFmtRng.start = 0; - result.formats.append(curFmtRng); + result.formatList.append(curFmtRng); int pos = 0; int length = 0; int fgCol = -1, bgCol = -1; // marks current mIRC color for(;;) { @@ -199,7 +199,7 @@ UiStyle::StyledText UiStyle::styleString(const QString &_s) { if(s[pos+1] == 'D') code += s[pos+2]; FormatType ftype = formatType(code); if(ftype == Invalid) { - qWarning(qPrintable(QString("Invalid format code in string: %1").arg(s))); + qWarning("%s", qPrintable(QString("Invalid format code in string: %1").arg(s))); continue; } //Q_ASSERT(ftype != Invalid); @@ -216,20 +216,20 @@ UiStyle::StyledText UiStyle::styleString(const QString &_s) { } s.remove(pos, length); // remove format code from string // now see if something changed and else insert the format - if(curFmtRng.format == result.formats.last().format) continue; // no change, so we just ignore + if(curFmtRng.format == result.formatList.last().format) continue; // no change, so we just ignore curFmtRng.start = pos; - if(pos == result.formats.last().start) { + if(pos == result.formatList.last().start) { // same starting point -> we just overwrite the old format - result.formats.last() = curFmtRng; + result.formatList.last() = curFmtRng; } else { // fix length of last format - result.formats.last().length = pos - result.formats.last().start; - result.formats.append(curFmtRng); + result.formatList.last().length = pos - result.formatList.last().start; + result.formatList.append(curFmtRng); } } - result.formats.last().length = s.length() - result.formats.last().start; - if(result.formats.last().length == 0) result.formats.removeLast(); - result.text = s; + result.formatList.last().length = s.length() - result.formatList.last().start; + if(result.formatList.last().length == 0) result.formatList.removeLast(); + result.plainText = s; return result; }