X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.cpp;h=e04a0bd0508987d8b72416867ab4491aed87b4ef;hp=8c62b373ec4b54cc39760719a488095c179f2e1d;hb=aa40491595ffec54ba340a9850d99dc14d920eb3;hpb=8010224cf5bfe5685dc2cf535e8dc1ec19c4c364 diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 8c62b373..e04a0bd0 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -78,6 +78,9 @@ UiStyle::UiStyle(const QString &settingsKey) : _settingsKey(settingsKey) { QTextCharFormat fgf, bgf; fgf.setForeground(QBrush(QColor(colors[i]))); setFormat((FormatType)(FgCol00 + i), fgf, Settings::Default); bgf.setBackground(QBrush(QColor(colors[i]))); setFormat((FormatType)(BgCol00 + i), bgf, Settings::Default); + //FIXME fix the havoc caused by ColorSettingsPage + setFormat((FormatType)(FgCol00 + i), fgf, Settings::Custom); + setFormat((FormatType)(BgCol00 + i), bgf, Settings::Custom); } // Set a few more standard formats @@ -126,7 +129,10 @@ QString UiStyle::formatCode(FormatType ftype) const { return _formatCodes.key(ftype); } -UiStyle::StyledText UiStyle::styleString(QString s) { +UiStyle::StyledText UiStyle::styleString(const QString &_s) { + QString s = _s; // we can't use call-by-value since this seems to maybe screw up Qt's implicit sharing somehow + // at least invalid formats are created if we do that + StyledText result; QList fmtList; fmtList.append(None); @@ -134,7 +140,7 @@ UiStyle::StyledText UiStyle::styleString(QString s) { curFmtRng.format = format(None); curFmtRng.start = 0; result.formats.append(curFmtRng); - int pos = 0; int length; + int pos = 0; int length = 0; int fgCol = -1, bgCol = -1; // marks current mIRC color for(;;) { pos = s.indexOf('%', pos);