Don't layout the text when filtering.
authorZack Rusin <zack@kde.org>
Sun, 27 Mar 2011 21:12:06 +0000 (17:12 -0400)
committerZack Rusin <zack@kde.org>
Thu, 31 Mar 2011 02:48:42 +0000 (22:48 -0400)
gui/apitracecall.cpp
gui/apitracecall.h
gui/apitracefilter.cpp

index b964739..f5a5ff7 100644 (file)
@@ -263,3 +263,25 @@ QString ApiTraceCall::richText() const
     staticText();
     return m_richText;
 }
+
+QString ApiTraceCall::filterText() const
+{
+    if (!m_filterText.isEmpty())
+        return m_filterText;
+
+    m_filterText = name;
+    for (int i = 0; i < argNames.count(); ++i) {
+        m_filterText += argNames[i];
+        m_filterText += QString::fromLatin1(" = ");
+        m_filterText += apiVariantToString(argValues[i]);
+        if (i < argNames.count() - 1)
+            m_filterText += QString::fromLatin1(", ");
+    }
+    m_filterText += QLatin1String(")");
+
+    if (returnValue.isValid()) {
+        m_filterText += QLatin1String(" = ");
+        m_filterText += apiVariantToString(returnValue);
+    }
+    return m_filterText;
+}
index 4cfa9ae..e47a88d 100644 (file)
@@ -106,11 +106,13 @@ public:
     QVariantList argValues;
     QVariant returnValue;
 
+    QString filterText() const;
     QString richText() const;
     QStaticText staticText() const;
 private:
     mutable QString m_richText;
     mutable QStaticText m_staticText;
+    mutable QString m_filterText;
 };
 Q_DECLARE_METATYPE(ApiTraceCall);
 Q_DECLARE_METATYPE(ApiTraceCall*);
index 7f7da19..5542ea9 100644 (file)
@@ -31,7 +31,7 @@ bool ApiTraceFilter::filterAcceptsRow(int sourceRow,
     if (function.contains(QLatin1String("wglGetProcAddress")))
         return false;
 
-    QString fullText = call->richText();
+    QString fullText = call->filterText();
     if (function.contains(QLatin1String("glGetString")) &&
         fullText.contains(QLatin1String("GL_EXTENSIONS")))
         return false;