diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-05-19 19:12:14 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-05-20 12:30:50 +0000 |
commit | 1717688c3c885db0f6dacc57a8d75f3d406e833b (patch) | |
tree | 5144d9f787225189e6d941b3b0927cb0d85efb57 | |
parent | f1a176f87fe712ad606bcd1100ced512d43bbfdb (diff) |
Fix QmlDesignerUsageTimeSourcev7.0.2
The switch to design mode seems to be notified twice.
Therefore the timer was started and immediately stopped again.
Change-Id: Icd668b20bb47944f7de2285f560666668643e444
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | src/datasources/qmldesignerusagetimesource.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/datasources/qmldesignerusagetimesource.cpp b/src/datasources/qmldesignerusagetimesource.cpp index 1fc72f9..c10f36e 100644 --- a/src/datasources/qmldesignerusagetimesource.cpp +++ b/src/datasources/qmldesignerusagetimesource.cpp @@ -91,6 +91,13 @@ static bool editingQmlFile() void QmlDesignerUsageTimeSource::updateTrackingState(const QString &modeName) { + static QString lastMode; + + if (lastMode == modeName) + return; + + lastMode = modeName; + if (isDesignMode(modeName) && editingQmlFile() && !isTimeTrackingActive()) { Q_EMIT start(); } else { |