]> git.sesse.net Git - kdenlive/commitdiff
const'ref, Remove not necessary virtual keyword. Fix includes
authorMontel Laurent <montel@kde.org>
Thu, 30 May 2013 07:16:50 +0000 (09:16 +0200)
committerMontel Laurent <montel@kde.org>
Thu, 30 May 2013 07:16:50 +0000 (09:16 +0200)
17 files changed:
src/beziercurve/cubicbezierspline.cpp
src/beziercurve/cubicbezierspline.h
src/commands/addclipcommand.cpp
src/commands/addclipcommand.h
src/commands/addclipcutcommand.cpp
src/commands/addclipcutcommand.h
src/commands/addeffectcommand.cpp
src/commands/addeffectcommand.h
src/commands/addextradatacommand.cpp
src/commands/addextradatacommand.h
src/commands/addfoldercommand.cpp
src/commands/addfoldercommand.h
src/commands/addmarkercommand.cpp
src/commands/addmarkercommand.h
src/commands/addtimelineclipcommand.cpp
src/commands/addtimelineclipcommand.h
testingArea/audioOffset.cpp

index 13b1b73e082137f6aaed07ac1e761bef95c03653..45cca94ce1649da2f04b0dfd7a1c036438a853ca 100644 (file)
@@ -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()));
         }
@@ -86,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;
 }
index 21024bd2da946e6fb2a982c2593f0c220d715f1c..7cd0275e5bc3905375402f918e9b8cb11f14c463 100644 (file)
@@ -49,7 +49,7 @@ public:
     QString toString() const;
 
     /** @brief Returns a list of the points defining the spline. */
-    QList <BPoint> points();
+    QList <BPoint> points() const;
 
     /** @brief Sets the point at index @param ix to @param point and returns its index (it might have changed during validation). */
     int setPoint(int ix, const BPoint &point);
index 44df4d5b11c9f57ef593ceb3bc7ba7a919f3773a..d8cc2e48c969d1d7dc09f352b20d1193cf2277fa 100644 (file)
@@ -39,14 +39,18 @@ AddClipCommand::AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const Q
 void AddClipCommand::undo()
 {
     kDebug() << "----  undoing action";
-    if (m_doIt) m_doc->deleteClip(m_id);
-    else m_doc->addClip(m_xml, m_id);
+    if (m_doIt)
+        m_doc->deleteClip(m_id);
+    else
+        m_doc->addClip(m_xml, m_id);
 }
 // virtual
 void AddClipCommand::redo()
 {
     kDebug() << "----  redoing action";
-    if (m_doIt) m_doc->addClip(m_xml, m_id);
-    else m_doc->deleteClip(m_id);
+    if (m_doIt)
+        m_doc->addClip(m_xml, m_id);
+    else
+        m_doc->deleteClip(m_id);
 }
 
index a549ee682a275aca976020cb6352685d99608512..bf8a34193aaf2a35a7eaa252aee5be39d4cbf447 100644 (file)
@@ -32,8 +32,8 @@ class AddClipCommand : public QUndoCommand
 public:
     AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent = 0);
 
-    virtual void undo();
-    virtual void redo();
+    void undo();
+    void redo();
 
 private:
     KdenliveDoc *m_doc;
