QmlProfiler: Move notes into the notes model

There is not reason to keep them in the general data model and cross
reference between the models all the time.

Change-Id: Ic77c518928dcd6234555cb3f6a830bcc3dc4a1a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-04-26 12:26:46 +02:00
parent d6f351b689
commit 54b1106f4b
6 changed files with 32 additions and 37 deletions

View File

@@ -164,7 +164,6 @@ QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *fin
d->state = Empty;
d->traceTime = new QmlProfilerTraceTime(this);
d->notesModel = new QmlProfilerNotesModel(this);
d->notesModel->setModelManager(this);
}
QmlProfilerModelManager::~QmlProfilerModelManager()
@@ -335,7 +334,7 @@ void QmlProfilerModelManager::save(const QString &filename)
writer->setTraceTime(traceTime()->startTime(), traceTime()->endTime(),
traceTime()->duration());
writer->setData(d->model->eventTypes(), d->model->events());
writer->setNotes(d->model->notes());
writer->setNotes(d->notesModel->notes());
connect(writer, &QObject::destroyed, this, &QmlProfilerModelManager::saveFinished,
Qt::QueuedConnection);
@@ -373,7 +372,7 @@ void QmlProfilerModelManager::load(const QString &filename)
connect(reader, &QmlProfilerFileReader::success, this, [this, reader]() {
d->model->setData(reader->traceStart(), qMax(reader->traceStart(), reader->traceEnd()),
reader->eventTypes(), reader->events());
d->model->setNotes(reader->notes());
d->notesModel->setNotes(reader->notes());
setRecordedFeatures(reader->loadedFeatures());
d->traceTime->increaseEndTime(d->model->lastTimeMark());
delete reader;