This obscure "fix" fixes garbled chatwidget fonts for me. I say obscure, because...
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 20 Mar 2008 10:27:31 +0000 (10:27 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 20 Mar 2008 10:27:31 +0000 (10:27 +0000)
is comparing the incoming string to something and don't use the result at all. That magically makes
things work here, which causes me to believe that I've triggered some gcc or Qt bug...

Please tell me if this fixes squished fonts for you as well (as in my case, it was formats wrongly applied).

src/uisupport/uistyle.cpp

index 017fee2..0420a7c 100644 (file)
@@ -130,6 +130,13 @@ QString UiStyle::formatCode(FormatType ftype) const {
 }
 
 UiStyle::StyledText UiStyle::styleString(QString s) {
 }
 
 UiStyle::StyledText UiStyle::styleString(QString s) {
+  // FIXME
+  // The following two lines fix garbled fonts for me. I have no effing clue how or why.
+  // Without comparing s to something (anything), invalid formats with negative lengths are created...
+  // This smells like a gcc/Qt error or something, but maybe it's my fault somehow.
+  bool flg = (s == "foo");
+  Q_UNUSED(flg);
+
   StyledText result;
   QList<FormatType> fmtList;
   fmtList.append(None);
   StyledText result;
   QList<FormatType> fmtList;
   fmtList.append(None);
@@ -137,7 +144,7 @@ UiStyle::StyledText UiStyle::styleString(QString s) {
   curFmtRng.format = format(None);
   curFmtRng.start = 0;
   result.formats.append(curFmtRng);
   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);
   int fgCol = -1, bgCol = -1;  // marks current mIRC color
   for(;;) {
     pos = s.indexOf('%', pos);