aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2015-05-18 13:11:17 +0200
committerUlf Hermann <[email protected]>2015-05-18 12:35:25 +0000
commitef09282c2277865c67a52f8709c475d877b61712 (patch)
treeb1153ccba3f88b7ed443862ef2da2d89dacfabd8
parent84ae26e8086a6ee6a74c5763b808a5fb17f34f19 (diff)
Timeline: Don't use window movement logic when clearing zoom control
Otherwise we get a lot of confusing noise in that case. Change-Id: I0fb77b0ae841fd863790acd86f2b24acab0e7374 Reviewed-by: Joerg Bornemann <[email protected]>
-rw-r--r--src/libs/timeline/timelinezoomcontrol.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/libs/timeline/timelinezoomcontrol.cpp b/src/libs/timeline/timelinezoomcontrol.cpp
index 6833c227628..cd7f164375d 100644
--- a/src/libs/timeline/timelinezoomcontrol.cpp
+++ b/src/libs/timeline/timelinezoomcontrol.cpp
@@ -28,6 +28,7 @@
****************************************************************************/
#include "timelinezoomcontrol.h"
+#include <utils/qtcassert.h>
namespace Timeline {
@@ -41,9 +42,26 @@ TimelineZoomControl::TimelineZoomControl(QObject *parent) : QObject(parent),
void TimelineZoomControl::clear()
{
- m_timer.stop();
+ bool changeTrace = (m_traceStart != -1 || m_traceEnd != -1);
+ bool changeWindow = (m_windowStart != -1 || m_windowEnd != -1);
+ bool changeRange = (m_rangeStart != -1 || m_rangeEnd != -1);
+
setWindowLocked(false);
- setTrace(-1, -1); // automatically sets window and range
+
+ m_traceStart = m_traceEnd = m_windowStart = m_windowEnd = m_rangeStart = m_rangeEnd = -1;
+ if (changeTrace)
+ emit traceChanged(-1, -1);
+
+ if (changeWindow) {
+ emit windowChanged(-1, -1);
+ m_timer.stop();
+ } else {
+ QTC_ASSERT(!m_timer.isActive(), m_timer.stop());
+ }
+
+ if (changeRange)
+ emit rangeChanged(-1, -1);
+
setSelection(-1, -1);
}