Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit bcfc2e85 authored by Laurent Montel's avatar Laurent Montel 😁

continue to fix using const'ref

parent 54407666
......@@ -56,7 +56,7 @@ public:
void closeAnimation();
virtual OperationType operationMode(const QPointF &pos, Qt::KeyboardModifiers modifiers) = 0;
virtual void updateKeyframes(QDomElement effect) = 0;
virtual void updateKeyframes(const QDomElement &effect) = 0;
virtual GenTime startPos() const ;
virtual GenTime endPos() const ;
virtual int track() const ;
......
......@@ -1983,7 +1983,7 @@ void ClipItem::slotUpdateThumb(QImage img)
update();
}
void ClipItem::updateKeyframes(QDomElement effect)
void ClipItem::updateKeyframes(const QDomElement &effect)
{
QLocale locale;
locale.setNumberOptions(QLocale::OmitGroupSeparator);
......
......@@ -56,7 +56,7 @@ public:
void resizeStart(int posx, bool size = true, bool emitChange = true) Q_DECL_OVERRIDE;
void resizeEnd(int posx, bool emitChange = true) Q_DECL_OVERRIDE;
OperationType operationMode(const QPointF &pos, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
void updateKeyframes(QDomElement effect) Q_DECL_OVERRIDE;
void updateKeyframes(const QDomElement &effect) Q_DECL_OVERRIDE;
static int itemHeight();
ClipType clipType() const;
const QString &getBinId() const;
......
......@@ -2006,7 +2006,7 @@ void CustomTrackView::deleteEffect(int track, const GenTime &pos, const QDomElem
}
}
void CustomTrackView::slotAddGroupEffect(QDomElement effect, AbstractGroupItem *group, AbstractClipItem *dropTarget)
void CustomTrackView::slotAddGroupEffect(const QDomElement &effect, AbstractGroupItem *group, AbstractClipItem *dropTarget)
{
QList<QGraphicsItem *> itemList = group->childItems();
QUndoCommand *effectCommand = new QUndoCommand();
......@@ -2066,7 +2066,7 @@ void CustomTrackView::slotAddEffect(ClipItem *clip, const QDomElement &effect, i
else slotAddEffect(effect, clip->startPos(), clip->track());
}
void CustomTrackView::slotDropEffect(ClipItem *clip, QDomElement effect, GenTime pos, int track)
void CustomTrackView::slotDropEffect(ClipItem *clip, const QDomElement &effect, GenTime pos, int track)
{
if (clip == Q_NULLPTR) return;
slotAddEffect(effect, pos, track);
......@@ -2146,12 +2146,12 @@ AbstractToolManager *CustomTrackView::toolManager(AbstractToolManager::ToolManag
return m_toolManagers.value(trimType);
}
void CustomTrackView::slotAddEffectToCurrentItem(QDomElement effect)
void CustomTrackView::slotAddEffectToCurrentItem(const QDomElement &effect)
{
slotAddEffect(effect, GenTime(), -1);
}
void CustomTrackView::slotAddEffect(QDomElement effect, const GenTime &pos, int track)
void CustomTrackView::slotAddEffect(const QDomElement &effect, const GenTime &pos, int track)
{
QList<QGraphicsItem *> itemList;
QUndoCommand *effectCommand = new QUndoCommand();
......@@ -2548,7 +2548,7 @@ void CustomTrackView::slotUpdateClipEffect(ClipItem *clip, int track, QDomElemen
m_commandStack->push(command);
}
void CustomTrackView::slotUpdateClipRegion(ClipItem *clip, int ix, QString region)
void CustomTrackView::slotUpdateClipRegion(ClipItem *clip, int ix, const QString &region)
{
QDomElement effect = clip->getEffectAtIndex(ix);
QDomElement oldeffect = effect.cloneNode().toElement();
......
......@@ -82,14 +82,14 @@ public:
void setScale(double scaleFactor, double verticalScale);
void deleteClip(const QString &clipId, QUndoCommand *deleteCommand);
/** @brief An effect was dropped on @param clip */
void slotDropEffect(ClipItem *clip, QDomElement effect, GenTime pos, int track);
void slotDropEffect(ClipItem *clip, const QDomElement &effect, GenTime pos, int track);
/** @brief A transition was dropped on @param clip */
void slotDropTransition(ClipItem *clip, QDomElement transition, QPointF scenePos);
/** @brief Add effect to current clip */
void slotAddEffectToCurrentItem(QDomElement effect);
void slotAddEffectToCurrentItem(const QDomElement &effect);
/** @brief Add effect to a clip or selection */
void slotAddEffect(QDomElement effect, const GenTime &pos, int track);
void slotAddGroupEffect(QDomElement effect, AbstractGroupItem *group, AbstractClipItem *dropTarget = Q_NULLPTR);
void slotAddEffect(const QDomElement &effect, const GenTime &pos, int track);
void slotAddGroupEffect(const QDomElement &effect, AbstractGroupItem *group, AbstractClipItem *dropTarget = Q_NULLPTR);
void addEffect(int track, GenTime pos, QDomElement effect);
void deleteEffect(int track, const GenTime &pos, const QDomElement &effect);
void updateEffect(int track, GenTime pos, QDomElement insertedEffect, bool refreshEffectStack = false, bool replaceEffect = false, bool refreshMonitor = true);
......@@ -342,7 +342,7 @@ public slots:
void slotChangeEffectState(ClipItem *clip, int track, QList <int> effectIndexes, bool disable);
void slotChangeEffectPosition(ClipItem *clip, int track, QList <int> currentPos, int newPos);
void slotUpdateClipEffect(ClipItem *clip, int track, QDomElement oldeffect, QDomElement effect, int ix, bool refreshEffectStack = true);
void slotUpdateClipRegion(ClipItem *clip, int ix, QString region);
void slotUpdateClipRegion(ClipItem *clip, int ix, const QString &region);
void slotRefreshEffects(ClipItem *clip);
void setDuration(int duration);
void slotAddTransition(ClipItem* clip, ItemInfo transitionInfo, int endTrack, QDomElement transition = QDomElement());
......
......@@ -47,7 +47,7 @@ public:
GuideType
};
explicit AbstractToolManager(ToolManagerType type, CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
virtual bool mousePress(QMouseEvent *event, ItemInfo info = ItemInfo(), QList<QGraphicsItem *> list = QList<QGraphicsItem *>()) = 0;
virtual bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) = 0;
virtual bool mouseMove(QMouseEvent *event, int pos = 0, int track = -1);
virtual void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) = 0;
virtual void enterEvent(int pos, double trackHeight);
......
......@@ -29,7 +29,7 @@ GuideManager::GuideManager(CustomTrackView *view, DocUndoStack *commandStack) :
{
}
bool GuideManager::mousePress(QMouseEvent *, ItemInfo info, QList<QGraphicsItem *> list)
bool GuideManager::mousePress(QMouseEvent *, const ItemInfo &info, const QList<QGraphicsItem *> &list)
{
Q_UNUSED(info);
m_collisionList = list;
......
......@@ -38,7 +38,7 @@ class GuideManager : public AbstractToolManager
public:
explicit GuideManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
bool mousePress(QMouseEvent *event, ItemInfo info = ItemInfo(), QList<QGraphicsItem *> list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos, int) Q_DECL_OVERRIDE;
/** @brief Check if a guide operation is applicable on items under mouse.
......
......@@ -42,7 +42,7 @@ MoveManager::MoveManager(TransitionHandler *handler, CustomTrackView *view, DocU
m_scrollTimer.setSingleShot(true);
}
bool MoveManager::mousePress(QMouseEvent *event, ItemInfo info, QList<QGraphicsItem *>)
bool MoveManager::mousePress(QMouseEvent *event, const ItemInfo &info, const QList<QGraphicsItem *> &)
{
m_view->setCursor(Qt::ClosedHandCursor);
m_dragMoved = false;
......
......@@ -38,7 +38,7 @@ class MoveManager : public AbstractToolManager
public:
explicit MoveManager(TransitionHandler *handler, CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
bool mousePress(QMouseEvent *event, ItemInfo info = ItemInfo(), QList<QGraphicsItem *> list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos, int) Q_DECL_OVERRIDE;
......
......@@ -39,7 +39,7 @@ RazorManager::RazorManager(CustomTrackView *view, DocUndoStack *commandStack) :
m_cursor = QCursor(razorIcon.pixmap(32, 32));
}
bool RazorManager::mousePress(QMouseEvent *, ItemInfo info, QList<QGraphicsItem *>)
bool RazorManager::mousePress(QMouseEvent *, const ItemInfo &info, const QList<QGraphicsItem *> &)
{
QList<QGraphicsItem *> items;
AbstractClipItem *dragItem = m_view->dragItem();
......
......@@ -41,7 +41,7 @@ class RazorManager : public AbstractToolManager
public:
explicit RazorManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
bool mousePress(QMouseEvent *event, ItemInfo info = ItemInfo(), QList<QGraphicsItem *> list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos = 0, int track = -1) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
void enterEvent(int pos, double trackHeight) Q_DECL_OVERRIDE;
......
......@@ -32,7 +32,7 @@ ResizeManager::ResizeManager(CustomTrackView *view, DocUndoStack *commandStack)
{
}
bool ResizeManager::mousePress(QMouseEvent *event, ItemInfo info, QList<QGraphicsItem *>)
bool ResizeManager::mousePress(QMouseEvent *event, const ItemInfo &info, const QList<QGraphicsItem *> &)
{
m_dragItemInfo = info;
m_controlModifier = event->modifiers();
......
......@@ -34,7 +34,7 @@ class ResizeManager : public AbstractToolManager
public:
explicit ResizeManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
bool mousePress(QMouseEvent *event, ItemInfo info = ItemInfo(), QList<QGraphicsItem *> list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos = 0, int track = -1) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
......
......@@ -39,7 +39,7 @@ SelectManager::SelectManager(CustomTrackView *view, DocUndoStack *commandStack)
{
}
bool SelectManager::mousePress(QMouseEvent *event, ItemInfo info, QList<QGraphicsItem *>)
bool SelectManager::mousePress(QMouseEvent *event, const ItemInfo &info, const QList<QGraphicsItem *> &)
{
Q_UNUSED(info);
m_view->activateMonitor();
......
......@@ -38,7 +38,7 @@ class SelectManager : public AbstractToolManager
public:
explicit SelectManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
bool mousePress(QMouseEvent *event, ItemInfo info = ItemInfo(), QList<QGraphicsItem *> list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos, int) Q_DECL_OVERRIDE;
/** @brief Check if a guide operation is applicable on items under mouse.
......
......@@ -33,7 +33,7 @@ SpacerManager::SpacerManager(CustomTrackView *view, DocUndoStack *commandStack)
{
}
bool SpacerManager::mousePress(QMouseEvent *event, ItemInfo info, QList<QGraphicsItem *>)
bool SpacerManager::mousePress(QMouseEvent *event, const ItemInfo &info, const QList<QGraphicsItem *> &)
{
m_view->clearSelection();
m_view->updateClipTypeActions(Q_NULLPTR);
......
......@@ -35,7 +35,7 @@ class SpacerManager : public AbstractToolManager
public:
explicit SpacerManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
bool mousePress(QMouseEvent *event, ItemInfo info = ItemInfo(), QList<QGraphicsItem *> list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos = 0, int track = -1) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
void initTool(double trackHeight) Q_DECL_OVERRIDE;
......
......@@ -40,7 +40,7 @@ TrimManager::TrimManager(CustomTrackView *view, DocUndoStack *commandStack) : Ab
{
}
bool TrimManager::mousePress(QMouseEvent *, ItemInfo info, QList<QGraphicsItem *>)
bool TrimManager::mousePress(QMouseEvent *, const ItemInfo &info, const QList<QGraphicsItem *> &)
{
return enterTrimMode(info, m_view->prepareMode() == ResizeStart);
}
......
......@@ -40,7 +40,7 @@ class TrimManager : public AbstractToolManager
public:
explicit TrimManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
bool mousePress(QMouseEvent *event, ItemInfo info = ItemInfo(), QList<QGraphicsItem *> list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos, int track = -1) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
bool enterTrimMode(ItemInfo info, bool trimStart);
......
......@@ -645,7 +645,7 @@ TrackInfo Timeline::getTrackInfo(int ix)
return tk->info();
}
bool Timeline::isLastClip(ItemInfo info)
bool Timeline::isLastClip(const ItemInfo &info)
{
Track *tk = track(info.track);
if (tk == Q_NULLPTR) {
......
......@@ -169,7 +169,7 @@ public:
/** @brief Refresh Header Leds */
void updateHeaders();
/** @brief Returns true if position is on the last clip */
bool isLastClip(ItemInfo info);
bool isLastClip(const ItemInfo &info);
/** @brief find lowest video track in timeline. */
int getLowestVideoTrack();
/** @brief Returns the document properties with some added values from timeline. */
......
......@@ -89,7 +89,7 @@ Transition::~Transition()
if (scene()) scene()->removeItem(this);
}
Transition *Transition::clone(ItemInfo newInfo)
Transition *Transition::clone(const ItemInfo &newInfo)
{
const QDomElement xml = toXML().cloneNode().toElement();
Transition *tr = new Transition(newInfo.isValid() ? newInfo : info(), transitionEndTrack(), m_fps, xml);
......@@ -387,7 +387,7 @@ bool Transition::hasGeometry()
return false;
}
bool Transition::updateKeyframes(ItemInfo oldInfo, ItemInfo newInfo)
bool Transition::updateKeyframes(const ItemInfo &oldInfo, const ItemInfo &newInfo)
{
QString keyframes;
QDomElement pa;
......@@ -482,7 +482,7 @@ bool Transition::updateKeyframes(ItemInfo oldInfo, ItemInfo newInfo)
return true;
}
void Transition::updateKeyframes(QDomElement /*effect*/)
void Transition::updateKeyframes(const QDomElement &/*effect*/)
{
}
......
......@@ -55,7 +55,7 @@ public:
QString transitionTag() const;
QStringList transitionInfo() const;
OperationType operationMode(const QPointF &pos, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
void updateKeyframes(QDomElement effect) Q_DECL_OVERRIDE;
void updateKeyframes(const QDomElement &effect) Q_DECL_OVERRIDE;
static int itemHeight();
static int itemOffset();
//const QMap < QString, QString > transitionParameters() const;
......@@ -68,14 +68,14 @@ public:
void updateTransitionEndTrack(int newtrack);
void setForcedTrack(bool force, int track);
bool forcedTrack() const;
Transition *clone(ItemInfo newInfo = ItemInfo());
Transition *clone(const ItemInfo &newInfo = ItemInfo());
bool isAutomatic() const;
void setAutomatic(bool automatic);
bool hasGeometry();
/** @brief When a transition is resized, check if keyframes are out of the transition and fix if necessary.
* @param oldEnd the previous transition end, so that when we expand the transition, if there is a keyframe at end we move it
*/
bool updateKeyframes(ItemInfo oldInfo, ItemInfo newInfo);
bool updateKeyframes(const ItemInfo &oldInfo, const ItemInfo &newInfo);
bool checkKeyFrames(int width, int height, int previousDuration, int cutPos = -1);
protected:
......
......@@ -579,7 +579,7 @@ const QString TransitionHandler::compositeTransition()
return QStringLiteral("composite");
}
void TransitionHandler::rebuildTransitions(int mode, QList <int> videoTracks, int maxTrack)
void TransitionHandler::rebuildTransitions(int mode, const QList <int> &videoTracks, int maxTrack)
{
QStringList compositeService { QStringLiteral("qtblend"), QStringLiteral("composite"), QStringLiteral("frei0r.cairoblend"), QStringLiteral("movit.overlay") };
QList <int> disabled;
......
......@@ -56,7 +56,7 @@ public:
/** @brief Returns internal track transition. */
Mlt::Transition *getTrackTransition(const QStringList names, int b_track, int a_track) const;
/** @brief Switch track compositing mode. */
void rebuildTransitions(int mode, QList <int> videoTracks, int maxTrack);
void rebuildTransitions(int mode, const QList<int> &videoTracks, int maxTrack);
/** @brief Returns the matching composite transition depending on the current settings. */
static const QString compositeTransition();
/** @brief Initialize transition settings. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment