From aa40491595ffec54ba340a9850d99dc14d920eb3 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Thu, 20 Mar 2008 10:51:49 +0000 Subject: [PATCH 1/1] Make the style engine fix a little less obscure by copying the string explicitely before 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 | 10 +++------- src/uisupport/uistyle.h | 2 +- version.inc | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 0420a7c8..e04a0bd0 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -129,13 +129,9 @@ QString UiStyle::formatCode(FormatType ftype) const { 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 fmtList; diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 4d983309..c722be82 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -58,7 +58,7 @@ class UiStyle { QList 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; diff --git a/version.inc b/version.inc index 14b4ad24..20604aa2 100644 --- a/version.inc +++ b/version.inc @@ -4,8 +4,8 @@ { 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; -- 2.20.1