index 09920054d4733e3c196c64f5b2f3ef18263b7636..6faec7634a2eebdd05b95ba9ff4c45762f1c1c10 100644 (file)
@@ -39,13 +39,17 @@ AddClipCutCommand::AddClipCutCommand(ProjectList *list, const QString &id, int i
 // virtual
 void AddClipCutCommand::undo()
 {
-    if (m_remove) m_list->addClipCut(m_id, m_in, m_out, m_desc, m_newItem);
-    else m_list->removeClipCut(m_id, m_in, m_out);
+    if (m_remove)
+        m_list->addClipCut(m_id, m_in, m_out, m_desc, m_newItem);
+    else
+        m_list->removeClipCut(m_id, m_in, m_out);
 }
 // virtual
 void AddClipCutCommand::redo()
 {
-    if (m_remove) m_list->removeClipCut(m_id, m_in, m_out);
-    else m_list->addClipCut(m_id, m_in, m_out, m_desc, m_newItem);
+    if (m_remove)
+        m_list->removeClipCut(m_id, m_in, m_out);
+    else
+        m_list->addClipCut(m_id, m_in, m_out, m_desc, m_newItem);
 }
 
index 3fc2126409ca2830c4253e05e8888ccee3806af0..e1c8c234b6b0643839ded23c3b60f6d9ef77c708 100644 (file)
@@ -31,8 +31,8 @@ class AddClipCutCommand : public QUndoCommand
 public:
     AddClipCutCommand(ProjectList *list, const QString &id, int in, int out, const QString &desc, bool newItem, bool remove, QUndoCommand * parent = 0);
 
-    virtual void undo();
-    virtual void redo();
+    void undo();
+    void redo();
 
 private:
     ProjectList *m_list;
index f858ecb3fd53722aab173439a3b4e985a16efded..399ec59fd36ec438afcd3d795a7f25702812cad0 100644 (file)
@@ -33,10 +33,15 @@ AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, const
 {
     QString effectName;
     QDomElement namenode = m_effect.firstChildElement("name");
-    if (!namenode.isNull()) effectName = i18n(namenode.text().toUtf8().data());
-    else effectName = i18n("effect");
-    if (doIt) setText(i18n("Add %1", effectName));
-    else setText(i18n("Delete %1", effectName));
+    if (!namenode.isNull())
+        effectName = i18n(namenode.text().toUtf8().data());
+    else
+        effectName = i18n("effect");
+
+    if (doIt)
+        setText(i18n("Add %1", effectName));
+    else
+        setText(i18n("Delete %1", effectName));
 }
 
 
@@ -44,15 +49,19 @@ AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, const
 void AddEffectCommand::undo()
 {
     kDebug() << "----  undoing action";
-    if (m_doIt) m_view->deleteEffect(m_track, m_pos, m_effect);
-    else m_view->addEffect(m_track, m_pos, m_effect);
+    if (m_doIt)
+        m_view->deleteEffect(m_track, m_pos, m_effect);
+    else
+        m_view->addEffect(m_track, m_pos, m_effect);
 }
 // virtual
 void AddEffectCommand::redo()
 {
     kDebug() << "----  redoing action";
-    if (m_doIt) m_view->addEffect(m_track, m_pos, m_effect);
-    else m_view->deleteEffect(m_track, m_pos, m_effect);
+    if (m_doIt)
+        m_view->addEffect(m_track, m_pos, m_effect);
+    else
+        m_view->deleteEffect(m_track, m_pos, m_effect);
 }
 
 
index 0f01a72535998572f2d64d4097a455a3ee3a3b85..0c29c48bb1b64c2e2b7d2ed01a99c13c7ba89922 100644 (file)
@@ -33,8 +33,8 @@ class AddEffectCommand : public QUndoCommand
 public:
     AddEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &effect, bool doIt, QUndoCommand * parent = 0);
 
-    virtual void undo();
-    virtual void redo();
+    void undo();
+    void redo();
 
 private:
     CustomTrackView *m_view;
