qDebug()<<"tried to get a state for an empty frame";
return;
}
- index = frame->calls().first()->index();
+ index = frame->lastCallIndex();
} else {
qDebug()<<"Unknown event type";
return;
this, SLOT(replayError(const QString&)));
connect(m_retracer, SIGNAL(foundState(ApiTraceState*)),
this, SLOT(replayStateFound(ApiTraceState*)));
- connect(m_retracer, SIGNAL(retraceErrors(const QList<RetraceError>&)),
- this, SLOT(slotRetraceErrors(const QList<RetraceError>&)));
+ connect(m_retracer, SIGNAL(retraceErrors(const QList<ApiTraceError>&)),
+ this, SLOT(slotRetraceErrors(const QList<ApiTraceError>&)));
connect(m_ui.vertexInterpretButton, SIGNAL(clicked()),
m_vdataInterpreter, SLOT(interpretData()));
m_ui.nonDefaultsCB->blockSignals(false);
ApiTraceFrame *firstFrame =
m_trace->frameAt(0);
- ApiTraceEvent *oldSelected = m_selectedEvent;
if (!firstFrame)
return;
+ if (!firstFrame->loaded()) {
+ m_trace->loadFrame(firstFrame);
+ return;
+ }
+ ApiTraceCall *firstCall = firstFrame->calls().first();
+ ApiTraceEvent *oldSelected = m_selectedEvent;
m_nonDefaultsLookupEvent = m_selectedEvent;
- m_selectedEvent = firstFrame;
+ m_selectedEvent = firstCall;
lookupState();
m_selectedEvent = oldSelected;
}
}
}
-void MainWindow::slotRetraceErrors(const QList<RetraceError> &errors)
+void MainWindow::slotRetraceErrors(const QList<ApiTraceError> &errors)
{
m_ui.errorsTreeWidget->clear();
- foreach(RetraceError error, errors) {
- ApiTraceCall *call = m_trace->callWithIndex(error.callIndex);
- if (!call)
- continue;
- call->setError(error.message);
+ foreach(ApiTraceError error, errors) {
+ m_trace->setCallError(error);
QTreeWidgetItem *item =
new QTreeWidgetItem(m_ui.errorsTreeWidget);
item->setData(0, Qt::DisplayRole, error.callIndex);
- item->setData(0, Qt::UserRole, QVariant::fromValue(call));
+ item->setData(0, Qt::UserRole, error.callIndex);
QString type = error.type;
type[0] = type[0].toUpper();
item->setData(1, Qt::DisplayRole, type);
void MainWindow::slotErrorSelected(QTreeWidgetItem *current)
{
if (current) {
- ApiTraceCall *call =
- current->data(0, Qt::UserRole).value<ApiTraceCall*>();
- Q_ASSERT(call);
- QModelIndex index = m_proxyModel->indexForCall(call);
- if (index.isValid()) {
- m_ui.callView->setCurrentIndex(index);
- } else {
- statusBar()->showMessage(tr("Call has been filtered out."));
- }
+ int callIndex =
+ current->data(0, Qt::UserRole).toInt();
+ m_trace->findCallIndex(callIndex);
}
}
QModelIndex index = m_proxyModel->indexForCall(call);
if (index.isValid()) {
m_ui.callView->setCurrentIndex(index);
+ } else {
+ statusBar()->showMessage(tr("Call has been filtered out."));
}
}