]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use qAbs() instead of fabs(). The values in question are integers
authorFrank Reininghaus <frank78ac@googlemail.com>
Sat, 13 Jun 2009 10:05:35 +0000 (10:05 +0000)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sat, 13 Jun 2009 10:05:35 +0000 (10:05 +0000)
anyway (so fabs() is not the 'right' function for them), and this
change makes the Sun Studio compiler happy.

Thanks to tropikhajma at gmail.com for the patch.

BUG: 196265

svn path=/trunk/KDE/kdebase/apps/; revision=981325

src/dolphinviewautoscroller.cpp

index 4e7af7f59fa9ad77f9fdd2b858d74a9115446069..75dab3214cb6f28a52dd20bd2f0f019e58b2a74a 100644 (file)
@@ -167,12 +167,12 @@ int DolphinViewAutoScroller::calculateScrollIncrement(int cursorPos, int rangeSi
     const int autoScrollBorder = 64;
 
     if (cursorPos < autoScrollBorder) {
-        inc = -minSpeed + fabs(cursorPos - autoScrollBorder) * (cursorPos - autoScrollBorder) / speedLimiter;
+        inc = -minSpeed + qAbs(cursorPos - autoScrollBorder) * (cursorPos - autoScrollBorder) / speedLimiter;
         if (inc < -maxSpeed) {
             inc = -maxSpeed;
         }
     } else if (cursorPos > rangeSize - autoScrollBorder) {
-        inc = minSpeed + fabs(cursorPos - rangeSize + autoScrollBorder) * (cursorPos - rangeSize + autoScrollBorder) / speedLimiter;
+        inc = minSpeed + qAbs(cursorPos - rangeSize + autoScrollBorder) * (cursorPos - rangeSize + autoScrollBorder) / speedLimiter;
         if (inc > maxSpeed) {
             inc = maxSpeed;
         }