aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-05-11 13:58:20 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-05-23 11:44:13 +0000
commit1093be042513e643fe11e364164d59f11476ba27 (patch)
treedd0f2adfc26d3ec66e4c7131dad41495992b1b9f /src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
parent46e043ed1ed273b2dd8b4a000f6644c8ca1d09f1 (diff)
QmlProfiler: Remove detailed progress tracking
The progress bar in the state widget was rather meaningless. We rarely know how many events we expect and it's rather hard to tell how long each model will take to process them. Instead, we just show a 0-ranged progress bar to tell the user that "something is happening". Change-Id: Icb80840d1f0a1538bcf254faa37cbb36e25d342c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp50
1 files changed, 3 insertions, 47 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
index 206fe7aa59..b194d937fb 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
@@ -132,24 +132,17 @@ public:
QmlProfilerModelManager::State state;
QmlProfilerTraceTime *traceTime;
- QVector<double> partialCounts;
- QVector<int> partialCountWeights;
+ int numRegisteredModels;
quint64 availableFeatures;
quint64 visibleFeatures;
quint64 recordedFeatures;
-
- int totalWeight;
- double progress;
- double previousProgress;
};
QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *finder, QObject *parent) :
QObject(parent), d(new QmlProfilerModelManagerPrivate)
{
- d->totalWeight = 0;
- d->previousProgress = 0;
- d->progress = 0;
+ d->numRegisteredModels = 0;
d->availableFeatures = 0;
d->visibleFeatures = 0;
d->recordedFeatures = 0;
@@ -184,42 +177,9 @@ bool QmlProfilerModelManager::isEmpty() const
return d->model->isEmpty();
}
-double QmlProfilerModelManager::progress() const
-{
- return d->progress;
-}
-
int QmlProfilerModelManager::registerModelProxy()
{
- d->partialCounts << 0;
- d->partialCountWeights << 1;
- d->totalWeight++;
- return d->partialCounts.count()-1;
-}
-
-void QmlProfilerModelManager::setProxyCountWeight(int proxyId, int weight)
-{
- d->totalWeight += weight - d->partialCountWeights[proxyId];
- d->partialCountWeights[proxyId] = weight;
-}
-
-void QmlProfilerModelManager::modelProxyCountUpdated(int proxyId, qint64 count, qint64 max)
-{
- d->progress -= d->partialCounts[proxyId] * d->partialCountWeights[proxyId] /
- d->totalWeight;
-
- if (max <= 0)
- d->partialCounts[proxyId] = 1;
- else
- d->partialCounts[proxyId] = (double)count / (double) max;
-
- d->progress += d->partialCounts[proxyId] * d->partialCountWeights[proxyId] /
- d->totalWeight;
-
- if (d->progress - d->previousProgress > 0.01) {
- d->previousProgress = d->progress;
- emit progressChanged();
- }
+ return d->numRegisteredModels++;
}
void QmlProfilerModelManager::announceFeatures(int proxyId, quint64 features)
@@ -423,10 +383,6 @@ QmlProfilerModelManager::State QmlProfilerModelManager::state() const
void QmlProfilerModelManager::clear()
{
setState(ClearingData);
- for (int i = 0; i < d->partialCounts.count(); i++)
- d->partialCounts[i] = 0;
- d->progress = 0;
- d->previousProgress = 0;
d->model->clear();
d->traceTime->clear();
d->notesModel->clear();