]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kitemlistsmoothscroller.cpp
KFileItemListWidget: wrong selection when renamed file ends with a dot
[dolphin.git] / src / kitemviews / private / kitemlistsmoothscroller.cpp
index fd26d198f23b5c4a8dd22ccf0dec4ad9d71e18ea..0e75460441abe4ba6c29bd5343d3384e0a2ab82e 100644 (file)
@@ -56,6 +56,9 @@ QScrollBar *KItemListSmoothScroller::scrollBar() const
 
 void KItemListSmoothScroller::setTargetObject(QObject *target)
 {
+    if (m_animation->state() == QAbstractAnimation::Running) {
+        m_animation->stop();
+    }
     m_animation->setTargetObject(target);
 }
 
@@ -66,6 +69,9 @@ QObject *KItemListSmoothScroller::targetObject() const
 
 void KItemListSmoothScroller::setPropertyName(const QByteArray &propertyName)
 {
+    if (m_animation->state() == QAbstractAnimation::Running) {
+        m_animation->stop();
+    }
     m_animation->setPropertyName(propertyName);
 }
 
@@ -214,4 +220,12 @@ void KItemListSmoothScroller::handleWheelEvent(QWheelEvent *event)
     m_smoothScrolling = previous;
 }
 
+bool KItemListSmoothScroller::isAnimating()
+{
+    if (m_animation) {
+        return (m_animation->state() == QAbstractAnimation::Running);
+    }
+    return false;
+}
+
 #include "moc_kitemlistsmoothscroller.cpp"