QmlProfiler: Eliminate ambiguity from TimelineModelAggregator::count()

It wasn't helpful that this method could either count all events or
only the events from a specific model.

Change-Id: I09dcb37edd3403a23f6ee9008fc71b6761aa9e26
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-09-29 12:36:29 +02:00
parent dbb4e761ef
commit cfaa30d0b9
5 changed files with 12 additions and 17 deletions

View File

@@ -408,7 +408,7 @@ void TimelineRenderer::manageHovered(int mouseX, int mouseY)
int eventFrom = m_profilerModelProxy->firstIndex(modelIndex, startTime);
int eventTo = m_profilerModelProxy->lastIndex(modelIndex, endTime);
if (eventFrom == -1 ||
eventTo < eventFrom || eventTo >= m_profilerModelProxy->count()) {
eventTo < eventFrom || eventTo >= m_profilerModelProxy->count(modelIndex)) {
m_currentSelection.eventIndex = -1;
return;
}
@@ -464,7 +464,7 @@ void TimelineRenderer::clearData()
int TimelineRenderer::getYPosition(int modelIndex, int index) const
{
Q_ASSERT(m_profilerModelProxy);
if (index >= m_profilerModelProxy->count())
if (index >= m_profilerModelProxy->count(modelIndex))
return 0;
int modelRowStart = 0;
@@ -477,7 +477,7 @@ int TimelineRenderer::getYPosition(int modelIndex, int index) const
void TimelineRenderer::selectNext()
{
if (m_profilerModelProxy->count() == 0)
if (m_profilerModelProxy->isEmpty())
return;
qint64 searchTime = m_startTime;
@@ -533,7 +533,7 @@ void TimelineRenderer::selectNext()
void TimelineRenderer::selectPrev()
{
if (m_profilerModelProxy->count() == 0)
if (m_profilerModelProxy->isEmpty())
return;
qint64 searchTime = m_endTime;