]> git.sesse.net Git - kdenlive/blobdiff - src/beziercurve/cubicbezierspline.cpp
Const'ref
[kdenlive] / src / beziercurve / cubicbezierspline.cpp
index 175aed213494107ef0414af18a36cf1ad8613201..45cca94ce1649da2f04b0dfd7a1c036438a853ca 100644 (file)
@@ -17,7 +17,7 @@
  ***************************************************************************/
 
 #include "cubicbezierspline.h"
-
+#include <KDebug>
 
 /** @brief For sorting a Bezier spline. Whether a is before b. */
 static bool pointLessThan(const BPoint &a, const BPoint &b)
@@ -48,12 +48,12 @@ void CubicBezierSpline::fromString(const QString& spline)
 {
     m_points.clear();
 
-    QStringList bpoints = spline.split('|');
+    const QStringList bpoints = spline.split(QLatin1Char('|'));
     foreach(const QString &bpoint, bpoints) {
-        QStringList points = bpoint.split('#');
+        const QStringList points = bpoint.split(QLatin1Char('#'));
         QList <QPointF> values;
         foreach(const QString &point, points) {
-            QStringList xy = point.split(';');
+            QStringList xy = point.split(QLatin1Char(';'));
             if (xy.count() == 2)
                 values.append(QPointF(xy.at(0).toDouble(), xy.at(1).toDouble()));
         }
@@ -69,10 +69,11 @@ void CubicBezierSpline::fromString(const QString& spline)
 QString CubicBezierSpline::toString() const
 {
     QStringList spline;
+    QLocale locale;
     foreach(const BPoint &p, m_points) {
-        spline << QString("%1;%2#%3;%4#%5;%6").arg(p.h1.x()).arg(p.h1.y())
-                                              .arg(p.p.x()).arg(p.p.y())
-                                              .arg(p.h2.x()).arg(p.h2.y());
+        spline << QString("%1;%2#%3;%4#%5;%6").arg(locale.toString(p.h1.x())).arg(locale.toString(p.h1.y()))
+                                              .arg(locale.toString(p.p.x())).arg(locale.toString(p.p.y()))
+                                              .arg(locale.toString(p.h2.x())).arg(locale.toString(p.h2.y()));
     }
     return spline.join("|");
 }
@@ -85,7 +86,7 @@ int CubicBezierSpline::setPoint(int ix, const BPoint& point)
     return indexOf(point); // in case it changed
 }
 
-QList <BPoint> CubicBezierSpline::points()
+QList <BPoint> CubicBezierSpline::points() const
 {
     return m_points;
 }