diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-05-30 11:23:32 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-05-31 07:12:04 +0000 |
commit | 7a681963284b5600bfb7f81ffdebde7020f86360 (patch) | |
tree | 598095bfb568ef3f9310f9d51aa1901e3b75b3f8 | |
parent | 89c42161fa368cfd36f21c3afabec9d8312e3563 (diff) | |
download | qt-creator-7a681963284b5600bfb7f81ffdebde7020f86360.tar.gz |
Tracing: Don't change visible features on clearing and replaying
This used to be important for the mockup in the Timeline, but as the
mockup looks just fine with all available features visible, we can drop
it. As TimelineModel::clear() clears the "hidden" flag, we have to
restore that one on initialize(), though.
As a side effect the visibility settings are retained across profiling
sessions now.
Task-number: QTCREATORBUG-20503
Change-Id: I1512ab7e494ed79d20e2097d68f8494990cfecbb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/libs/tracing/timelinetracemanager.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp | 1 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.cpp | 13 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.h | 1 |
4 files changed, 1 insertions, 16 deletions
diff --git a/src/libs/tracing/timelinetracemanager.cpp b/src/libs/tracing/timelinetracemanager.cpp index 61b9e6257f..9504d7d60a 100644 --- a/src/libs/tracing/timelinetracemanager.cpp +++ b/src/libs/tracing/timelinetracemanager.cpp @@ -357,7 +357,6 @@ void TimelineTraceManager::clearEventStorage() d->reset(); if (d->notesModel) d->notesModel->clear(); - setVisibleFeatures(0); setRecordedFeatures(0); d->eventStorage->clear(); } @@ -385,7 +384,6 @@ void TimelineTraceManager::restrictByFilter(TraceEventFilter filter) d->notesModel->stash(); d->reset(); - setVisibleFeatures(0); QFutureInterface<void> future; replayEvents(filter(std::bind(&TimelineTraceManagerPrivate::dispatch, d, diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp index 82b6ba563b..675646ea4c 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp @@ -105,6 +105,7 @@ QVariantMap QmlProfilerTimelineModel::locationFromTypeId(int index) const void QmlProfilerTimelineModel::initialize() { + setHidden(!(modelManager()->visibleFeatures() & (1ULL << m_mainFeature))); } void QmlProfilerTimelineModel::finalize() diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index af0ae935a8..94b74c1504 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -662,18 +662,6 @@ bool QmlProfilerTool::checkForUnsavedNotes() QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes; } -void QmlProfilerTool::restoreFeatureVisibility() -{ - // Restore the shown/hidden state of features to what the user selected. When clearing data the - // the model manager sets its features to 0, and models get automatically shown, for the mockup. - quint64 features = 0; - foreach (const QAction *action, d->m_displayFeaturesMenu->actions()) { - if (action->isChecked()) - features |= (1ULL << action->data().toUInt()); - } - d->m_profilerModelManager->setVisibleFeatures(features); -} - void QmlProfilerTool::clientsDisconnected() { if (d->m_toolBusy) { @@ -745,7 +733,6 @@ void QmlProfilerTool::setRecordedFeatures(quint64 features) void QmlProfilerTool::initialize() { - restoreFeatureVisibility(); setButtonsEnabled(false); // Other buttons disabled } diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h index c96a40587f..180f1c090c 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.h +++ b/src/plugins/qmlprofiler/qmlprofilertool.h @@ -103,7 +103,6 @@ private: template<ProfileFeature feature> void updateFeatures(quint64 features); bool checkForUnsavedNotes(); - void restoreFeatureVisibility(); void setButtonsEnabled(bool enable); void createInitialTextMarks(); |