Remove ancient and unused leftovers
authorGunnar Sletta <gunnar.sletta@digia.com>
Mon, 21 Oct 2013 13:22:23 +0000 (15:22 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 22 Oct 2013 10:34:05 +0000 (12:34 +0200)
Change-Id: Ia3a2aa2244748c2f3f2df8853f5bddfbbc4bc19f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
src/quick/items/qquickflickable.cpp
src/quick/items/qquickitem.cpp
src/quick/items/qquickitem_p.h
src/quick/items/qquickpathview.cpp

index b94d8dd..f0a68b1 100644 (file)
@@ -948,16 +948,15 @@ void QQuickFlickable::setPixelAligned(bool align)
 
 qint64 QQuickFlickablePrivate::computeCurrentTime(QInputEvent *event)
 {
-    if (0 != event->timestamp() && QQuickItemPrivate::consistentTime == -1)
+    if (0 != event->timestamp())
         return event->timestamp();
-
-    return QQuickItemPrivate::elapsed(timer);
+    return timer.elapsed();
 }
 
 void QQuickFlickablePrivate::handleMousePressEvent(QMouseEvent *event)
 {
     Q_Q(QQuickFlickable);
-    QQuickItemPrivate::start(timer);
+    timer.start();
     if (interactive && timeline.isActive()
         && ((qAbs(hData.smoothVelocity.value()) > RetainGrabVelocity && !hData.fixingUp && !hData.inOvershoot)
             || (qAbs(vData.smoothVelocity.value()) > RetainGrabVelocity && !vData.fixingUp && !vData.inOvershoot))) {
@@ -1016,8 +1015,8 @@ void QQuickFlickablePrivate::handleMousePressEvent(QMouseEvent *event)
     if (wasFlicking)
         emit q->flickingChanged();
     lastPosTime = lastPressTime = computeCurrentTime(event);
-    QQuickItemPrivate::start(vData.velocityTime);
-    QQuickItemPrivate::start(hData.velocityTime);
+    vData.velocityTime.start();
+    hData.velocityTime.start();
 }
 
 void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event)
@@ -1466,7 +1465,7 @@ void QQuickFlickablePrivate::viewportAxisMoved(AxisData &data, qreal minExtent,
                                            QQuickTimeLineCallback::Callback fixupCallback)
 {
     if (pressed || calcVelocity) {
-        int elapsed = QQuickItemPrivate::restart(data.velocityTime);
+        int elapsed = data.velocityTime.restart();
         if (elapsed > 0) {
             qreal velocity = (data.lastPos - data.move.value()) * 1000 / elapsed;
             if (qAbs(velocity) > 0) {
index 73bca67..c3b221b 100644 (file)
@@ -7030,58 +7030,6 @@ QDebug operator<<(QDebug debug, QQuickItem *item)
 }
 #endif
 
-qint64 QQuickItemPrivate::consistentTime = -1;
-void QQuickItemPrivate::setConsistentTime(qint64 t)
-{
-    consistentTime = t;
-}
-
-class QElapsedTimerConsistentTimeHack
-{
-public:
-    void start() {
-        t1 = QQuickItemPrivate::consistentTime;
-        t2 = 0;
-    }
-    qint64 elapsed() {
-        return QQuickItemPrivate::consistentTime - t1;
-    }
-    qint64 restart() {
-        qint64 val = QQuickItemPrivate::consistentTime - t1;
-        t1 = QQuickItemPrivate::consistentTime;
-        t2 = 0;
-        return val;
-    }
-
-private:
-    qint64 t1;
-    qint64 t2;
-};
-
-void QQuickItemPrivate::start(QElapsedTimer &t)
-{
-    if (QQuickItemPrivate::consistentTime == -1)
-        t.start();
-    else
-        ((QElapsedTimerConsistentTimeHack*)&t)->start();
-}
-
-qint64 QQuickItemPrivate::elapsed(QElapsedTimer &t)
-{
-    if (QQuickItemPrivate::consistentTime == -1)
-        return t.elapsed();
-    else
-        return ((QElapsedTimerConsistentTimeHack*)&t)->elapsed();
-}
-
-qint64 QQuickItemPrivate::restart(QElapsedTimer &t)
-{
-    if (QQuickItemPrivate::consistentTime == -1)
-        return t.restart();
-    else
-        return ((QElapsedTimerConsistentTimeHack*)&t)->restart();
-}
-
 /*!
     \fn bool QQuickItem::isTextureProvider() const
 
index b1e63e6..f731aca 100644 (file)
@@ -587,12 +587,6 @@ public:
 
     virtual void mirrorChange() {}
 
-    static qint64 consistentTime;
-    static void setConsistentTime(qint64 t);
-    static void start(QElapsedTimer &);
-    static qint64 elapsed(QElapsedTimer &);
-    static qint64 restart(QElapsedTimer &);
-
     void incrementCursorCount(int delta);
 };
 
index ff31d9d..d8132bd 100644 (file)
@@ -1568,11 +1568,9 @@ qreal QQuickPathViewPrivate::calcVelocity() const
 
 qint64 QQuickPathViewPrivate::computeCurrentTime(QInputEvent *event)
 {
-    if (0 != event->timestamp() && QQuickItemPrivate::consistentTime == -1) {
+    if (0 != event->timestamp())
         return event->timestamp();
-    }
-
-    return QQuickItemPrivate::elapsed(timer);
+    return timer.elapsed();
 }
 
 void QQuickPathView::mousePressEvent(QMouseEvent *event)
@@ -1613,7 +1611,7 @@ void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event)
     else
         stealMouse = false;
 
-    QQuickItemPrivate::start(timer);
+    timer.start();
     lastPosTime = computeCurrentTime(event);
     tl.clear();
 }