Commit db7c7559 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: eliminate redundant categories() methods



Change-Id: I3a85322cc583de37f1cc4eb256e3382a92c5c179
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent adada0b9
......@@ -47,7 +47,7 @@ void AbstractTimelineModel::setModelManager(QmlProfilerModelManager *modelManage
QStringList AbstractTimelineModel::categoryTitles() const
{
QStringList retString;
for (int i = 0; i < categories(); i++)
for (int i = 0; i < categoryCount(); i++)
retString << categoryLabel(i);
return retString;
}
......
......@@ -50,7 +50,6 @@ public:
void setModelManager(QmlProfilerModelManager *modelManager);
virtual int categories() const = 0;
QStringList categoryTitles() const;
virtual QString name() const = 0;
virtual int count() const = 0;
......
......@@ -387,7 +387,7 @@ Rectangle {
color: "#dcdcdc"
height: col.height
property int rowCount: qmlProfilerModelProxy.categories();
property int rowCount: qmlProfilerModelProxy.categoryCount();
Column {
id: col
......
......@@ -77,11 +77,6 @@ PaintEventsModelProxy::~PaintEventsModelProxy()
delete d;
}
int PaintEventsModelProxy::categories() const
{
return categoryCount();
}
QString PaintEventsModelProxy::name() const
{
return QLatin1String("PaintEventsModelProxy");
......
......@@ -63,8 +63,6 @@ public:
PaintEventsModelProxy(QObject *parent = 0);
~PaintEventsModelProxy();
int categories() const;
QString name() const;
void loadData();
......
......@@ -84,11 +84,6 @@ BasicTimelineModel::~BasicTimelineModel()
delete d;
}
int BasicTimelineModel::categories() const
{
return categoryCount();
}
QString BasicTimelineModel::name() const
{
return QLatin1String("BasicTimelineModel");
......
......@@ -82,8 +82,6 @@ public:
BasicTimelineModel(QObject *parent = 0);
~BasicTimelineModel();
int categories() const;
QString name() const;
void loadData();
......
......@@ -95,11 +95,11 @@ void TimelineModelAggregator::addModel(AbstractTimelineModel *m)
}
// order?
int TimelineModelAggregator::categories() const
int TimelineModelAggregator::categoryCount() const
{
int categoryCount = 0;
foreach (const AbstractTimelineModel *modelProxy, d->modelList)
categoryCount += modelProxy->categories();
categoryCount += modelProxy->categoryCount();
return categoryCount;
}
......@@ -107,7 +107,7 @@ int TimelineModelAggregator::visibleCategories() const
{
int categoryCount = 0;
foreach (const AbstractTimelineModel *modelProxy, d->modelList) {
for (int i = 0; i < modelProxy->categories(); i++)
for (int i = 0; i < modelProxy->categoryCount(); i++)
if (modelProxy->categoryDepth(i) > 0)
categoryCount ++;
}
......
......@@ -47,7 +47,7 @@ public:
void addModel(AbstractTimelineModel *m);
Q_INVOKABLE int categories() const;
Q_INVOKABLE int categoryCount() const;
Q_INVOKABLE int visibleCategories() const;
Q_INVOKABLE QStringList categoryTitles() const;
Q_INVOKABLE int count(int modelIndex = -1) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment