From: Montel Laurent Date: Thu, 30 May 2013 07:28:31 +0000 (+0200) Subject: Remove virtual keyword, fix include, fix indent X-Git-Url: https://git.sesse.net/?p=kdenlive;a=commitdiff_plain;h=8dd310a8ec870fbe688165a007504a300ae8ca98 Remove virtual keyword, fix include, fix indent --- diff --git a/src/commands/editclipcutcommand.cpp b/src/commands/editclipcutcommand.cpp index 2d0f92f1..7bdfc53b 100644 --- a/src/commands/editclipcutcommand.cpp +++ b/src/commands/editclipcutcommand.cpp @@ -21,6 +21,7 @@ #include "projectlist.h" #include +#include EditClipCutCommand::EditClipCutCommand(ProjectList *list, const QString &id, const QPoint &oldZone, const QPoint &newZone, const QString &oldComment, const QString &newComment, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), @@ -46,7 +47,8 @@ void EditClipCutCommand::undo() void EditClipCutCommand::redo() { kDebug() << "---- redoing action"; - if (m_doIt) m_list->doUpdateClipCut(m_id, m_oldZone, m_newZone, m_newComment); + if (m_doIt) + m_list->doUpdateClipCut(m_id, m_oldZone, m_newZone, m_newComment); m_doIt = true; } diff --git a/src/commands/editclipcutcommand.h b/src/commands/editclipcutcommand.h index dbd2af98..16f52ba5 100644 --- a/src/commands/editclipcutcommand.h +++ b/src/commands/editclipcutcommand.h @@ -24,8 +24,6 @@ #include #include -#include - class ProjectList; class EditClipCutCommand : public QUndoCommand @@ -33,8 +31,8 @@ class EditClipCutCommand : public QUndoCommand public: EditClipCutCommand(ProjectList *list, const QString &id, const QPoint &oldZone, const QPoint &newZone, const QString &oldComment, const QString &newComment, bool doIt, QUndoCommand * parent = 0); - virtual void undo(); - virtual void redo(); + void undo(); + void redo(); private: ProjectList *m_list; diff --git a/src/commands/editeffectcommand.cpp b/src/commands/editeffectcommand.cpp index dd9c00d3..3fb2a33d 100644 --- a/src/commands/editeffectcommand.cpp +++ b/src/commands/editeffectcommand.cpp @@ -20,24 +20,26 @@ #include "editeffectcommand.h" #include "customtrackview.h" - +#include #include EditEffectCommand::EditEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &oldeffect, const QDomElement &effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent) : - QUndoCommand(parent), - m_view(view), - m_track(track), - m_oldeffect(oldeffect), - m_effect(effect), - m_pos(pos), - m_stackPos(stackPos), - m_doIt(doIt), - m_refreshEffectStack(refreshEffectStack) + QUndoCommand(parent), + m_view(view), + m_track(track), + m_oldeffect(oldeffect), + m_effect(effect), + m_pos(pos), + m_stackPos(stackPos), + m_doIt(doIt), + m_refreshEffectStack(refreshEffectStack) { QString effectName; QDomElement namenode = effect.firstChildElement("name"); - if (!namenode.isNull()) effectName = i18n(namenode.text().toUtf8().data()); - else effectName = i18n("effect"); + if (!namenode.isNull()) + effectName = i18n(namenode.text().toUtf8().data()); + else + effectName = i18n("effect"); setText(i18n("Edit effect %1", effectName)); } @@ -50,10 +52,14 @@ int EditEffectCommand::id() const // virtual bool EditEffectCommand::mergeWith(const QUndoCommand * other) { - if (other->id() != id()) return false; - if (m_track != static_cast(other)->m_track) return false; - if (m_stackPos != static_cast(other)->m_stackPos) return false; - if (m_pos != static_cast(other)->m_pos) return false; + if (other->id() != id()) + return false; + if (m_track != static_cast(other)->m_track) + return false; + if (m_stackPos != static_cast(other)->m_stackPos) + return false; + if (m_pos != static_cast(other)->m_pos) + return false; m_effect = static_cast(other)->m_effect.cloneNode().toElement(); return true; } @@ -67,7 +73,7 @@ void EditEffectCommand::undo() void EditEffectCommand::redo() { if (m_doIt) { - m_view->updateEffect(m_track, m_pos, m_effect, m_refreshEffectStack); + m_view->updateEffect(m_track, m_pos, m_effect, m_refreshEffectStack); } m_doIt = true; m_refreshEffectStack = true; diff --git a/src/commands/editeffectcommand.h b/src/commands/editeffectcommand.h index 8d63c86f..1f0a266e 100644 --- a/src/commands/editeffectcommand.h +++ b/src/commands/editeffectcommand.h @@ -22,7 +22,6 @@ #define EDITEFFECTCOMMAND_H #include -#include #include #include @@ -35,8 +34,8 @@ public: virtual int id() const; virtual bool mergeWith(const QUndoCommand * command); - virtual void undo(); - virtual void redo(); + void undo(); + void redo(); private: CustomTrackView *m_view; diff --git a/src/commands/editfoldercommand.h b/src/commands/editfoldercommand.h index 64429292..3b62cb5d 100644 --- a/src/commands/editfoldercommand.h +++ b/src/commands/editfoldercommand.h @@ -30,8 +30,8 @@ class EditFolderCommand : public QUndoCommand public: EditFolderCommand(ProjectList *view, const QString &newfolderName, const QString &oldfolderName, const QString &clipId, bool doIt, QUndoCommand *parent = 0); - virtual void undo(); - virtual void redo(); + void undo(); + void redo(); private: ProjectList *m_view; diff --git a/src/commands/editguidecommand.cpp b/src/commands/editguidecommand.cpp index 7e12a7b3..0f5ece09 100644 --- a/src/commands/editguidecommand.cpp +++ b/src/commands/editguidecommand.cpp @@ -22,24 +22,26 @@ #include EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime &oldPos, const QString &oldcomment, const GenTime &pos, const QString &comment, bool doIt, QUndoCommand * parent) : - QUndoCommand(parent), - m_view(view), - m_oldcomment(oldcomment), - m_comment(comment), - m_oldPos(oldPos), - m_pos(pos), - m_doIt(doIt) + QUndoCommand(parent), + m_view(view), + m_oldcomment(oldcomment), + m_comment(comment), + m_oldPos(oldPos), + m_pos(pos), + m_doIt(doIt) { if (m_oldcomment.isEmpty()) { - setText(i18n("Add guide")); - m_oldPos = GenTime(-1); + setText(i18n("Add guide")); + m_oldPos = GenTime(-1); } - else if (m_oldPos == m_pos) setText(i18n("Edit guide")); - else if (m_pos < GenTime() && m_comment.isEmpty()) setText(i18n("Delete guide")); - else setText(i18n("Move guide")); + else if (m_oldPos == m_pos) + setText(i18n("Edit guide")); + else if (m_pos < GenTime() && m_comment.isEmpty()) + setText(i18n("Delete guide")); + else + setText(i18n("Move guide")); } - // virtual void EditGuideCommand::undo() { diff --git a/src/commands/editguidecommand.h b/src/commands/editguidecommand.h index 189f5e4b..b317f839 100644 --- a/src/commands/editguidecommand.h +++ b/src/commands/editguidecommand.h @@ -19,10 +19,6 @@ #define GUIDECOMMAND_H #include -#include -#include -#include -#include #include "gentime.h" #include "definitions.h" @@ -33,8 +29,8 @@ class EditGuideCommand : public QUndoCommand { public: EditGuideCommand(CustomTrackView *view, const GenTime &oldPos, const QString &oldcomment, const GenTime &pos, const QString &comment, bool doIt, QUndoCommand * parent = 0); - virtual void undo(); - virtual void redo(); + void undo(); + void redo(); private: CustomTrackView *m_view; diff --git a/src/commands/editkeyframecommand.cpp b/src/commands/editkeyframecommand.cpp index 64b7a29d..bf5de55d 100644 --- a/src/commands/editkeyframecommand.cpp +++ b/src/commands/editkeyframecommand.cpp @@ -22,20 +22,23 @@ #include EditKeyFrameCommand::EditKeyFrameCommand(CustomTrackView *view, const int track, const GenTime &pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt) : - QUndoCommand(), - m_view(view), - m_oldkfr(oldkeyframes), - m_newkfr(newkeyframes), - m_track(track), - m_index(effectIndex), - m_pos(pos), - m_doIt(doIt) + QUndoCommand(), + m_view(view), + m_oldkfr(oldkeyframes), + m_newkfr(newkeyframes), + m_track(track), + m_index(effectIndex), + m_pos(pos), + m_doIt(doIt) { - int prev = m_oldkfr.split(';', QString::SkipEmptyParts).count(); - int next = m_newkfr.split(';', QString::SkipEmptyParts).count(); - if (prev == next) setText(i18n("Edit keyframe")); - else if (prev > next) setText(i18n("Delete keyframe")); - else setText(i18n("Add keyframe")); + int prev = m_oldkfr.split(QLatin1Char(';'), QString::SkipEmptyParts).count(); + int next = m_newkfr.split(QLatin1Char(';'), QString::SkipEmptyParts).count(); + if (prev == next) + setText(i18n("Edit keyframe")); + else if (prev > next) + setText(i18n("Delete keyframe")); + else + setText(i18n("Add keyframe")); //kDebug() << "/// CREATE GUIDE COMMAND, TIMES: " << m_oldPos.frames(25) << "x" << m_pos.frames(25); } diff --git a/src/commands/editkeyframecommand.h b/src/commands/editkeyframecommand.h index 2a2b5b2b..81ece609 100644 --- a/src/commands/editkeyframecommand.h +++ b/src/commands/editkeyframecommand.h @@ -19,10 +19,6 @@ #define KEYFRAMECOMMAND_H #include -#include -#include -#include -#include #include "gentime.h" #include "definitions.h" @@ -33,8 +29,8 @@ class EditKeyFrameCommand : public QUndoCommand { public: EditKeyFrameCommand(CustomTrackView *view, const int track, const GenTime &pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt); - virtual void undo(); - virtual void redo(); + void undo(); + void redo(); private: CustomTrackView *m_view; diff --git a/src/commands/groupclipscommand.cpp b/src/commands/groupclipscommand.cpp index fa77295d..d8f2417a 100644 --- a/src/commands/groupclipscommand.cpp +++ b/src/commands/groupclipscommand.cpp @@ -22,23 +22,26 @@ #include "customtrackview.h" #include +#include GroupClipsCommand::GroupClipsCommand(CustomTrackView *view, const QList &clipInfos, const QList & transitionInfos, bool group, QUndoCommand * parent) : - QUndoCommand(parent), - m_view(view), - m_clips(clipInfos), - m_transitions(transitionInfos), - m_group(group) + QUndoCommand(parent), + m_view(view), + m_clips(clipInfos), + m_transitions(transitionInfos), + m_group(group) { - if (m_group) setText(i18n("Group clips")); - else setText(i18n("Ungroup clips")); + if (m_group) + setText(i18n("Group clips")); + else + setText(i18n("Ungroup clips")); } // virtual void GroupClipsCommand::undo() { -// kDebug()<<"---- undoing action"; + // kDebug()<<"---- undoing action"; m_view->doGroupClips(m_clips, m_transitions, !m_group); } // virtual diff --git a/src/commands/groupclipscommand.h b/src/commands/groupclipscommand.h index d1dd427b..9e8728c4 100644 --- a/src/commands/groupclipscommand.h +++ b/src/commands/groupclipscommand.h @@ -22,10 +22,7 @@ #define GROUPCLIPSCOMMAND_H #include -#include -#include -#include #include "definitions.h" class CustomTrackView; @@ -34,8 +31,8 @@ class GroupClipsCommand : public QUndoCommand { public: GroupClipsCommand(CustomTrackView *view, const QList &clipInfos, const QList &transitionInfos, bool group, QUndoCommand * parent = 0); - virtual void undo(); - virtual void redo(); + void undo(); + void redo(); private: CustomTrackView *m_view; diff --git a/src/commands/insertspacecommand.cpp b/src/commands/insertspacecommand.cpp index 3e5a784a..d06556f4 100644 --- a/src/commands/insertspacecommand.cpp +++ b/src/commands/insertspacecommand.cpp @@ -24,16 +24,18 @@ #include InsertSpaceCommand::InsertSpaceCommand(CustomTrackView *view, const QList &clipsToMove, const QList &transToMove, int track, const GenTime &duration, bool doIt, QUndoCommand * parent) : - QUndoCommand(parent), - m_view(view), - m_clipsToMove(clipsToMove), - m_transToMove(transToMove), - m_duration(duration), - m_track(track), - m_doIt(doIt) + QUndoCommand(parent), + m_view(view), + m_clipsToMove(clipsToMove), + m_transToMove(transToMove), + m_duration(duration), + m_track(track), + m_doIt(doIt) { - if (duration > GenTime()) setText(i18n("Insert space")); - else setText(i18n("Remove space")); + if (duration > GenTime()) + setText(i18n("Insert space")); + else + setText(i18n("Remove space")); } // virtual diff --git a/src/commands/insertspacecommand.h b/src/commands/insertspacecommand.h index ab8d97dc..d41ec20e 100644 --- a/src/commands/insertspacecommand.h +++ b/src/commands/insertspacecommand.h @@ -22,9 +22,7 @@ #define INSERTSPACECOMMAND_H #include -#include -#include #include "definitions.h" class CustomTrackView; @@ -33,8 +31,8 @@ class InsertSpaceCommand : public QUndoCommand { public: InsertSpaceCommand(CustomTrackView *view, const QList &clipsToMove, const QList &transToMove, int track, const GenTime &duration, bool doIt, QUndoCommand * parent = 0); - virtual void undo(); - virtual void redo(); + void undo(); + void redo(); private: CustomTrackView *m_view;