QmlProfiler: Filter event types also on client side

Like this we can still save some time and memory if the profiled
application doesn't support filtering.

Change-Id: I534ad4a11f62d28bd2fcfbffdc44f3902758dcbe
Task-number: QTBUG-41118
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-09-10 13:51:36 +02:00
parent 6d58de0bad
commit 69743fef93
3 changed files with 174 additions and 137 deletions

View File

@@ -44,15 +44,6 @@
namespace QmlProfiler {
namespace Internal {
static const QmlDebug::ProfileFeature RangeFeatures[QmlDebug::MaximumRangeType] = {
QmlDebug::ProfilePainting,
QmlDebug::ProfileCompiling,
QmlDebug::ProfileCreating,
QmlDebug::ProfileBinding,
QmlDebug::ProfileHandlingSignal,
QmlDebug::ProfileJavaScript
};
class RangeTimelineModel::RangeTimelineModelPrivate : public AbstractTimelineModelPrivate
{
public:
@@ -82,7 +73,7 @@ RangeTimelineModel::RangeTimelineModel(QmlDebug::RangeType rangeType, QObject *p
quint64 RangeTimelineModel::features() const
{
Q_D(const RangeTimelineModel);
return 1 << RangeFeatures[d->rangeType];
return 1 << QmlDebug::featureFromRangeType(d->rangeType);
}
void RangeTimelineModel::clear()
@@ -239,18 +230,8 @@ int RangeTimelineModel::rowCount() const
QString RangeTimelineModel::categoryLabel(QmlDebug::RangeType rangeType)
{
switch (rangeType) {
case QmlDebug::Painting:
case QmlDebug::Compiling:
case QmlDebug::Creating:
case QmlDebug::Binding:
case QmlDebug::HandlingSignal:
case QmlDebug::Javascript:
return QCoreApplication::translate("MainView",
QmlProfilerModelManager::featureName(RangeFeatures[rangeType]));
default:
return QString();
}
return QCoreApplication::translate("MainView",
QmlProfilerModelManager::featureName(QmlDebug::featureFromRangeType(rangeType)));
}
int RangeTimelineModel::row(int index) const