index c5ff3289c1cd22ca1343a9c7375134a934aefae9..f2aa5411509255e4b27b31a993b747dbf4312ed0 100644 (file)
@@ -29,8 +29,10 @@ AddExtraDataCommand::AddExtraDataCommand(CustomTrackView *view, const QString&id
         m_key(key),
         m_id(id)
 {
-    if (m_newData.isEmpty()) setText(i18n("Delete data"));
-    else setText(i18n("Add data"));
+    if (m_newData.isEmpty())
+        setText(i18n("Delete data"));
+    else
+        setText(i18n("Add data"));
 }
 
 
index 784d17f47c8583c1ed1d02297346d174fbf89ae9..b3c1d8fad3826f5e18a14ad982fa8f84ae0805ca 100644 (file)
 #define EXTRADATACOMMAND_H
 
 #include <QUndoCommand>
-#include <QGraphicsView>
-#include <QPointF>
-#include <QDomElement>
-#include <KDebug>
 
-#include "gentime.h"
-#include "definitions.h"
 class CustomTrackView;
 
 
@@ -33,8 +27,8 @@ class AddExtraDataCommand : public QUndoCommand
 {
 public:
     AddExtraDataCommand(CustomTrackView *view, const QString&id, const QString&key, const QString &oldData, const QString &newData, QUndoCommand * parent = 0);
-    virtual void undo();
-    virtual void redo();
+    void undo();
+    void redo();
 
 private:
     CustomTrackView *m_view;
index 392a666d2efd89a52f87621196dbf362aa9ccf81..3f5c562f6aedc4dd541324dbd63e2a956ba34bfd 100644 (file)
@@ -30,21 +30,27 @@ AddFolderCommand::AddFolderCommand(ProjectList *view, const QString &folderName,
         m_id(clipId),
         m_doIt(doIt)
 {
-    if (doIt) setText(i18n("Add folder"));
-    else setText(i18n("Delete folder"));
+    if (doIt)
+        setText(i18n("Add folder"));
+    else
+        setText(i18n("Delete folder"));
 }
 
 // virtual
 void AddFolderCommand::undo()
 {
-    if (m_doIt) m_view->slotAddFolder(m_name, m_id, true);
-    else m_view->slotAddFolder(m_name, m_id, false);
+    if (m_doIt)
+        m_view->slotAddFolder(m_name, m_id, true);
+    else
+        m_view->slotAddFolder(m_name, m_id, false);
 }
 // virtual
 void AddFolderCommand::redo()
 {
-    if (m_doIt) m_view->slotAddFolder(m_name, m_id, false);
-    else m_view->slotAddFolder(m_name, m_id, true);
+    if (m_doIt)
+        m_view->slotAddFolder(m_name, m_id, false);
+    else
+        m_view->slotAddFolder(m_name, m_id, true);
 }
 
 
index c9e52c513d47239d2ad166c1ed46c6d683f64e91..c4e91525ac4e7a028d4fe762f0252d001a735fd7 100644 (file)
@@ -30,8 +30,8 @@ class AddFolderCommand : public QUndoCommand
 public:
     AddFolderCommand(ProjectList *view, const QString &folderName, const QString &clipId, bool doIt, QUndoCommand *parent = 0);
 
-    virtual void undo();
-    virtual void redo();
+    void undo();
+    void redo();
 
 private:
     ProjectList *m_view;
index f315f3f49ad5bb7ed28141069e40f4726a52fc3b..46a7d9c17364f344a7d0b793d88e66be02d742b7 100644 (file)
@@ -28,12 +28,14 @@ AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const CommentedTime &o
         m_newMarker(newMarker),
         m_id(id)
 {
-    if (m_newMarker.markerType() < 0) setText(i18n("Delete marker"));
-    else if (m_oldMarker.comment().isEmpty()) setText(i18n("Add marker"));
-    else setText(i18n("Edit marker"));
+    if (m_newMarker.markerType() < 0)
+        setText(i18n("Delete marker"));
+    else if (m_oldMarker.comment().isEmpty())
+        setText(i18n("Add marker"));
+    else
+        setText(i18n("Edit marker"));
 }
 
-
 // virtual
 void AddMarkerCommand::undo()
 {
index f89ca9370727b962850eb6a56fb6cb3a04c72204..09334584e595a65a789237591b89eb50d239451d 100644 (file)
 #define MARKERCOMMAND_H
 
 #include <QUndoCommand>
-#include <QGraphicsView>
-#include <QPointF>
-#include <QDomElement>
-#include <KDebug>
 
 #include "gentime.h"
 #include "definitions.h"
@@ -33,8 +29,8 @@ class AddMarkerCommand : public QUndoCommand
 {
 public:
     AddMarkerCommand(CustomTrackView *view, const CommentedTime &oldMarker, const CommentedTime &newMarker, const QString &id, QUndoCommand * parent = 0);
-    virtual void undo();
-    virtual void redo();
+    void undo();
+    void redo();
 
 private:
     CustomTrackView *m_view;
index f6befebf427300fb67cfcc15f3caf40b8bd5428a..5cc0fe70b096fabee11aba00a7ddaf955e19ae01 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <KLocale>
 
-AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, const QDomElement &xml, const QString &clipId, ItemInfo info, EffectsList effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent) :
+AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, const QDomElement &xml, const QString &clipId, const ItemInfo &info, const EffectsList &effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent) :
         QUndoCommand(parent),
         m_view(view),
         m_clipInfo(info),
@@ -43,15 +43,19 @@ AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, const QDom
 // virtual
 void AddTimelineClipCommand::undo()
 {
-    if (!m_remove) m_view->deleteClip(m_clipInfo);
-    else m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
+    if (!m_remove)
+        m_view->deleteClip(m_clipInfo);
+    else
+        m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
 }
 // virtual
 void AddTimelineClipCommand::redo()
 {
     if (m_doIt) {
-        if (!m_remove) m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
-        else m_view->deleteClip(m_clipInfo);
+        if (!m_remove)
+            m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
+        else
+            m_view->deleteClip(m_clipInfo);
     }
     m_doIt = true;
 }
index 7d508c3957e6957622eb0d2352d104af9b703f93..7a7a1d9d7fd995169d455d23b9cb1774cae07898 100644 (file)
@@ -22,7 +22,6 @@
 #define TIMELINECLIPCOMMAND_H
 
 #include <QUndoCommand>
-#include <QDomElement>
 #include <KDebug>
 
 #include "gentime.h"
@@ -34,9 +33,9 @@ class CustomTrackView;
 class AddTimelineClipCommand : public QUndoCommand
 {
 public:
-    AddTimelineClipCommand(CustomTrackView *view, const QDomElement &xml, const QString &clipId, ItemInfo info, EffectsList effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent = 0);
-    virtual void undo();
-    virtual void redo();
+    AddTimelineClipCommand(CustomTrackView *view, const QDomElement &xml, const QString &clipId, const ItemInfo &info, const EffectsList &effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent = 0);
+    void undo();
+    void redo();
 
 private:
     CustomTrackView *m_view;
index fd2e9c3b2044d347d2db3945c6cf97b3b25f9bdd..f71b105231abff9bf53893809ab33cd9e3d836c2 100644 (file)
@@ -137,11 +137,6 @@ int main(int argc, char *argv[])
     envelopeSub->loadStdDev();
     envelopeSub->dumpInfo();
 
-
-
-
-
-
     // Calculate the correlation and hereby the audio shift
     AudioCorrelation corr(envelopeMain);
     int index = corr.addChild(envelopeSub, useFFT);
@@ -149,25 +144,23 @@ int main(int argc, char *argv[])
     int shift = corr.getShift(index);
     std::cout << " Should be shifted by " << shift << " frames: " << fileSub << std::endl
               << "\trelative to " << fileMain << std::endl
-              << "\tin a " << prodMain.get_fps() << " fps profile (" << profile << ")." << std::endl
-                 ;
+              << "\tin a " << prodMain.get_fps() << " fps profile (" << profile << ")." << std::endl;
 
 
     if (saveImages) {
-        QString outImg;
-        outImg = QString("envelope-main-%1.png")
+        QString outImg = QString::fromLatin1("envelope-main-%1.png")
                 .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd-hh:mm:ss"));
         envelopeMain->drawEnvelope().save(outImg);
         std::cout << "Saved volume envelope as "
                   << QFileInfo(outImg).absoluteFilePath().toStdString()
                   << std::endl;
-        outImg = QString("envelope-sub-%1.png")
+        outImg = QString::fromLatin1("envelope-sub-%1.png")
                 .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd-hh:mm:ss"));
         envelopeSub->drawEnvelope().save(outImg);
         std::cout << "Saved volume envelope as "
                   << QFileInfo(outImg).absoluteFilePath().toStdString()
                   << std::endl;
-        outImg = QString("correlation-%1.png")
+        outImg = QString::fromLatin1("correlation-%1.png")
                 .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd-hh:mm:ss"));
         corr.info(index)->toImage().save(outImg);
         std::cout << "Saved correlation image as "
@@ -176,7 +169,7 @@ int main(int argc, char *argv[])
     }
 
 
-//    Mlt::Factory::close();
+    //    Mlt::Factory::close();
 
 
     return 0;