From dd7f230899131db2fa281c30f162918ab7ff361c Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 31 Mar 2011 22:55:57 -0400 Subject: [PATCH] shorten really long arguments text layouting on megs of shader code and binary data is just a bad idea. --- gui/apitracecall.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gui/apitracecall.cpp b/gui/apitracecall.cpp index ccb0f63..dd05eee 100644 --- a/gui/apitracecall.cpp +++ b/gui/apitracecall.cpp @@ -233,7 +233,21 @@ QStaticText ApiTraceCall::staticText() const QString richText = QString::fromLatin1("%1(").arg(name); for (int i = 0; i < argNames.count(); ++i) { richText += QLatin1String(""); - richText += apiVariantToString(argValues[i]); + QString argText = apiVariantToString(argValues[i]); + + //if arguments are really long (e.g. shader text), cut them + // and elide it + if (argText.length() > 40) { + QString shortened = argText.mid(0, 40); + shortened[argText.length() - 5] = '.'; + shortened[argText.length() - 4] = '.'; + shortened[argText.length() - 3] = '.'; + shortened[argText.length() - 2] = argText[argText.length() - 2]; + shortened[argText.length() - 1] = argText[argText.length() - 1]; + richText += shortened; + } else { + richText += argText; + } richText += QLatin1String(""); if (i < argNames.count() - 1) richText += QString::fromLatin1(", "); -- 2.45.2