Make the style engine fix a little less obscure by copying the string explicitely...
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 20 Mar 2008 10:51:49 +0000 (10:51 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 20 Mar 2008 10:51:49 +0000 (10:51 +0000)
formatting it. Apparently, call-by-value does weird things with Qt's implicit sharing, at least
that is my interpretation of things...

src/uisupport/uistyle.cpp
src/uisupport/uistyle.h
version.inc

index 0420a7c..e04a0bd 100644 (file)
@@ -129,13 +129,9 @@ QString UiStyle::formatCode(FormatType ftype) const {
   return _formatCodes.key(ftype);
 }
 
   return _formatCodes.key(ftype);
 }
 
-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);
+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<FormatType> fmtList;
 
   StyledText result;
   QList<FormatType> fmtList;
index 4d98330..c722be8 100644 (file)
@@ -58,7 +58,7 @@ class UiStyle {
       QList<UrlInfo> urls;
     };
 
       QList<UrlInfo> urls;
     };
 
-    StyledText styleString(QString);
+    StyledText styleString(const QString &);
 
     void setFormat(FormatType, QTextCharFormat, Settings::Mode mode/* = Settings::Custom*/);
     QTextCharFormat format(FormatType, Settings::Mode mode = Settings::Custom) const;
 
     void setFormat(FormatType, QTextCharFormat, Settings::Mode mode/* = Settings::Custom*/);
     QTextCharFormat format(FormatType, Settings::Mode mode = Settings::Custom) const;
index 14b4ad2..20604aa 100644 (file)
@@ -4,8 +4,8 @@
 { using namespace Global;
 
   quasselVersion = "0.2.0-alpha4-pre";
 { using namespace Global;
 
   quasselVersion = "0.2.0-alpha4-pre";
-  quasselDate = "2008-03-18";
-  quasselBuild = 649;
+  quasselDate = "2008-03-20";
+  quasselBuild = 651;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 642;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 642;