]> git.sesse.net Git - kdenlive/blobdiff - src/abstractgroupitem.cpp
Remove some not necessary endline
[kdenlive] / src / abstractgroupitem.cpp
index 83f5e59fea65067eeadbe5f11e1fa228f9e8e401..e52a8a336f3736ca40600cbf422c77129c86aa45 100644 (file)
@@ -107,11 +107,11 @@ QPainterPath AbstractGroupItem::transitionGroupShape(QPointF offset) const
     return groupShape(TRANSITIONWIDGET, offset);
 }
 
-QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, QPointF offset) const
+QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, const QPointF &offset) const
 {
     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);
@@ -130,11 +130,11 @@ QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, QPointF offset
     return path;
 }
 
-QPainterPath AbstractGroupItem::spacerGroupShape(GRAPHICSRECTITEM type, QPointF offset) const
+QPainterPath AbstractGroupItem::spacerGroupShape(GRAPHICSRECTITEM type, const QPointF &offset) const
 {
     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);
@@ -212,7 +212,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
         int xpos = projectScene()->getSnapPointForPos((int)(start.x() + newPos.x() - pos().x()), KdenliveSettings::snaptopoints());
 
         xpos = qMax(xpos, 0);
-        //kDebug()<<"GRP XPOS:"<<xpos<<", START:"<<start.x()<<",NEW:"<<newPos.x()<<"; SCENE:"<<scenePos().x()<<",POS:"<<pos().x();
+        //kDebug()<<"GRP XPOS:"<<xpos<<", START:"<<start.x()<<",NEW:"<<newPos.x()<<"; SCENE:"<<scenePos().x()<<",POS:"<<pos().x();
         newPos.setX((int)(pos().x() + xpos - (int) start.x()));
        QStringList lockedTracks = property("locked_tracks").toStringList();
         int proposedTrack = (property("y_absolute").toInt() + newPos.y()) / trackHeight;
@@ -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;
@@ -554,3 +554,5 @@ GenTime AbstractGroupItem::duration()
     }
     return end - start;
 }
+
+#include "abstractgroupitem.moc"