Commit 7d8f495c authored by Vincent PINON's avatar Vincent PINON

Cppcheck fixs

parent bd9d3bba
......@@ -1411,11 +1411,11 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
items = scene()->items(sceneShape, Qt::IntersectsItemShape);
items.removeAll(this);
bool forwardMove = newPos.x() > pos().x();
int offset = 0;
if (!items.isEmpty()) {
for (int i = 0; i < items.count(); ++i) {
if (!items.at(i)->isEnabled()) continue;
if (items.at(i)->type() == type()) {
int offset = 0;
// Collision!
QPointF otherPos = items.at(i)->pos();
if ((int) otherPos.y() != (int) pos().y()) {
......@@ -1821,7 +1821,7 @@ void ClipItem::dropEvent(QGraphicsSceneDragDropEvent * event)
// single effect dropped
e.removeAttribute("kdenlive_ix");
}
CustomTrackView *view = (CustomTrackView *) scene()->views().first();
CustomTrackView *view = static_cast<CustomTrackView*>(scene()->views().first());
if (view) view->slotDropEffect(this, e, m_info.startPos, track());
}
else return;
......
......@@ -490,9 +490,9 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
QString offset = m_document->timecode().getDisplayTimecode(m_dragItem->cropDuration() - m_dragItemInfo.cropDuration, KdenliveSettings::frametimecode());
emit displayMessage(i18n("Duration:") + ' ' + duration + ' ' + i18n("Offset:") + ' ' + offset, InformationMessage);
} else if (m_operationMode == FadeIn && move) {
((ClipItem*) m_dragItem)->setFadeIn(static_cast<int>(mappedXPos - m_dragItem->startPos().frames(m_document->fps())));
static_cast<ClipItem*>(m_dragItem)->setFadeIn(static_cast<int>(mappedXPos - m_dragItem->startPos().frames(m_document->fps())));
} else if (m_operationMode == FadeOut && move) {
((ClipItem*) m_dragItem)->setFadeOut(static_cast<int>(m_dragItem->endPos().frames(m_document->fps()) - mappedXPos));
static_cast<ClipItem*>(m_dragItem)->setFadeOut(static_cast<int>(m_dragItem->endPos().frames(m_document->fps()) - mappedXPos));
} else if (m_operationMode == KeyFrame && move) {
GenTime keyFramePos = GenTime(mappedXPos, m_document->fps()) - m_dragItem->startPos() + m_dragItem->cropStart();
double pos = mapToScene(event->pos()).toPoint().y();
......@@ -3585,7 +3585,7 @@ void CustomTrackView::deleteClip(const QString &clipId)
int count = 0;
for (int i = 0; i < itemList.count(); ++i) {
if (itemList.at(i)->type() == AVWidget) {
ClipItem *item = (ClipItem *)itemList.at(i);
ClipItem *item = static_cast<ClipItem*>(itemList.at(i));
if (item->clipProducer() == clipId) {
count++;
if (item->parentItem()) {
......@@ -3733,7 +3733,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
for (int i = 0; i < items.count(); ++i) {
if (items.at(i)->type() == GroupWidget) {
AbstractGroupItem* group = (AbstractGroupItem*)items.at(i);
AbstractGroupItem* group = static_cast<AbstractGroupItem*>(items.at(i));
if (!groups.contains(group)) groups.append(group);
items += items.at(i)->childItems();
}
......
......@@ -252,9 +252,6 @@ void direct_file_filter(
size_t nbuf;
size_t oldestlag = 0;
size_t k, tap;
#ifndef REAL_FASTFIR
kffsamp_t tmp;
#endif
nbuf = 4096;
buf = (kffsamp_t *) malloc ( sizeof (kffsamp_t) * nbuf);
......
......@@ -2021,7 +2021,7 @@ void MainWindow::activateDocument()
if (m_timelineArea->currentWidget() == NULL || !m_timelineArea->isEnabled()) {
return;
}
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
TrackView *currentTab = static_cast<TrackView*>(m_timelineArea->currentWidget());
KdenliveDoc *currentDoc = currentTab->document();
connectDocumentInfo(currentDoc);
connectDocument(currentTab, currentDoc);
......@@ -2039,7 +2039,7 @@ bool MainWindow::closeCurrentDocument(bool saveChanges)
ix = 0;
}
m_timelineArea->setCurrentIndex(ix);
TrackView *tabToClose = (TrackView *) w;
TrackView *tabToClose = static_cast<TrackView*>(w);
KdenliveDoc *docToClose = tabToClose->document();
if (docToClose && docToClose->isModified() && saveChanges) {
QString message;
......@@ -2217,7 +2217,7 @@ void MainWindow::openFile(const KUrl &url)
bool isOpened = false;
int i;
for (i = 0; i < ct; ++i) {
TrackView *tab = (TrackView *) m_timelineArea->widget(i);
TrackView *tab = static_cast<TrackView*>(m_timelineArea->widget(i));
KdenliveDoc *doc = tab->document();
if (doc->url() == url) {
isOpened = true;
......
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