forked from qt-creator/qt-creator
QmlProfiler: Sanitize the signal exchange between models a bit
The model manager should only set its state to 'Done' if all models are actually done. When that is the case it can safely emit dataAvailable, too, freeing us of the need to apply a heuristic to the progress percentage. In order to have a unified interface to the completion of model processing an abstract base class for QML and V8 models is introduced. Task-number: QTCREATORBUG-11466 Change-Id: Id89c7ef5e24004baab7f37ee5486b69e7611aee0 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qv8profilerdatamodel.h"
|
||||
#include "qmlprofilermodelmanager.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
@@ -107,8 +108,8 @@ public:
|
||||
qint64 v8MeasuredTime;
|
||||
};
|
||||
|
||||
QV8ProfilerDataModel::QV8ProfilerDataModel(QObject *parent)
|
||||
: QObject(parent)
|
||||
QV8ProfilerDataModel::QV8ProfilerDataModel(QmlProfilerModelManager *parent)
|
||||
: QmlProfilerBaseModel(parent)
|
||||
, d(new QV8ProfilerDataModelPrivate(this))
|
||||
{
|
||||
d->v8MeasuredTime = 0;
|
||||
@@ -128,7 +129,7 @@ void QV8ProfilerDataModel::clear()
|
||||
d->clearV8RootEvent();
|
||||
d->v8MeasuredTime = 0;
|
||||
|
||||
emit changed();
|
||||
QmlProfilerBaseModel::clear();
|
||||
}
|
||||
|
||||
bool QV8ProfilerDataModel::isEmpty() const
|
||||
@@ -482,7 +483,7 @@ void QV8ProfilerDataModel::load(QXmlStreamReader &stream)
|
||||
void QV8ProfilerDataModel::complete()
|
||||
{
|
||||
collectV8Statistics();
|
||||
emit changed();
|
||||
QmlProfilerBaseModel::complete();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user