Commit e0fa1332 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Better to use ++i than i++ (minor optimization)

parent 7a74d9ca
......@@ -111,7 +111,7 @@ QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, QPointF offset
{
QPainterPath path;
QList<QGraphicsItem *> children = childItems();
for (int i = 0; i < children.count(); i++) {
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == (int)type) {
QRectF r(children.at(i)->sceneBoundingRect());
r.translate(offset);
......@@ -134,7 +134,7 @@ QPainterPath AbstractGroupItem::spacerGroupShape(GRAPHICSRECTITEM type, QPointF
{
QPainterPath path;
QList<QGraphicsItem *> children = childItems();
for (int i = 0; i < children.count(); i++) {
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == (int)type) {
QRectF r(children.at(i)->sceneBoundingRect());
r.translate(offset);
......@@ -221,7 +221,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
int topTrack = -1;
QList<int> groupTracks;
QList<QGraphicsItem *> children = childItems();
for (int i = 0; i < children.count(); i++) {
for (int i = 0; i < children.count(); ++i) {
int currentTrack = 0;
if (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET) {
currentTrack = static_cast <AbstractClipItem*> (children.at(i))->track();
......@@ -267,7 +267,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
// Check no clip in the group goes outside of existing tracks
int maximumTrack = projectScene()->tracksCount() - 1;
int groupHeight = 0;
for (int i = 0; i < groupTracks.count(); i++) {
for (int i = 0; i < groupTracks.count(); ++i) {
int offset = groupTracks.at(i) - topTrack;
if (offset > groupHeight) groupHeight = offset;
}
......@@ -276,7 +276,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
proposedTrack = qMax(proposedTrack, 0);
int groupOffset = proposedTrack - topTrack;
if (!lockedTracks.isEmpty()) {
for (int i = 0; i < groupTracks.count(); i++) {
for (int i = 0; i < groupTracks.count(); ++i) {
if (lockedTracks.contains(QString::number(groupTracks.at(i) + groupOffset))) {
return pos();
}
......@@ -296,7 +296,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
shape = clipGroupShape(newPos - pos());
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); i++) {
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == GROUPWIDGET) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
......@@ -309,7 +309,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
if (!collidingItems.isEmpty()) {
bool forwardMove = xpos > start.x();
int offset = 0;
for (int i = 0; i < collidingItems.count(); i++) {
for (int i = 0; i < collidingItems.count(); ++i) {
QGraphicsItem *collision = collidingItems.at(i);
if (collision->type() == AVWIDGET) {
// Collision
......@@ -342,7 +342,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
// If there is still a collision after our position adjust, restore original pos
collidingItems = scene()->items(clipGroupShape(newPos - pos()), Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); i++) {
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == GROUPWIDGET) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
......@@ -351,7 +351,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
}
collidingItems.removeAll(children.at(i));
}
for (int i = 0; i < collidingItems.count(); i++)
for (int i = 0; i < collidingItems.count(); ++i)
if (collidingItems.at(i)->type() == AVWIDGET) return pos();
}
}
......@@ -360,7 +360,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
shape = transitionGroupShape(newPos - pos());
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); i++) {
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == GROUPWIDGET) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
......@@ -374,7 +374,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
else {
bool forwardMove = xpos > start.x();
int offset = 0;
for (int i = 0; i < collidingItems.count(); i++) {
for (int i = 0; i < collidingItems.count(); ++i) {
QGraphicsItem *collision = collidingItems.at(i);
if (collision->type() == TRANSITIONWIDGET) {
// Collision
......@@ -406,10 +406,10 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
}
// If there is still a collision after our position adjust, restore original pos
collidingItems = scene()->items(transitionGroupShape(newPos - pos()), Qt::IntersectsItemShape);
for (int i = 0; i < children.count(); i++) {
for (int i = 0; i < children.count(); ++i) {
collidingItems.removeAll(children.at(i));
}
for (int i = 0; i < collidingItems.count(); i++)
for (int i = 0; i < collidingItems.count(); ++i)
if (collidingItems.at(i)->type() == TRANSITIONWIDGET) return pos();
}
}
......@@ -430,7 +430,7 @@ void AbstractGroupItem::dropEvent(QGraphicsSceneDragDropEvent * event)
QPointF dropPos = event->scenePos();
QList<QGraphicsItem *> selection = scene()->items(dropPos);
AbstractClipItem *dropChild = NULL;
for (int i = 0; i < selection.count(); i++) {
for (int i = 0; i < selection.count(); ++i) {
if (selection.at(i)->type() == AVWIDGET) {
dropChild = (AbstractClipItem *) selection.at(i);
break;
......
......@@ -281,7 +281,7 @@ void ArchiveWidget::openArchiveForExtraction()
// Check that it is a kdenlive project archive
bool isProjectArchive = false;
QStringList files = m_extractArchive->directory()->entries();
for (int i = 0; i < files.count(); i++) {
for (int i = 0; i < files.count(); ++i) {
if (files.at(i).endsWith(".kdenlive")) {
m_projectName = files.at(i);
isProjectArchive = true;
......@@ -349,7 +349,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QStringList
QFileInfoList resultList = dir.entryInfoList(QDir::Files);
QStringList slideImages;
qint64 totalSize = 0;
for (int i = 0; i < resultList.count(); i++) {
for (int i = 0; i < resultList.count(); ++i) {
totalSize += resultList.at(i).size();
slideImages << resultList.at(i).absoluteFilePath();
}
......@@ -434,7 +434,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QMap <QStri
QFileInfoList resultList = dir.entryInfoList(QDir::Files);
QStringList slideImages;
qint64 totalSize = 0;
for (int i = 0; i < resultList.count(); i++) {
for (int i = 0; i < resultList.count(); ++i) {
totalSize += resultList.at(i).size();
slideImages << resultList.at(i).absoluteFilePath();
}
......@@ -538,7 +538,7 @@ bool ArchiveWidget::slotStartArchiving(bool firstPass)
int items = 0;
// We parse all files going into one folder, then start the copy job
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
parentItem = files_list->topLevelItem(i);
if (parentItem->isDisabled()) {
parentItem->setExpanded(false);
......@@ -616,7 +616,7 @@ bool ArchiveWidget::slotStartArchiving(bool firstPass)
if (isArchive) {
m_foldersList.append(destPath);
for (int i = 0; i < files.count(); i++) {
for (int i = 0; i < files.count(); ++i) {
m_filesList.insert(files.at(i).path(), destPath + files.at(i).fileName());
}
slotArchivingFinished();
......@@ -664,7 +664,7 @@ void ArchiveWidget::slotArchivingFinished(KJob *job, bool finished)
archive_url->setEnabled(true);
proxy_only->setEnabled(true);
compressed_archive->setEnabled(true);
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
files_list->topLevelItem(i)->setDisabled(false);
for (int j = 0; j < files_list->topLevelItem(i)->childCount(); j++)
files_list->topLevelItem(i)->child(j)->setDisabled(false);
......@@ -684,7 +684,7 @@ bool ArchiveWidget::processProjectFile()
QTreeWidgetItem *item;
bool isArchive = compressed_archive->isChecked();
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
if (parentItem->childCount() > 0) {
destUrl = KUrl(archive_url->url().path(KUrl::AddTrailingSlash) + parentItem->data(0, Qt::UserRole).toString());
......@@ -720,7 +720,7 @@ bool ArchiveWidget::processProjectFile()
// process kdenlive producers
QDomNodeList prods = mlt.elementsByTagName("kdenlive_producer");
for (int i = 0; i < prods.count(); i++) {
for (int i = 0; i < prods.count(); ++i) {
QDomElement e = prods.item(i).toElement();
if (e.isNull()) continue;
if (e.hasAttribute("resource")) {
......@@ -737,7 +737,7 @@ bool ArchiveWidget::processProjectFile()
// process mlt producers
prods = mlt.elementsByTagName("producer");
for (int i = 0; i < prods.count(); i++) {
for (int i = 0; i < prods.count(); ++i) {
QDomElement e = prods.item(i).toElement();
if (e.isNull()) continue;
QString src = EffectsList::property(e, "resource");
......@@ -752,7 +752,7 @@ bool ArchiveWidget::processProjectFile()
// process mlt transitions (for luma files)
prods = mlt.elementsByTagName("transition");
QString attribute;
for (int i = 0; i < prods.count(); i++) {
for (int i = 0; i < prods.count(); ++i) {
QDomElement e = prods.item(i).toElement();
if (e.isNull()) continue;
attribute = "resource";
......@@ -853,7 +853,7 @@ void ArchiveWidget::slotArchivingFinished(bool result)
archive_url->setEnabled(true);
proxy_only->setEnabled(true);
compressed_archive->setEnabled(true);
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
files_list->topLevelItem(i)->setDisabled(false);
for (int j = 0; j < files_list->topLevelItem(i)->childCount(); j++)
files_list->topLevelItem(i)->child(j)->setDisabled(false);
......@@ -953,7 +953,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
QTreeWidgetItem *parentItem = NULL;
// Build list of existing proxy ids
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
parentItem = files_list->topLevelItem(i);
if (parentItem->data(0, Qt::UserRole).toString() == "proxy") break;
}
......@@ -964,7 +964,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
}
// Parse all items to disable original clips for existing proxies
for (int i = 0; i < proxyIdList.count(); i++) {
for (int i = 0; i < proxyIdList.count(); ++i) {
QString id = proxyIdList.at(i);
if (id.isEmpty()) continue;
for (int j = 0; j < files_list->topLevelItemCount(); j++) {
......@@ -983,7 +983,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
}
else {
// Archive all clips
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
int items = parentItem->childCount();
for (int j = 0; j < items; j++) {
......@@ -994,7 +994,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
// Calculate requested size
int total = 0;
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
int items = parentItem->childCount();
int itemsCount = 0;
......
......@@ -160,7 +160,7 @@ void ClipItem::setEffectList(const EffectsList effectList)
m_effectList.clone(effectList);
m_effectNames = m_effectList.effectNames().join(" / ");
if (!m_effectList.isEmpty()) {
for (int i = 0; i < m_effectList.count(); i++) {
for (int i = 0; i < m_effectList.count(); ++i) {
QDomElement effect = m_effectList.at(i);
QString effectId = effect.attribute("id");
// check if it is a fade effect
......@@ -238,7 +238,7 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset)
// Init parameter value & keyframes if required
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (e.isNull())
......@@ -433,7 +433,7 @@ void ClipItem::setKeyframes(const int ix, const QStringList keyframes)
QLocale locale;
QDomNodeList params = effect.elementsByTagName("parameter");
int keyframeParams = 0;
for (int i = 0; i < params.count(); i++) {
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") && (!e.hasAttribute("intimeline") || e.attribute("intimeline") == "1")) {
e.setAttribute("keyframes", keyframes.at(keyframeParams));
......@@ -470,7 +470,7 @@ void ClipItem::setSelectedEffect(const int ix)
QDomElement effect = effectAtIndex(m_selectedEffect);
if (!effect.isNull() && effect.attribute("disable") != "1") {
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") && (!e.hasAttribute("intimeline") || e.attribute("intimeline") == "1")) {
m_keyframes.clear();
......@@ -510,7 +510,7 @@ void ClipItem::resizeGeometries(const int index, int width, int height, int prev
QDomElement effect = m_effectList.at(index);
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && e.attribute("type") == "geometry") {
geom = e.attribute("value");
......@@ -526,7 +526,7 @@ QStringList ClipItem::keyframes(const int index)
QDomElement effect = m_effectList.at(index);
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe"))
result.append(e.attribute("keyframes"));
......@@ -857,7 +857,7 @@ void ClipItem::paint(QPainter *painter,
QPointF startPos = mapped.topLeft();
int startOffset = m_info.cropStart.frames(m_fps);
if (clipType() == IMAGE || clipType() == TEXT) {
for (int i = left; i <= right; i++) {
for (int i = left; i <= right; ++i) {
painter->drawPixmap(startPos + QPointF(FRAME_SIZE *(i - startOffset), 0), m_startPix);
}
}
......@@ -869,7 +869,7 @@ void ClipItem::paint(QPainter *painter,
QPen pen(Qt::white);
pen.setStyle(Qt::DotLine);
QList <int> missing;
for (int i = left; i <= right; i++) {
for (int i = left; i <= right; ++i) {
img = m_clip->thumbProducer()->findCachedThumb(path + QString::number(i));
QPointF xpos = startPos + QPointF(FRAME_SIZE *(i - startOffset), 0);
if (img.isNull()) missing << i;
......@@ -1081,7 +1081,7 @@ OPERATIONTYPE ClipItem::operationMode(QPointF pos)
if (parentItem()) {
QGraphicsItemGroup *dragGroup = static_cast <QGraphicsItemGroup *>(parentItem());
QList<QGraphicsItem *> list = dragGroup->childItems();
for (int i = 0; i < list.count(); i++) {
for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == AVWIDGET) {
ClipItem *c = static_cast <ClipItem*>(list.at(i));
if (c->startPos() != startPos()) return MOVE;
......@@ -1096,7 +1096,7 @@ OPERATIONTYPE ClipItem::operationMode(QPointF pos)
if (parentItem()) {
QGraphicsItemGroup *dragGroup = static_cast <QGraphicsItemGroup *>(parentItem());
QList<QGraphicsItem *> list = dragGroup->childItems();
for (int i = 0; i < list.count(); i++) {
for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == AVWIDGET) {
ClipItem *c = static_cast <ClipItem*>(list.at(i));
if (c->endPos() != endPos()) return MOVE;
......@@ -1131,7 +1131,7 @@ QList <GenTime> ClipItem::snapMarkers() const
QList < GenTime > markers = m_clip->snapMarkers();
GenTime pos;
for (int i = 0; i < markers.size(); i++) {
for (int i = 0; i < markers.size(); ++i) {
pos = GenTime((int)(markers.at(i).frames(m_fps) / qAbs(m_speed) + 0.5), m_fps) - cropStart();
if (pos > GenTime()) {
if (pos > cropDuration()) break;
......@@ -1148,7 +1148,7 @@ QList <CommentedTime> ClipItem::commentedSnapMarkers() const
QList < CommentedTime > markers = m_clip->commentedSnapMarkers();
GenTime pos;
for (int i = 0; i < markers.size(); i++) {
for (int i = 0; i < markers.size(); ++i) {
pos = GenTime((int)(markers.at(i).time().frames(m_fps) / qAbs(m_speed) + 0.5), m_fps) - cropStart();
if (pos > GenTime()) {
if (pos > cropDuration()) break;
......@@ -1194,7 +1194,7 @@ void ClipItem::slotPrepareAudioThumb(double pixelForOneFrame, int startpixel, in
QPainter pixpainter(&m_audioThumbCachePic[startCache]);
for (int i = 0; i < channels; i++) {
for (int i = 0; i < channels; ++i) {
if (simplifiedAudio) {
positiveChannelPaths[i].moveTo(-1, channelHeight);
}
......@@ -1252,7 +1252,7 @@ void ClipItem::slotPrepareAudioThumb(double pixelForOneFrame, int startpixel, in
pixpainter.setBrush(Qt::NoBrush);
}
pixpainter.setRenderHint(QPainter::Antialiasing, false);
for (int i = 0; i < channels; i++) {
for (int i = 0; i < channels; ++i) {
if (fullAreaDraw) {
pixpainter.drawPath(positiveChannelPaths[i].united(negativeChannelPaths.value(i)));
} else
......@@ -1419,7 +1419,7 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
bool forwardMove = newPos.x() > pos().x();
int offset = 0;
if (!items.isEmpty()) {
for (int i = 0; i < items.count(); i++) {
for (int i = 0; i < items.count(); ++i) {
if (!items.at(i)->isEnabled()) continue;
if (items.at(i)->type() == type()) {
// Collision!
......@@ -1639,7 +1639,7 @@ EffectsParameterList ClipItem::addEffect(QDomElement effect, bool /*animate*/)
}*/
}
for (int i = 0; i < params.count(); i++) {
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull()) {
if (e.attribute("type") == "geometry" && !e.hasAttribute("fixed")) {
......@@ -1789,7 +1789,7 @@ const ItemInfo ClipItem::speedIndependantInfo() const
int ClipItem::nextFreeEffectGroupIndex() const
{
int freeGroupIndex = 0;
for (int i = 0; i < m_effectList.count(); i++) {
for (int i = 0; i < m_effectList.count(); ++i) {
QDomElement effect = m_effectList.at(i);
EffectInfo effectInfo;
effectInfo.fromString(effect.attribute("kdenlive_info"));
......@@ -1814,7 +1814,7 @@ void ClipItem::dropEvent(QGraphicsSceneDragDropEvent * event)
QDomNodeList effectlist = e.elementsByTagName("effect");
int freeGroupIndex = nextFreeEffectGroupIndex();
EffectInfo effectInfo;
for (int i = 0; i < effectlist.count(); i++) {
for (int i = 0; i < effectlist.count(); ++i) {
QDomElement effect = effectlist.at(i).toElement();
effectInfo.fromString(effect.attribute("kdenlive_info"));
effectInfo.groupIndex = freeGroupIndex;
......@@ -1895,7 +1895,7 @@ void ClipItem::insertKeyframe(QDomElement effect, int pos, int val)
effect.setAttribute("active_keyframe", pos);
m_editedKeyframe = pos;
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
QString kfr = e.attribute("keyframes");
......@@ -1935,7 +1935,7 @@ void ClipItem::movedKeyframe(QDomElement effect, int oldpos, int newpos, double
QDomNodeList params = effect.elementsByTagName("parameter");
int start = cropStart().frames(m_fps);
int end = (cropStart() + cropDuration()).frames(m_fps) - 1;
for (int i = 0; i < params.count(); i++) {
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
QString kfr = e.attribute("keyframes");
......@@ -1995,7 +1995,7 @@ Mlt::Producer *ClipItem::getProducer(int track, bool trackSpecific)
QMap<int, QDomElement> ClipItem::adjustEffectsToDuration(int width, int height, ItemInfo oldInfo)
{
QMap<int, QDomElement> effects;
for (int i = 0; i < m_effectList.count(); i++) {
for (int i = 0; i < m_effectList.count(); ++i) {
QDomElement effect = m_effectList.at(i);
if (effect.attribute("id").startsWith("fade")) {
......
......@@ -227,7 +227,7 @@ void ClipManager::checkAudioThumbs()
}
m_thumbsMutex.lock();
for (int i = 0; i < m_clipList.count(); i++) {
for (int i = 0; i < m_clipList.count(); ++i) {
DocClipBase *clip = m_clipList.at(i);
if (clip->hasAudioThumb() && !clip->audioThumbCreated())
m_audioThumbsQueue.append(m_clipList.at(i)->getId());
......@@ -294,7 +294,7 @@ void ClipManager::slotGetAudioThumbs()
h3 = 0;
for (int c = 0; c < channels; c++) {
QByteArray audioArray(arrayWidth, '\x00');
for (int i = 0; i < arrayWidth; i++) {
for (int i = 0; i < arrayWidth; ++i) {
audioArray[i] = channelarray.at(h2 + h3 + i);
if (audioArray.at(i) > maxVolume) maxVolume = audioArray.at(i);
}
......@@ -353,7 +353,7 @@ void ClipManager::slotGetAudioThumbs()
for (int c = 0; c < channels; c++) {
QByteArray audioArray;
audioArray.resize(arrayWidth);
for (int i = 0; i < audioArray.size(); i++) {
for (int i = 0; i < audioArray.size(); ++i) {
double pcmval = *(pcm + c + i * samples / audioArray.size());
if (pcmval >= 0) {
pcmval = sqrt(pcmval) / 2.83 + 64;
......@@ -420,7 +420,7 @@ void ClipManager::slotDeleteClips(QStringList ids)
QUndoCommand *delClips = new QUndoCommand();
delClips->setText(i18np("Delete clip", "Delete clips", ids.size()));
for (int i = 0; i < ids.size(); i++) {
for (int i = 0; i < ids.size(); ++i) {
DocClipBase *clip = getClipById(ids.at(i));
if (clip) {
new AddClipCommand(m_doc, clip->toXML(), ids.at(i), false, delClips);
......@@ -431,7 +431,7 @@ void ClipManager::slotDeleteClips(QStringList ids)
void ClipManager::deleteClip(const QString &clipId)
{
for (int i = 0; i < m_clipList.count(); i++) {
for (int i = 0; i < m_clipList.count(); ++i) {
if (m_clipList.at(i)->getId() == clipId) {
DocClipBase *clip = m_clipList.takeAt(i);
if (clip->clipType() != COLOR && clip->clipType() != SLIDESHOW && !clip->fileURL().isEmpty()) {
......@@ -455,7 +455,7 @@ DocClipBase *ClipManager::getClipById(QString clipId)
{
//kDebug() << "++++ CLIP MAN, LOOKING FOR CLIP ID: " << clipId;
clipId = clipId.section('_', 0, 0);
for (int i = 0; i < m_clipList.count(); i++) {
for (int i = 0; i < m_clipList.count(); ++i) {
if (m_clipList.at(i)->getId() == clipId) {
//kDebug() << "++++ CLIP MAN, FOUND FOR CLIP ID: " << clipId;
return m_clipList.at(i);
......@@ -469,7 +469,7 @@ const QList <DocClipBase *> ClipManager::getClipByResource(const QString &resour
QList <DocClipBase *> list;
QString clipResource;
QString proxyResource;
for (int i = 0; i < m_clipList.count(); i++) {
for (int i = 0; i < m_clipList.count(); ++i) {
clipResource = m_clipList.at(i)->getProperty("resource");
proxyResource = m_clipList.at(i)->getProperty("proxy");
if (clipResource.isEmpty()) clipResource = m_clipList.at(i)->getProperty("colour");
......@@ -483,14 +483,14 @@ const QList <DocClipBase *> ClipManager::getClipByResource(const QString &resour
void ClipManager::clearUnusedProducers()
{
for (int i = 0; i < m_clipList.count(); i++) {
for (int i = 0; i < m_clipList.count(); ++i) {
if (m_clipList.at(i)->numReferences() == 0) m_clipList.at(i)->deleteProducers();
}
}
void ClipManager::resetProducersList(const QList <Mlt::Producer *> prods, bool displayRatioChanged, bool fpsChanged)
{
for (int i = 0; i < m_clipList.count(); i++) {
for (int i = 0; i < m_clipList.count(); ++i) {
if (m_clipList.at(i)->numReferences() > 0 || displayRatioChanged || fpsChanged) {
m_clipList.at(i)->deleteProducers();
}
......@@ -498,7 +498,7 @@ void ClipManager::resetProducersList(const QList <Mlt::Producer *> prods, bool d
QString id;
Mlt::Producer *prod;
QStringList brokenClips;
for (int i = 0; i < prods.count(); i++) {
for (int i = 0; i < prods.count(); ++i) {
prod = prods.at(i);
id = prod->get("id");
if (id.contains('_')) id = id.section('_', 0, 0);
......@@ -600,7 +600,7 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
prod.setAttribute("type", (int) TEXT);
// extract embeded images
QDomNodeList items = txtdoc.elementsByTagName("content");
for (int i = 0; i < items.count() ; i++) {
for (int i = 0; i < items.count() ; ++i) {
QDomElement content = items.item(i).toElement();
if (content.hasAttribute("base64")) {
QString titlesFolder = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
......@@ -813,7 +813,7 @@ QDomElement ClipManager::groupsXml() const
QDomDocument doc;
QDomElement groups = doc.createElement("groups");
doc.appendChild(groups);
for (int i = 0; i < m_groupsList.count(); i++) {
for (int i = 0; i < m_groupsList.count(); ++i) {
QDomElement group = doc.createElement("group");
groups.appendChild(group);
QList <QGraphicsItem *> children = m_groupsList.at(i)->childItems();
......@@ -843,7 +843,7 @@ void ClipManager::slotClipModified(const QString &path)
{
//kDebug() << "// CLIP: " << path << " WAS MODIFIED";
const QList <DocClipBase *> list = getClipByResource(path);
for (int i = 0; i < list.count(); i++) {
for (int i = 0; i < list.count(); ++i) {
DocClipBase *clip = list.at(i);
if (clip != NULL) {
QString id = clip->getId();
......@@ -875,7 +875,7 @@ void ClipManager::slotClipMissing(const QString &path)
{
// kDebug() << "// CLIP: " << path << " WAS MISSING";
const QList <DocClipBase *> list = getClipByResource(path);
for (int i = 0; i < list.count(); i++) {
for (int i = 0; i < list.count(); ++i) {
DocClipBase *clip = list.at(i);
if (clip != NULL) emit missingClip(clip->getId());
}
......@@ -885,7 +885,7 @@ void ClipManager::slotClipAvailable(const QString &path)
{
// kDebug() << "// CLIP: " << path << " WAS ADDED";
const QList <DocClipBase *> list = getClipByResource(path);
for (int i = 0; i < list.count(); i++) {
for (int i = 0; i < list.count(); ++i) {
DocClipBase *clip = list.at(i);
if (clip != NULL) emit availableClip(clip->getId());
}
......
......@@ -365,7 +365,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
m_view.animation->setCurrentIndex(0);
QString path = props.value("resource");
QString ext = path.section('.', -1);
for (int i = 0; i < m_view.image_type->count(); i++) {
for (int i = 0; i < m_view.image_type->count(); ++i) {
if (m_view.image_type->itemData(i).toString() == ext) {
m_view.image_type->setCurrentIndex(i);
break;
......@@ -867,7 +867,7 @@ void ClipProperties::slotDeleteMarker()
{
QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
QList < CommentedTime > toDelete;
for (int i = 0; i < marks.count(); i++) {
for (int i = 0; i < marks.count(); ++i) {
if (m_view.markers_list->topLevelItem(i)->isSelected()) {
CommentedTime marker = marks.at(i);
marker.setMarkerType(-1);
......
......@@ -234,7 +234,7 @@ void ClipStabilize::slotStartStabilize()
void ClipStabilize::slotUpdateParams()
{
for (int i=0;i<vbox->count();i++){
for (int i=0;i<vbox->count();++i