]> git.sesse.net Git - kdenlive/blobdiff - src/kis_cubic_curve.cpp
Add explicit keyword, const'ref, minor optimization
[kdenlive] / src / kis_cubic_curve.cpp
index 849d57b99b247bb0e7440c3e174262c2b093e0cb..a0bc58c139db71231440ac75ebacdccc90da3567 100644 (file)
@@ -24,6 +24,7 @@
 #include <QList>
 #include <QSharedData>
 #include <QStringList>
+#include <QLocale>
 
 template <typename T>
 class KisTridiagonalSystem
@@ -125,8 +126,9 @@ protected:
     int m_intervals;
 
 public:
-    KisCubicSpline() {}
-    KisCubicSpline(const QList<T_point> &a) {
+    KisCubicSpline() : m_begin(0), m_end(0), m_intervals(0) {}
+    KisCubicSpline(const QList<T_point> &a) : m_begin(0), m_end(0),
+      m_intervals(0) {
         createSpline(a);
     }
 
@@ -402,9 +404,10 @@ void KisCubicCurve::removePoint(int idx)
 QString KisCubicCurve::toString() const
 {
     QString sCurve;
+    QLocale locale;
     foreach(const QPointF & pair, d->data->points) {
-        sCurve += QString::number(pair.x());
-        sCurve += ',';
+        sCurve += locale.toString(pair.x());
+        sCurve += '/';
         sCurve += QString::number(pair.y());
         sCurve += ';';
     }
@@ -418,10 +421,10 @@ void KisCubicCurve::fromString(const QString& string)
     QList<QPointF> points;
 
     foreach(const QString & pair, data) {
-        if (pair.indexOf(',') > -1) {
+        if (pair.indexOf('/') > -1) {
             QPointF p;
-            p.rx() = pair.section(',', 0, 0).toDouble();
-            p.ry() = pair.section(',', 1, 1).toDouble();
+            p.rx() = pair.section('/', 0, 0).toDouble();
+            p.ry() = pair.section('/', 1, 1).toDouble();
             points.append(p);
         }
     }