]> git.sesse.net Git - kdenlive/commitdiff
Fix indent. Const'ref. Optimization. Clean up code
authorMontel Laurent <montel@kde.org>
Tue, 28 May 2013 18:13:08 +0000 (20:13 +0200)
committerMontel Laurent <montel@kde.org>
Tue, 28 May 2013 18:13:08 +0000 (20:13 +0200)
44 files changed:
src/abstractmonitor.h
src/clipitem.cpp
src/clipitem.h
src/clipproperties.h
src/headertrack.h
src/initeffects.cpp
src/initeffects.h
src/kdenlivesettingsdialog.cpp
src/keyframehelper.h
src/kthumb.cpp
src/kthumb.h
src/mainwindow.cpp
src/mainwindow.h
src/managecapturesdialog.cpp
src/mltdevicecapture.h
src/monitor.cpp
src/monitor.h
src/monitormanager.cpp
src/monitormanager.h
src/parameterplotter.cpp
src/projectlist.cpp
src/projectlist.h
src/recmonitor.cpp
src/renderer.cpp
src/renderer.h
src/renderwidget.cpp
src/renderwidget.h
src/smallruler.h
src/timecodedisplay.cpp
src/timecodedisplay.h
src/titlewidget.cpp
src/titlewidget.h
src/trackview.h
src/transitionsettings.cpp
src/transitionsettings.h
src/utils/abstractservice.cpp
src/utils/abstractservice.h
src/utils/archiveorg.cpp
src/utils/archiveorg.h
src/utils/freesound.cpp
src/utils/freesound.h
src/utils/openclipart.cpp
src/utils/openclipart.h
src/v4l/v4lcapture.cpp

index db7ab3a5a241f8138eddcfff01ab0616efc53408..537f5d74d470ccedc3db9158b0de880698f424f4 100644 (file)
@@ -41,7 +41,13 @@ Q_OBJECT public:
      *  @param name A unique identifier for this renderer
      *  @param winid The parent widget identifier (required for SDL display). Set to 0 for OpenGL rendering
      *  @param profile The MLT profile used for the renderer (default one will be used if empty). */
-    explicit AbstractRender(Kdenlive::MONITORID name, QWidget *parent = 0):QObject(parent), sendFrameForAnalysis(false), analyseAudio(false), m_name(name) {}
+    explicit AbstractRender(Kdenlive::MONITORID name, QWidget *parent = 0)
+        : QObject(parent),
+          sendFrameForAnalysis(false),
+          analyseAudio(false),
+          m_name(name)
+    {
+    }
 
     /** @brief Destroy the MLT Renderer. */
     virtual ~AbstractRender() {}
@@ -62,10 +68,10 @@ private:
     
 signals:
     /** @brief The renderer refreshed the current frame. */
-    void frameUpdated(QImage);
+    void frameUpdated(const QImage &);
 
     /** @brief This signal contains the audio of the current frame. */
-    void audioSamplesSignal(QVector<int16_t>,int,int,int);
+    void audioSamplesSignal(const QVector<int16_t>&,int,int,int);
 };
 
 
index b2af83a82cbf8552f6c3c34078bc212dca212ba3..59d54d900e1af19656842dda4d28130bda339d60 100644 (file)
 static int FRAME_SIZE;
 
 ClipItem::ClipItem(DocClipBase *clip, const ItemInfo& info, double fps, double speed, int strobe, int frame_width, bool generateThumbs) :
-        AbstractClipItem(info, QRectF(), fps),
-        m_clip(clip),
-        m_startFade(0),
-        m_endFade(0),
-        m_audioOnly(false),
-        m_videoOnly(false),
-        m_startPix(QPixmap()),
-        m_endPix(QPixmap()),
-        m_hasThumbs(false),
-        m_selectedEffect(-1),
-        m_timeLine(0),
-        m_startThumbRequested(false),
-        m_endThumbRequested(false),
-        //m_hover(false),
-        m_speed(speed),
-        m_strobe(strobe),
-        m_framePixelWidth(0),
-        m_limitedKeyFrames(false)
+    AbstractClipItem(info, QRectF(), fps),
+    m_clip(clip),
+    m_startFade(0),
+    m_endFade(0),
+    m_audioOnly(false),
+    m_videoOnly(false),
+    m_startPix(QPixmap()),
+    m_endPix(QPixmap()),
+    m_hasThumbs(false),
+    m_selectedEffect(-1),
+    m_timeLine(0),
+    m_startThumbRequested(false),
+    m_endThumbRequested(false),
+    //m_hover(false),
+    m_speed(speed),
+    m_strobe(strobe),
+    m_framePixelWidth(0),
+    m_limitedKeyFrames(false)
 {
     setZValue(2);
     m_effectList = EffectsList(true);
@@ -162,7 +162,7 @@ void ClipItem::setEffectList(const EffectsList &effectList)
     m_effectNames = m_effectList.effectNames().join(" / ");
     if (!m_effectList.isEmpty()) {
         for (int i = 0; i < m_effectList.count(); ++i) {
-           QDomElement effect = m_effectList.at(i);
+            QDomElement effect = m_effectList.at(i);
             QString effectId = effect.attribute("id");
             // check if it is a fade effect
             QDomNodeList params = effect.elementsByTagName("parameter");
@@ -261,23 +261,23 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset)
         }
 
         if (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") {
-           if (e.attribute("keyframes").isEmpty()) {
-               // Effect has a keyframe type parameter, we need to set the values
-               e.setAttribute("keyframes", QString::number((int) cropStart().frames(m_fps)) + ':' + e.attribute("default"));
-           }
-           else if (offset != 0) {
-               // adjust keyframes to this clip
-               QString adjusted = adjustKeyframes(e.attribute("keyframes"), offset - cropStart().frames(m_fps));
-               e.setAttribute("keyframes", adjusted);
-           }
+            if (e.attribute("keyframes").isEmpty()) {
+                // Effect has a keyframe type parameter, we need to set the values
+                e.setAttribute("keyframes", QString::number((int) cropStart().frames(m_fps)) + ':' + e.attribute("default"));
+            }
+            else if (offset != 0) {
+                // adjust keyframes to this clip
+                QString adjusted = adjustKeyframes(e.attribute("keyframes"), offset - cropStart().frames(m_fps));
+                e.setAttribute("keyframes", adjusted);
+            }
         }
 
         if (e.attribute("type") == "geometry" && !e.hasAttribute("fixed")) {
             // Effects with a geometry parameter need to sync in / out with parent clip
-           effect.setAttribute("in", QString::number((int) cropStart().frames(m_fps)));
-           effect.setAttribute("out", QString::number((int) (cropStart() + cropDuration()).frames(m_fps) - 1));
-           effect.setAttribute("_sync_in_out", "1");
-       }
+            effect.setAttribute("in", QString::number((int) cropStart().frames(m_fps)));
+            effect.setAttribute("out", QString::number((int) (cropStart() + cropDuration()).frames(m_fps) - 1));
+            effect.setAttribute("_sync_in_out", "1");
+        }
     }
     if (effect.attribute("tag") == "volume" || effect.attribute("tag") == "brightness") {
         if (effect.attribute("id") == "fadeout" || effect.attribute("id") == "fade_to_black") {
@@ -314,7 +314,7 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset)
             if (effect.attribute("id") == "fadein") {
                 if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) {
                     int effectDuration = EffectsList::parameter(effect, "out").toInt();
-                   if (offset != 0) effectDuration -= offset;
+                    if (offset != 0) effectDuration -= offset;
                     if (effectDuration > cropDuration().frames(m_fps)) {
                         effectDuration = cropDuration().frames(m_fps) / 2;
                     }
@@ -324,7 +324,7 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset)
             } else if (effect.attribute("id") == "fade_from_black") {
                 if (m_effectList.hasEffect(QString(), "fadein") == -1) {
                     int effectDuration = EffectsList::parameter(effect, "out").toInt();
-                   if (offset != 0) effectDuration -= offset;
+                    if (offset != 0) effectDuration -= offset;
                     if (effectDuration > cropDuration().frames(m_fps)) {
                         effectDuration = cropDuration().frames(m_fps) / 2;
                     }
@@ -357,10 +357,10 @@ bool ClipItem::checkKeyFrames(int width, int height, int previousDuration, int c
     QLocale locale;
     // go through all effects this clip has
     for (int ix = 0; ix < m_effectList.count(); ++ix) {
-       // Check geometry params
-       resizeGeometries(ix, width, height, previousDuration, cutPos == -1 ? 0 : cutPos, cropDuration().frames(m_fps) - 1);
+        // Check geometry params
+        resizeGeometries(ix, width, height, previousDuration, cutPos == -1 ? 0 : cutPos, cropDuration().frames(m_fps) - 1);
 
-       // Check keyframe params
+        // Check keyframe params
         QStringList keyframeParams = keyframes(ix);
         QStringList newKeyFrameParams;
         bool effModified = false;
@@ -515,9 +515,9 @@ void ClipItem::resizeGeometries(const int index, int width, int height, int prev
         QDomElement e = params.item(i).toElement();
         if (!e.isNull() && e.attribute("type") == "geometry") {
             geom = e.attribute("value");
-           Mlt::Geometry geometry(geom.toUtf8().data(), previousDuration, width, height);
-           e.setAttribute("value", geometry.serialise(start, start + duration));
-       }
+            Mlt::Geometry geometry(geom.toUtf8().data(), previousDuration, width, height);
+            e.setAttribute("value", geometry.serialise(start, start + duration));
+        }
     }
 }
 
@@ -796,15 +796,15 @@ void ClipItem::paint(QPainter *painter,
     QColor textBgColor;
     QPen framePen;
     if (isSelected() || (parentItem() && parentItem()->isSelected())) {
-       textColor = palette.highlightedText().color();
-       textBgColor = palette.highlight().color();
+        textColor = palette.highlightedText().color();
+        textBgColor = palette.highlight().color();
         framePen.setColor(textBgColor);
-       paintColor.setRed(qMin(paintColor.red() * 2, 255));
+        paintColor.setRed(qMin(paintColor.red() * 2, 255));
     }
     else {
-       textColor = palette.text().color();
-       textBgColor = palette.window().color();
-       textBgColor.setAlpha(200);
+        textColor = palette.text().color();
+        textBgColor = palette.window().color();
+        textBgColor.setAlpha(200);
         framePen.setColor(m_paintColor.darker());
     }
     const QRectF exposed = option->exposedRect;
@@ -823,28 +823,28 @@ void ClipItem::paint(QPainter *painter,
     painter->setPen(m_paintColor.darker());
     // draw thumbnails
     if (KdenliveSettings::videothumbnails() && !isAudioOnly()) {
-       QRectF thumbRect;
+        QRectF thumbRect;
         if ((m_clipType == IMAGE || m_clipType == TEXT) && !m_startPix.isNull()) {
-           if (thumbRect.isNull()) thumbRect = QRectF(0, 0, mapped.height() / m_startPix.height() * m_startPix.width(), mapped.height());
-           thumbRect.moveTopRight(mapped.topRight());
-           painter->drawPixmap(thumbRect, m_startPix, m_startPix.rect());
-           //const QPointF top = mapped.topRight() - QPointF(m_startPix.width() - 1, 0);
+            if (thumbRect.isNull()) thumbRect = QRectF(0, 0, mapped.height() / m_startPix.height() * m_startPix.width(), mapped.height());
+            thumbRect.moveTopRight(mapped.topRight());
+            painter->drawPixmap(thumbRect, m_startPix, m_startPix.rect());
+            //const QPointF top = mapped.topRight() - QPointF(m_startPix.width() - 1, 0);
             //painter->drawPixmap(top, m_startPix);
             //QLineF l2(top.x(), mapped.top(), top.x(), mapped.bottom());
             //painter->drawLine(l2);
         } else if (!m_endPix.isNull()) {
-           if (thumbRect.isNull()) thumbRect = QRectF(0, 0, mapped.height() / m_endPix.height() * m_endPix.width(), mapped.height());
-           thumbRect.moveTopRight(mapped.topRight());
-           painter->drawPixmap(thumbRect, m_endPix, m_endPix.rect());
-           //const QPointF top = mapped.topRight() - QPointF(m_endPix.width() - 1, 0);
+            if (thumbRect.isNull()) thumbRect = QRectF(0, 0, mapped.height() / m_endPix.height() * m_endPix.width(), mapped.height());
+            thumbRect.moveTopRight(mapped.topRight());
+            painter->drawPixmap(thumbRect, m_endPix, m_endPix.rect());
+            //const QPointF top = mapped.topRight() - QPointF(m_endPix.width() - 1, 0);
             //painter->drawPixmap(top, m_endPix);
             //QLineF l2(top.x(), mapped.top(), top.x(), mapped.bottom());
             //painter->drawLine(l2);
         }
         if (!m_startPix.isNull()) {
-           if (thumbRect.isNull()) thumbRect = QRectF(0, 0, mapped.height() / m_startPix.height() * m_startPix.width(), mapped.height());
-           thumbRect.moveTopLeft(mapped.topLeft());
-           painter->drawPixmap(thumbRect, m_startPix, m_startPix.rect());
+            if (thumbRect.isNull()) thumbRect = QRectF(0, 0, mapped.height() / m_startPix.height() * m_startPix.width(), mapped.height());
+            thumbRect.moveTopLeft(mapped.topLeft());
+            painter->drawPixmap(thumbRect, m_startPix, m_startPix.rect());
             //painter->drawPixmap(mapped.topLeft(), m_startPix);
             //QLineF l2(mapped.left() + m_startPix.width(), mapped.top(), mapped.left() + m_startPix.width(), mapped.bottom());
             //painter->drawLine(l2);
@@ -875,8 +875,8 @@ void ClipItem::paint(QPainter *painter,
                         QPointF xpos = startPos + QPointF(FRAME_SIZE *(i - startOffset), 0);
                         if (img.isNull()) missing << i;
                         else {
-                           painter->drawImage(xpos, img);
-                       }
+                            painter->drawImage(xpos, img);
+                        }
                         painter->drawLine(xpos, xpos + QPointF(0, mapped.height()));
                     }
                     if (!missing.isEmpty()) {
@@ -920,14 +920,14 @@ void ClipItem::paint(QPainter *painter,
         if (channels >= 1) {
             emit prepareAudioThumb(scale, mappedStartPixel, mappedEndPixel, channels, (int) (mappedRect.height() + 0.5));
         }
-       QRectF pixmapRect(0, mappedRect.y(), 100, mappedRect.height());
+        QRectF pixmapRect(0, mappedRect.y(), 100, mappedRect.height());
         for (int startCache = mappedStartPixel - (mappedStartPixel) % 100; startCache < mappedEndPixel; startCache += 100) {
             if (!m_audioThumbCachePic.value(startCache).isNull()) {
                 //painter->drawPixmap(clipStart + startCache - cropLeft, mappedRect.y(),  m_audioThumbCachePic.value(startCache));
-               QPixmap pix(m_audioThumbCachePic.value(startCache));
-               pixmapRect.moveLeft(clipStart + startCache - cropLeft);
-               painter->drawPixmap(pixmapRect,  pix, pix.rect());
-           }
+                QPixmap pix(m_audioThumbCachePic.value(startCache));
+                pixmapRect.moveLeft(clipStart + startCache - cropLeft);
+                painter->drawPixmap(pixmapRect,  pix, pix.rect());
+            }
         }
     }
     
@@ -943,27 +943,27 @@ void ClipItem::paint(QPainter *painter,
         if (!m_effectNames.isEmpty() && mapped.width() > 40) {
             QRectF txtBounding = painter->boundingRect(mapped, Qt::AlignLeft | Qt::AlignTop, m_effectNames);
             QColor bColor = palette.window().color();
-           QColor tColor = palette.text().color();
-           tColor.setAlpha(220);
+            QColor tColor = palette.text().color();
+            tColor.setAlpha(220);
             if (m_timeLine && m_timeLine->state() == QTimeLine::Running) {
                 qreal value = m_timeLine->currentValue();
                 txtBounding.setWidth(txtBounding.width() * value);
                 bColor.setAlpha(100 + 50 * value);
             };
 
-           painter->setBrush(bColor);
-           painter->setPen(Qt::NoPen);
-           painter->drawRoundedRect(txtBounding.adjusted(-1, -2, 4, -1), 3, 3);
+            painter->setBrush(bColor);
+            painter->setPen(Qt::NoPen);
+            painter->drawRoundedRect(txtBounding.adjusted(-1, -2, 4, -1), 3, 3);
             painter->setPen(tColor);
             painter->drawText(txtBounding.adjusted(2, 0, 1, -1), Qt::AlignCenter, m_effectNames);
         }
 
         // Draw clip name
         const QRectF txtBounding2 = painter->boundingRect(mapped, Qt::AlignRight | Qt::AlignTop, m_clipName + ' ').adjusted(0, -1, 0, -1);
-       painter->setPen(Qt::NoPen);
+        painter->setPen(Qt::NoPen);
         painter->fillRect(txtBounding2.adjusted(-3, 0, 0, 0), textBgColor);
         painter->setBrush(QBrush(Qt::NoBrush));
-       painter->setPen(textColor);
+        painter->setPen(textColor);
         if (m_videoOnly) {
             painter->drawPixmap(txtBounding2.topLeft() - QPointF(17, -1), m_videoPix);
         } else if (m_audioOnly) {
@@ -978,7 +978,7 @@ void ClipItem::paint(QPainter *painter,
             QList < CommentedTime >::Iterator it = markers.begin();
             GenTime pos;
             double framepos;
-           QBrush markerBrush(QColor(120, 120, 0, 140));
+            QBrush markerBrush(QColor(120, 120, 0, 140));
             QPen pen = painter->pen();
 
             for (; it != markers.end(); ++it) {
@@ -987,8 +987,8 @@ void ClipItem::paint(QPainter *painter,
                     if (pos > cropDuration()) break;
                     QLineF l(rect().x() + pos.frames(m_fps), rect().y(), rect().x() + pos.frames(m_fps), rect().bottom());
                     QLineF l2 = transformation.map(l);
-                   pen.setColor(CommentedTime::markerColor((*it).markerType()));
-                   pen.setStyle(Qt::DotLine);
+                    pen.setColor(CommentedTime::markerColor((*it).markerType()));
+                    pen.setStyle(Qt::DotLine);
                     painter->setPen(pen);
                     painter->drawLine(l2);
                     if (KdenliveSettings::showmarkers()) {
@@ -997,7 +997,7 @@ void ClipItem::paint(QPainter *painter,
                         const QRectF r2 = transformation.mapRect(r1);
                         const QRectF txtBounding3 = painter->boundingRect(r2, Qt::AlignLeft | Qt::AlignTop, ' ' + (*it).comment() + ' ');
                         painter->setBrush(markerBrush);
-                       pen.setStyle(Qt::SolidLine);
+                        pen.setStyle(Qt::SolidLine);
                         painter->setPen(pen);
                         painter->drawRect(txtBounding3);
                         painter->setBrush(Qt::NoBrush);
@@ -1078,32 +1078,32 @@ OPERATIONTYPE ClipItem::operationMode(const QPointF &pos)
     if (qAbs((int)(pos.x() - (rect.x() + m_startFade))) < maximumOffset  && qAbs((int)(pos.y() - rect.y())) < 6) {
         return FADEIN;
     } else if ((pos.x() <= rect.x() + rect.width() / 2) && pos.x() - rect.x() < maximumOffset && (rect.bottom() - pos.y() > addtransitionOffset)) {
-       // If we are in a group, allow resize only if all clips start at same position
-       if (parentItem()) {
-           QGraphicsItemGroup *dragGroup = static_cast <QGraphicsItemGroup *>(parentItem());
-           QList<QGraphicsItem *> list = dragGroup->childItems();
-           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;
-               }
-           }
-       }
+        // If we are in a group, allow resize only if all clips start at same position
+        if (parentItem()) {
+            QGraphicsItemGroup *dragGroup = static_cast <QGraphicsItemGroup *>(parentItem());
+            QList<QGraphicsItem *> list = dragGroup->childItems();
+            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;
+                }
+            }
+        }
         return RESIZESTART;
     } else if (qAbs((int)(pos.x() - (rect.x() + rect.width() - m_endFade))) < maximumOffset && qAbs((int)(pos.y() - rect.y())) < 6) {
         return FADEOUT;
     } else if ((pos.x() >= rect.x() + rect.width() / 2) && (rect.right() - pos.x() < maximumOffset) && (rect.bottom() - pos.y() > addtransitionOffset)) {
-       // If we are in a group, allow resize only if all clips end at same position
-       if (parentItem()) {
-           QGraphicsItemGroup *dragGroup = static_cast <QGraphicsItemGroup *>(parentItem());
-           QList<QGraphicsItem *> list = dragGroup->childItems();
-           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;
-               }
-           }
-       }
+        // If we are in a group, allow resize only if all clips end at same position
+        if (parentItem()) {
+            QGraphicsItemGroup *dragGroup = static_cast <QGraphicsItemGroup *>(parentItem());
+            QList<QGraphicsItem *> list = dragGroup->childItems();
+            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;
+                }
+            }
+        }
         return RESIZEEND;
     } else if ((pos.x() - rect.x() < 16 / scale) && (rect.bottom() - pos.y() <= addtransitionOffset)) {
         return TRANSITIONSTART;
@@ -1163,12 +1163,12 @@ void ClipItem::slotPrepareAudioThumb(double pixelForOneFrame, int startpixel, in
 {
     // Bail out, if caller provided invalid data
     if (channels <= 0) {
-       kWarning() << "Unable to draw image with " << channels << "number of channels";
+        kWarning() << "Unable to draw image with " << channels << "number of channels";
         return;
     }
     int factor = 64;
     if (KdenliveSettings::normaliseaudiothumbs()) {
-       factor = m_clip->getProperty("audio_max").toInt();
+        factor = m_clip->getProperty("audio_max").toInt();
     }
 
     //kDebug() << "// PREP AUDIO THMB FRMO : scale:" << pixelForOneFrame<< ", from: " << startpixel << ", to: " << endpixel;
@@ -1186,30 +1186,30 @@ void ClipItem::slotPrepareAudioThumb(double pixelForOneFrame, int startpixel, in
         if (m_framePixelWidth == pixelForOneFrame && m_audioThumbCachePic.contains(startCache))
             continue;
         if (m_audioThumbCachePic.value(startCache).isNull() || m_framePixelWidth != pixelForOneFrame) {
-           QPixmap pix(100, pixelHeight);
-           pix.fill(QColor(180, 180, 180, 150));
-           m_audioThumbCachePic[startCache] = pix;
+            QPixmap pix(100, pixelHeight);
+            pix.fill(QColor(180, 180, 180, 150));
+            m_audioThumbCachePic[startCache] = pix;
         }
         positiveChannelPaths.clear();
         negativeChannelPaths.clear();
         
         QPainter pixpainter(&m_audioThumbCachePic[startCache]);
 
-       for (int i = 0; i < channels; ++i) {
-           if (simplifiedAudio) {
-               positiveChannelPaths[i].moveTo(-1, channelHeight);
-           }
-           else if (fullAreaDraw) {
-               positiveChannelPaths[i].moveTo(-1, channelHeight*i + channelHeight / 2);
-               negativeChannelPaths[i].moveTo(-1, channelHeight*i + channelHeight / 2);
-           }
-           else {
-               positiveChannelPaths[i].moveTo(-1, channelHeight*i + channelHeight / 2);
-               audiopen.setColor(QColor(60, 60, 60, 50));
-               pixpainter.setPen(audiopen);
-               pixpainter.drawLine(0, channelHeight*i + channelHeight / 2, 100, channelHeight*i + channelHeight / 2);
-           }
-       }
+        for (int i = 0; i < channels; ++i) {
+            if (simplifiedAudio) {
+                positiveChannelPaths[i].moveTo(-1, channelHeight);
+            }
+            else if (fullAreaDraw) {
+                positiveChannelPaths[i].moveTo(-1, channelHeight*i + channelHeight / 2);
+                negativeChannelPaths[i].moveTo(-1, channelHeight*i + channelHeight / 2);
+            }
+            else {
+                positiveChannelPaths[i].moveTo(-1, channelHeight*i + channelHeight / 2);
+                audiopen.setColor(QColor(60, 60, 60, 50));
+                pixpainter.setPen(audiopen);
+                pixpainter.drawLine(0, channelHeight*i + channelHeight / 2, 100, channelHeight*i + channelHeight / 2);
+            }
+        }
 
         for (int samples = 0; samples <= 100; samples++) {
             double frame = (double)(samples + startCache - 0) / pixelForOneFrame;
@@ -1219,40 +1219,40 @@ void ClipItem::slotPrepareAudioThumb(double pixelForOneFrame, int startpixel, in
             const QMap<int, QByteArray> frame_channel_data = baseClip()->audioFrameCache.value((int)frame);
 
             for (int channel = 0; channel < channels && !frame_channel_data.value(channel).isEmpty(); channel++) {
-               int y = channelHeight * channel + channelHeight / 2;
-               if (simplifiedAudio) {
-                   double delta = qAbs((frame_channel_data.value(channel).at(sample) - 63.5)  * channelHeight / factor);
-                   positiveChannelPaths[channel].lineTo(samples, channelHeight - delta);
-               } else if (fullAreaDraw) {
-                   double delta = qAbs((frame_channel_data.value(channel).at(sample) - 63.5)  * channelHeight / (2 * factor));
+                int y = channelHeight * channel + channelHeight / 2;
+                if (simplifiedAudio) {
+                    double delta = qAbs((frame_channel_data.value(channel).at(sample) - 63.5)  * channelHeight / factor);
+                    positiveChannelPaths[channel].lineTo(samples, channelHeight - delta);
+                } else if (fullAreaDraw) {
+                    double delta = qAbs((frame_channel_data.value(channel).at(sample) - 63.5)  * channelHeight / (2 * factor));
                     positiveChannelPaths[channel].lineTo(samples, y + delta);
                     negativeChannelPaths[channel].lineTo(samples, y - delta);
                 } else {
-                   double delta = (frame_channel_data.value(channel).at(sample) - 63.5)  * channelHeight / (2 * factor);
-                   positiveChannelPaths[channel].lineTo(samples, y + delta);
+                    double delta = (frame_channel_data.value(channel).at(sample) - 63.5)  * channelHeight / (2 * factor);
+                    positiveChannelPaths[channel].lineTo(samples, y + delta);
                 }
             }
         }
         for (int channel = 0; channel < channels; channel++) {
-           if (simplifiedAudio) {
-               positiveChannelPaths[channel].lineTo(101, channelHeight);
-           } else if (fullAreaDraw) {
-               int y = channelHeight * channel + channelHeight / 2;
-               positiveChannelPaths[channel].lineTo(101, y);
-               negativeChannelPaths[channel].lineTo(101, y);
-           }
-       }
+            if (simplifiedAudio) {
+                positiveChannelPaths[channel].lineTo(101, channelHeight);
+            } else if (fullAreaDraw) {
+                int y = channelHeight * channel + channelHeight / 2;
+                positiveChannelPaths[channel].lineTo(101, y);
+                negativeChannelPaths[channel].lineTo(101, y);
+            }
+        }
         if (fullAreaDraw || simplifiedAudio) {
-           audiopen.setColor(QColor(80, 80, 80, 200));
-           pixpainter.setPen(audiopen);
-           pixpainter.setBrush(QBrush(QColor(120, 120, 120, 200)));
-       }
-       else {
-           audiopen.setColor(QColor(60, 60, 60, 100));
-           pixpainter.setPen(audiopen);
-           pixpainter.setBrush(Qt::NoBrush);
-       }
-       pixpainter.setRenderHint(QPainter::Antialiasing, false);
+            audiopen.setColor(QColor(80, 80, 80, 200));
+            pixpainter.setPen(audiopen);
+            pixpainter.setBrush(QBrush(QColor(120, 120, 120, 200)));
+        }
+        else {
+            audiopen.setColor(QColor(60, 60, 60, 100));
+            pixpainter.setPen(audiopen);
+            pixpainter.setBrush(Qt::NoBrush);
+        }
+        pixpainter.setRenderHint(QPainter::Antialiasing, false);
         for (int i = 0; i < channels; ++i) {
             if (fullAreaDraw) {
                 pixpainter.drawPath(positiveChannelPaths[i].united(negativeChannelPaths.value(i)));
@@ -1387,9 +1387,9 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
 {
     if (change == QGraphicsItem::ItemSelectedChange) {
         if (value.toBool())
-           setZValue(10);
+            setZValue(10);
         else
-           setZValue(2);
+            setZValue(2);
     }
     if (change == ItemPositionChange && scene()) {
         // calculate new position.
@@ -1399,16 +1399,16 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
         int xpos = projectScene()->getSnapPointForPos((int) newPos.x(), KdenliveSettings::snaptopoints());
         xpos = qMax(xpos, 0);
         newPos.setX(xpos);
-       // Warning: newPos gives a position relative to the click event, so hack to get absolute pos
-       int yOffset = property("y_absolute").toInt() + newPos.y();
+        // Warning: newPos gives a position relative to the click event, so hack to get absolute pos
+        int yOffset = property("y_absolute").toInt() + newPos.y();
         int newTrack = yOffset / KdenliveSettings::trackheight();
         newTrack = qMin(newTrack, projectScene()->tracksCount() - 1);
         newTrack = qMax(newTrack, 0);
-       QStringList lockedTracks = property("locked_tracks").toStringList();
-       if (lockedTracks.contains(QString::number(newTrack))) {
-           // Trying to move to a locked track
-           return pos();
-       }
+        QStringList lockedTracks = property("locked_tracks").toStringList();
+        if (lockedTracks.contains(QString::number(newTrack))) {
+            // Trying to move to a locked track
+            return pos();
+        }
         newPos.setY((int)(newTrack  * KdenliveSettings::trackheight() + 1));
         // Only one clip is moving
         QRectF sceneShape = rect();
@@ -1467,9 +1467,9 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
         return newPos;
     }
     if (change == ItemParentChange) {
-       QGraphicsItem* parent = value.value<QGraphicsItem*>();
-       if (parent) m_paintColor = m_baseColor.lighter(135);
-       else m_paintColor = m_baseColor;
+        QGraphicsItem* parent = value.value<QGraphicsItem*>();
+        if (parent) m_paintColor = m_baseColor.lighter(135);
+        else m_paintColor = m_baseColor;
     }
     return QGraphicsItem::itemChange(change, value);
 }
@@ -1564,7 +1564,7 @@ EffectsParameterList ClipItem::addEffect(QDomElement effect, bool /*animate*/)
     int ix;
     QDomElement insertedEffect;
     if (!effect.hasAttribute("kdenlive_ix")) {
-       // effect dropped from effect list
+        // effect dropped from effect list
         ix = effectsCounter();
     } else ix = effect.attribute("kdenlive_ix").toInt();
     if (!m_effectList.isEmpty() && ix <= m_effectList.count()) {
@@ -1578,13 +1578,13 @@ EffectsParameterList ClipItem::addEffect(QDomElement effect, bool /*animate*/)
     int effectOut;
 
     if (effect.attribute("tag") == "affine") {
-       // special case: the affine effect needs in / out points
-       effectIn = effect.attribute("in").toInt();
-       effectOut = effect.attribute("out").toInt();
+        // special case: the affine effect needs in / out points
+        effectIn = effect.attribute("in").toInt();
+        effectOut = effect.attribute("out").toInt();
     }
     else {
-       effectIn = EffectsList::parameter(effect, "in").toInt();
-       effectOut = EffectsList::parameter(effect, "out").toInt();
+        effectIn = EffectsList::parameter(effect, "in").toInt();
+        effectOut = EffectsList::parameter(effect, "out").toInt();
     }
     
     EffectsParameterList parameters;
@@ -1603,38 +1603,38 @@ EffectsParameterList ClipItem::addEffect(QDomElement effect, bool /*animate*/)
 
     // check if it is a fade effect
     if (effectId == "fadein") {
-       needRepaint = true;
+        needRepaint = true;
         if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) {
-           fade = effectOut - effectIn;
+            fade = effectOut - effectIn;
         }/* else {
-           QDomElement fadein = m_effectList.getEffectByTag(QString(), "fade_from_black");
+        QDomElement fadein = m_effectList.getEffectByTag(QString(), "fade_from_black");
             if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
             else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
         }*/
     } else if (effectId == "fade_from_black") {
-       needRepaint = true;
+        needRepaint = true;
         if (m_effectList.hasEffect(QString(), "fadein") == -1) {
-           fade = effectOut - effectIn;
+            fade = effectOut - effectIn;
         }/* else {
-           QDomElement fadein = m_effectList.getEffectByTag(QString(), "fadein");
+        QDomElement fadein = m_effectList.getEffectByTag(QString(), "fadein");
             if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
             else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
         }*/
-     } else if (effectId == "fadeout") {
-       needRepaint = true;
+    } else if (effectId == "fadeout") {
+        needRepaint = true;
         if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) {
-           fade = effectIn - effectOut;
+            fade = effectIn - effectOut;
         } /*else {
-           QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black");
+        QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black");
             if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
             else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
         }*/
     } else if (effectId == "fade_to_black") {
-       needRepaint = true;
+        needRepaint = true;
         if (m_effectList.hasEffect(QString(), "fadeout") == -1) {
-           fade = effectIn - effectOut;
+            fade = effectIn - effectOut;
         }/* else {
-           QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout");
+        QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout");
             if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
             else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
         }*/
@@ -1709,7 +1709,7 @@ EffectsParameterList ClipItem::addEffect(QDomElement effect, bool /*animate*/)
     return parameters;
 }
 
-void ClipItem::deleteEffect(QString index)
+void ClipItem::deleteEffect(const QString &index)
 {
     bool needRepaint = false;
     int ix = index.toInt();
@@ -1717,11 +1717,11 @@ void ClipItem::deleteEffect(QString index)
     QDomElement effect = m_effectList.itemFromIndex(ix);
     QString effectId = effect.attribute("id");
     if ((effectId == "fadein" && hasEffect(QString(), "fade_from_black") == -1) ||
-       (effectId == "fade_from_black" && hasEffect(QString(), "fadein") == -1)) {
+            (effectId == "fade_from_black" && hasEffect(QString(), "fadein") == -1)) {
         m_startFade = 0;
         needRepaint = true;
     } else if ((effectId == "fadeout" && hasEffect(QString(), "fade_to_black") == -1) ||
-       (effectId == "fade_to_black" && hasEffect(QString(), "fadeout") == -1)) {
+               (effectId == "fade_to_black" && hasEffect(QString(), "fadeout") == -1)) {
         m_endFade = 0;
         needRepaint = true;
     } else if (EffectsList::hasKeyFrames(effect)) needRepaint = true;
@@ -1734,8 +1734,9 @@ void ClipItem::deleteEffect(QString index)
             setSelectedEffect(m_effectList.count());
         } else setSelectedEffect(ix);
     }
-    if (needRepaint) update(boundingRect());
-    else {
+    if (needRepaint) {
+        update(boundingRect());
+    } else {
         QRectF r = boundingRect();
         r.setHeight(20);
         update(r);
@@ -1792,11 +1793,11 @@ int ClipItem::nextFreeEffectGroupIndex() const
     int freeGroupIndex = 0;
     for (int i = 0; i < m_effectList.count(); ++i) {
         QDomElement effect = m_effectList.at(i);
-       EffectInfo effectInfo;
-       effectInfo.fromString(effect.attribute("kdenlive_info"));
-       if (effectInfo.groupIndex >= freeGroupIndex) {
-           freeGroupIndex = effectInfo.groupIndex + 1;
-       }
+        EffectInfo effectInfo;
+        effectInfo.fromString(effect.attribute("kdenlive_info"));
+        if (effectInfo.groupIndex >= freeGroupIndex) {
+            freeGroupIndex = effectInfo.groupIndex + 1;
+        }
     }
     return freeGroupIndex;
 }
@@ -1805,28 +1806,28 @@ int ClipItem::nextFreeEffectGroupIndex() const
 void ClipItem::dropEvent(QGraphicsSceneDragDropEvent * event)
 {
     if (event->proposedAction() == Qt::CopyAction && scene() && !scene()->views().isEmpty()) {
-       const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist"));
-       event->acceptProposedAction();
-       QDomDocument doc;
-       doc.setContent(effects, true);
-       QDomElement e = doc.documentElement();
-       if (e.tagName() == "effectgroup") {
-           // dropped an effect group
-           QDomNodeList effectlist = e.elementsByTagName("effect");
-           int freeGroupIndex = nextFreeEffectGroupIndex();
-           EffectInfo effectInfo;
-           for (int i = 0; i < effectlist.count(); ++i) {
-               QDomElement effect = effectlist.at(i).toElement();
-               effectInfo.fromString(effect.attribute("kdenlive_info"));
-               effectInfo.groupIndex = freeGroupIndex;
-               effect.setAttribute("kdenlive_info", effectInfo.toString());
-               effect.removeAttribute("kdenlive_ix");
-           }
-       } else {
-           // single effect dropped
-           e.removeAttribute("kdenlive_ix");
-       }
-        CustomTrackView *view = (CustomTrackView *) scene()->views()[0];
+        const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist"));
+        event->acceptProposedAction();
+        QDomDocument doc;
+        doc.setContent(effects, true);
+        QDomElement e = doc.documentElement();
+        if (e.tagName() == "effectgroup") {
+            // dropped an effect group
+            QDomNodeList effectlist = e.elementsByTagName("effect");
+            int freeGroupIndex = nextFreeEffectGroupIndex();
+            EffectInfo effectInfo;
+            for (int i = 0; i < effectlist.count(); ++i) {
+                QDomElement effect = effectlist.at(i).toElement();
+                effectInfo.fromString(effect.attribute("kdenlive_info"));
+                effectInfo.groupIndex = freeGroupIndex;
+                effect.setAttribute("kdenlive_info", effectInfo.toString());
+                effect.removeAttribute("kdenlive_ix");
+            }
+        } else {
+            // single effect dropped
+            e.removeAttribute("kdenlive_ix");
+        }
+        CustomTrackView *view = (CustomTrackView *) scene()->views().first();
         if (view) view->slotDropEffect(this, e, m_info.startPos, track());
     }
     else return;
@@ -1837,7 +1838,7 @@ void ClipItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
 {
     if (isItemLocked()) event->setAccepted(false);
     else if (event->mimeData()->hasFormat("kdenlive/effectslist")) {
-       event->acceptProposedAction();
+        event->acceptProposedAction();
     } else event->setAccepted(false);
 }
 
@@ -1873,9 +1874,9 @@ void ClipItem::setAudioOnly(bool force)
         else m_baseColor = QColor(141, 166, 215);
     }
     if (parentItem())
-       m_paintColor = m_baseColor.lighter(135);
+        m_paintColor = m_baseColor.lighter(135);
     else
-       m_paintColor = m_baseColor;
+        m_paintColor = m_baseColor;
     m_audioThumbCachePic.clear();
 }
 
@@ -1993,7 +1994,7 @@ Mlt::Producer *ClipItem::getProducer(int track, bool trackSpecific)
         return m_clip->getProducer(trackSpecific ? track : -1);
 }
 
-QMap<int, QDomElement> ClipItem::adjustEffectsToDuration(int width, int height, ItemInfo oldInfo)
+QMap<int, QDomElement> ClipItem::adjustEffectsToDuration(int width, int height, const ItemInfo &oldInfo)
 {
     QMap<int, QDomElement> effects;
     for (int i = 0; i < m_effectList.count(); ++i) {
@@ -2020,7 +2021,7 @@ QMap<int, QDomElement> ClipItem::adjustEffectsToDuration(int width, int height,
                 }
                 if (effects.contains(i)) {
                     setFadeIn(out - in);
-               }
+                }
             } else {
                 if (out != clipEnd) {
                     effects[i] = effect.cloneNode().toElement();
@@ -2046,9 +2047,9 @@ QMap<int, QDomElement> ClipItem::adjustEffectsToDuration(int width, int height,
             EffectsList::setParameter(effect, "frame", QString::number(frame - diff));
             continue;
         } else if (effect.attribute("id") == "pan_zoom") {
-           effect.setAttribute("in", cropStart().frames(m_fps));
-           effect.setAttribute("out", (cropStart() + cropDuration()).frames(m_fps) - 1);
-       }
+            effect.setAttribute("in", cropStart().frames(m_fps));
+            effect.setAttribute("out", (cropStart() + cropDuration()).frames(m_fps) - 1);
+        }
 
         QDomNodeList params = effect.elementsByTagName("parameter");
         for (int j = 0; j < params.count(); j++) {
@@ -2088,12 +2089,12 @@ bool ClipItem::updateNormalKeyframes(QDomElement parameter, ItemInfo oldInfo)
     const QStringList data = parameter.attribute("keyframes").split(';', QString::SkipEmptyParts);
     QMap <int, double> keyframes;
     foreach (QString keyframe, data) {
-       int keyframepos = keyframe.section(':', 0, 0).toInt();
-       // if keyframe was at clip start, update it
-       if (keyframepos == oldin) {
-           keyframepos = in;
-           keyFrameUpdated = true;
-       }
+        int keyframepos = keyframe.section(':', 0, 0).toInt();
+        // if keyframe was at clip start, update it
+        if (keyframepos == oldin) {
+            keyframepos = in;
+            keyFrameUpdated = true;
+        }
         keyframes[keyframepos] = locale.toDouble(keyframe.section(':', 1, 1));
     }
 
@@ -2138,7 +2139,7 @@ bool ClipItem::updateNormalKeyframes(QDomElement parameter, ItemInfo oldInfo)
                 relPos = (out - lastPos) / (qreal)(i.key() - lastPos + 1);
                 keyframes[out] = lastValue + (i.value() - lastValue) * relPos;
             }
-         }
+        }
         lastPos = i.key();
         lastValue = i.value();
         if (endFound)
index c5158fd3b11c3540c55da437f43d2b5587b8c34b..ac9f1df9cbb71f8ee2a3b3c7233a5b930c1866c1 100644 (file)
@@ -78,7 +78,7 @@ public:
     EffectsParameterList addEffect(QDomElement effect, bool animate = true);
 
     /** @brief Deletes the effect with id @param index. */
-    void deleteEffect(QString index);
+    void deleteEffect(const QString &index);
 
     /** @brief Gets the number of effects in this clip. */
     int effectsCount();
@@ -180,7 +180,7 @@ public:
     bool updateNormalKeyframes(QDomElement parameter, ItemInfo oldInfo);
 
     /** @brief Adjusts effects after a clip duration change. */
-    QMap<int, QDomElement> adjustEffectsToDuration(int width, int height, ItemInfo oldInfo);
+    QMap<int, QDomElement> adjustEffectsToDuration(int width, int height, const ItemInfo &oldInfo);
 
     /** Returns the necessary (audio, video, general) producer.
      * @param track Track of the requested producer
index 0753b49d88089244e5ea30d2ef2e5a92dd440641..e3a93702a4492e9ba9d69abb39708381c10aeb97 100644 (file)
@@ -102,7 +102,7 @@ private:
     void loadVideoProperties(const QMap<QString, QString> &props);
 
 signals:
-    void addMarkers(const QString &, QList <CommentedTime>);
+    void addMarkers(const QString &, const QList <CommentedTime>&);
     void deleteProxy(const QString&);
     void applyNewClipProperties(const QString&, const QMap <QString, QString> &, const QMap <QString, QString> &, bool, bool);
     void saveMarkers(const QString &id);
index c2ca783c7ffd782d1cb64a2b646ddc2bbcf2358a..6d2089826367af45172943f6ce5603724e2f3177 100644 (file)
@@ -41,10 +41,10 @@ public:
     void updateEffectLabel(const QStringList &effects);
 
 protected:
-    virtual void mousePressEvent(QMouseEvent * event);
-    virtual void mouseDoubleClickEvent(QMouseEvent * event);
-    virtual void dropEvent(QDropEvent * event);
-    virtual void dragEnterEvent(QDragEnterEvent *event);
+    void mousePressEvent(QMouseEvent * event);
+    void mouseDoubleClickEvent(QMouseEvent * event);
+    void dropEvent(QDropEvent * event);
+    void dragEnterEvent(QDragEnterEvent *event);
 
 private:
     int m_index;
@@ -63,10 +63,10 @@ signals:
     void switchTrackAudio(int);
     void switchTrackVideo(int);
     void switchTrackLock(int);
-    void renameTrack(int, QString);
+    void renameTrack(int, const QString&);
     void selectTrack(int);
     void configTrack(int);
-    void addTrackEffect(const QDomElement, int);
+    void addTrackEffect(const QDomElement &, int);
     void showTrackEffects(int);
 };
 
index 7a7b160972050a04fd4b03ff31802d7c3eb4b538..c706f6a6e1acaed516ad1d954478c5d7ff97981b 100644 (file)
@@ -116,7 +116,7 @@ void initEffects::refreshLumas()
 }
 
 // static
-QDomDocument initEffects::getUsedCustomEffects(QMap <QString, QString> effectids)
+QDomDocument initEffects::getUsedCustomEffects(const QMap <QString, QString>& effectids)
 {
     QMapIterator<QString, QString> i(effectids);
     int ix;
index 780a80565abe8e3fe7a05ede6216883caf230a93..2b2a6c283e788cbe0921d2f720dd4a396489a37e 100644 (file)
@@ -57,7 +57,7 @@ public:
     static void parseEffectFiles(const QString &locale = QString());
     static void refreshLumas();
     static QDomDocument createDescriptionFromMlt(Mlt::Repository* repository, const QString& type, const QString& name);
-    static QDomDocument getUsedCustomEffects(QMap <QString, QString> effectids);
+    static QDomDocument getUsedCustomEffects(const QMap<QString, QString> &effectids);
 
     /** @brief Fills the transitions list.
      * @param repository MLT repository
index 50e3dea68dac03d19639c04feee447a3fef1639e..f8eb77f24445a6353b5353410dca099d8b2ebec8 100644 (file)
@@ -487,14 +487,11 @@ void KdenliveSettingsDialog::slotEditVideoApplication()
 {
     KService::Ptr service;
     QPointer<KOpenWithDialog> dlg = new KOpenWithDialog(KUrl::List(), i18n("Select default video player"), m_configEnv.kcfg_defaultplayerapp->text(), this);
-    if (dlg->exec() != QDialog::Accepted)
-    {
-        delete dlg;
-        return;
+    if (dlg->exec() == QDialog::Accepted) {
+        service = dlg->service();
+        m_configEnv.kcfg_defaultplayerapp->setText(service->exec());
     }
 
-    service = dlg->service();
-    m_configEnv.kcfg_defaultplayerapp->setText(service->exec());
     delete dlg;
 }
 
@@ -502,14 +499,11 @@ void KdenliveSettingsDialog::slotEditAudioApplication()
 {
     KService::Ptr service;
     QPointer<KOpenWithDialog> dlg = new KOpenWithDialog(KUrl::List(), i18n("Select default audio editor"), m_configEnv.kcfg_defaultaudioapp->text(), this);
-    if (dlg->exec() != QDialog::Accepted)
-    {
-        delete dlg;
-        return;
+    if (dlg->exec() == QDialog::Accepted) {
+        service = dlg->service();
+        m_configEnv.kcfg_defaultaudioapp->setText(service->exec());
     }
 
-    service = dlg->service();
-    m_configEnv.kcfg_defaultaudioapp->setText(service->exec());
     delete dlg;
 }
 
@@ -517,13 +511,10 @@ void KdenliveSettingsDialog::slotEditImageApplication()
 {
     KService::Ptr service;
     QPointer<KOpenWithDialog> dlg = new KOpenWithDialog(KUrl::List(), i18n("Select default image editor"), m_configEnv.kcfg_defaultimageapp->text(), this);
-    if (dlg->exec() != QDialog::Accepted)
-    {
-        delete dlg;
-        return;
+    if (dlg->exec() == QDialog::Accepted) {
+        service = dlg->service();
+        m_configEnv.kcfg_defaultimageapp->setText(service->exec());
     }
-    service = dlg->service();
-    m_configEnv.kcfg_defaultimageapp->setText(service->exec());
     delete dlg;
 }
 
index 6d1f9a38a8f87d11572b19e47fa3e1b9252d6d05..701609bf35ab332353ff3bc5184ea2256eea7473 100644 (file)
@@ -36,13 +36,13 @@ public:
     int frameLength;
 
 protected:
-    virtual void paintEvent(QPaintEvent * /*e*/);
-    virtual void wheelEvent(QWheelEvent * e);
-    virtual void mousePressEvent(QMouseEvent * event);
-    virtual void mouseMoveEvent(QMouseEvent * event);
-    virtual void mouseReleaseEvent(QMouseEvent * event);
-    virtual void mouseDoubleClickEvent(QMouseEvent * event);
-    virtual void leaveEvent( QEvent * event );
+    void paintEvent(QPaintEvent * /*e*/);
+    void wheelEvent(QWheelEvent * e);
+    void mousePressEvent(QMouseEvent * event);
+    void mouseMoveEvent(QMouseEvent * event);
+    void mouseReleaseEvent(QMouseEvent * event);
+    void mouseDoubleClickEvent(QMouseEvent * event);
+    void leaveEvent( QEvent * event );
 
 private:
     Mlt::Geometry *m_geom;
index 686b7a1a4dd3c199e8331a6148949e1b2eea7eb5..3d660b551bf18a7841c1b70560fd845b720a28a6 100644 (file)
@@ -93,7 +93,7 @@ void KThumb::updateThumbUrl(const QString &hash)
     m_thumbFile = m_clipManager->projectFolder() + "/thumbs/" + hash + ".thumb";
 }
 
-void KThumb::updateClipUrl(KUrl url, const QString &hash)
+void KThumb::updateClipUrl(const KUrl &url, const QString &hash)
 {
     m_url = url;
     m_thumbFile = m_clipManager->projectFolder() + "/thumbs/" + hash + ".thumb";
index 961b69724457aa6297f562221264e66d191a821e..cecf58a5cba563cd1acf50eee91b97a9f0c5cc53 100644 (file)
@@ -71,7 +71,7 @@ public:
     void getGenericThumb(int frame, int height, int type);
 
 public slots:
-    void updateClipUrl(KUrl url, const QString &hash);
+    void updateClipUrl(const KUrl &url, const QString &hash);
     void slotCreateAudioThumbs();
 
 public:
@@ -109,8 +109,8 @@ private:
     QImage getProducerFrame(int framepos, int frameWidth, int displayWidth, int height);
 
 signals:
-    void thumbReady(int, QImage);
-    void mainThumbReady(const QString &, QPixmap);
+    void thumbReady(int, const QImage&);
+    void mainThumbReady(const QString &, const QPixmap&);
     void audioThumbReady(const audioByteArray&);
     /** @brief We have finished caching all requested thumbs. */
     void thumbsCached();
index c4c1515a52436ec7d78f0476e4f2113a97326435..40288fc23668c5c1ac1f6a04aa57c7b3571ce16d 100644 (file)
@@ -157,10 +157,10 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_projectMonitor(NULL),
     m_recMonitor(NULL),
     m_renderWidget(NULL),
-#ifdef USE_JOGSHUTTLE
+    #ifdef USE_JOGSHUTTLE
     m_jogProcess(NULL),
     m_jogShuttle(NULL),
-#endif
+    #endif
     m_findActivated(false),
     m_stopmotion(NULL),
     m_mainClip(NULL)
@@ -176,9 +176,9 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     if (separator != systemLocale.decimalPoint()) {
         kDebug()<<"------\n!!! system locale is not similar to Qt's locale... be prepared for bugs!!!\n------";
         // HACK: There is a locale conflict, so set locale to C
-       // Make sure to override exported values or it won't work
-       setenv("LANG", "C", 1);
-       setlocale(LC_NUMERIC, "C");
+        // Make sure to override exported values or it won't work
+        setenv("LANG", "C", 1);
+        setlocale(LC_NUMERIC, "C");
         systemLocale = QLocale::c();
     }
 
@@ -406,7 +406,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     for (int i = 1; i < 5; ++i) {
         KAction *load = new KAction(KIcon(), i18n("Layout %1", i), this);
         load->setData('_' + QString::number(i));
-       layoutActions->addAction("load_layout" + QString::number(i), load);
+        layoutActions->addAction("load_layout" + QString::number(i), load);
         m_loadLayout->addAction(load);
         KAction *save = new KAction(KIcon(), i18n("Save As Layout %1", i), this);
         save->setData('_' + QString::number(i));
@@ -436,7 +436,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_effectList->reloadEffectList(m_effectsMenu, m_effectActions);
     m_effectsActionCollection->readSettings();
 
-       // Populate View menu with show / hide actions for dock widgets
+    // Populate View menu with show / hide actions for dock widgets
     KActionCategory *guiActions = new KActionCategory(i18n("Interface"), actionCollection());
 
     setupGUI();
@@ -535,7 +535,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
 
     connect(m, SIGNAL(triggered(QAction*)), this, SLOT(slotAddVideoEffect(QAction*)));
     connect(m_effectsMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotAddVideoEffect(QAction*)));
-    connect(m_transitionsMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotAddTransition(QAction*)));    
+    connect(m_transitionsMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotAddTransition(QAction*)));
 
     m_timelineContextMenu = new QMenu(this);
     m_timelineContextClipMenu = new QMenu(this);
@@ -601,25 +601,25 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     QList <QDockWidget *> docks = findChildren<QDockWidget *>();
     for (int i = 0; i < docks.count(); ++i) {
         QDockWidget* dock = docks.at(i);
-       QAction * a = dock->toggleViewAction();
-       if (!a) continue;
-       KAction* dockInformations = new KAction(this);
-       dockInformations->setText(a->text());
-       dockInformations->setCheckable(true);
-       dockInformations->setChecked(!dock->isHidden());
-       // HACK: since QActions cannot be used in KActionCategory to allow shortcut, we create a duplicate KAction of the dock QAction and link them
-       connect(a,SIGNAL(toggled(bool)), dockInformations, SLOT(setChecked(bool)));
-       connect(dockInformations,SIGNAL(triggered(bool)), a, SLOT(trigger()));
-       pair.first = dockInformations->text();
-       pair.second = dockInformations;
-       viewActions.append(pair);
+        QAction * a = dock->toggleViewAction();
+        if (!a) continue;
+        KAction* dockInformations = new KAction(this);
+        dockInformations->setText(a->text());
+        dockInformations->setCheckable(true);
+        dockInformations->setChecked(!dock->isHidden());
+        // HACK: since QActions cannot be used in KActionCategory to allow shortcut, we create a duplicate KAction of the dock QAction and link them
+        connect(a,SIGNAL(toggled(bool)), dockInformations, SLOT(setChecked(bool)));
+        connect(dockInformations,SIGNAL(triggered(bool)), a, SLOT(trigger()));
+        pair.first = dockInformations->text();
+        pair.second = dockInformations;
+        viewActions.append(pair);
     }
     
     // Sort dock view action by name
     qSort(viewActions.begin(), viewActions.end(), sortByNames);
     // Populate view menu
     for (int i = 0; i < viewActions.count(); ++i)
-       viewMenu->addAction(guiActions->addAction(viewActions.at(i).first, viewActions.at(i).second));
+        viewMenu->addAction(guiActions->addAction(viewActions.at(i).first, viewActions.at(i).second));
     
     // Populate encoding profiles
     KConfig conf("encodingprofiles.rc", KConfig::CascadeConfig, "appdata");
@@ -840,7 +840,7 @@ void MainWindow::generateClip()
     ClipGenerator *iGenerator = qobject_cast<ClipGenerator *>(action->parent());
 
     KUrl clipUrl = iGenerator->generatedClip(KdenliveSettings::rendererpath(), action->data().toString(), m_activeDocument->projectFolder(),
-                   QStringList(), QStringList(), m_activeDocument->fps(), m_activeDocument->width(), m_activeDocument->height());
+                                             QStringList(), QStringList(), m_activeDocument->fps(), m_activeDocument->width(), m_activeDocument->height());
     if (!clipUrl.isEmpty()) {
         m_projectList->slotAddClip(QList <QUrl> () << clipUrl);
     }
@@ -908,7 +908,7 @@ void MainWindow::slotFullScreen()
     KToggleFullScreenAction::setFullScreen(this, actionCollection()->action("fullscreen")->isChecked());
 }
 
-void MainWindow::slotAddEffect(const QDomElement effect)
+void MainWindow::slotAddEffect(const QDomElement &effect)
 {
     if (!m_activeDocument) return;
     if (effect.isNull()) {
@@ -979,23 +979,23 @@ void MainWindow::slotAdjustProjectMonitor()
 
 class NameGrabbingKActionCollection {
 public:
-  NameGrabbingKActionCollection(KActionCollection* collection, QStringList& action_names)
-    : m_collection(collection), m_action_names(action_names) {
-      m_action_names.clear();
-    }
-  KAction* addAction(const QString& action_name) {
-    m_action_names << action_name;
-    return m_collection->addAction(action_name);
-  }
-  void addAction(const QString& action_name, QAction* action) {
-    m_action_names << action_name;
-    m_collection->addAction(action_name, action);
-  }
-  operator KActionCollection*() { return m_collection; }
-  const QStringList& actionNames() const { return m_action_names; }
+    NameGrabbingKActionCollection(KActionCollection* collection, QStringList& action_names)
+        : m_collection(collection), m_action_names(action_names) {
+        m_action_names.clear();
+    }
+    KAction* addAction(const QString& action_name) {
+        m_action_names << action_name;
+        return m_collection->addAction(action_name);
+    }
+    void addAction(const QString& action_name, QAction* action) {
+        m_action_names << action_name;
+        m_collection->addAction(action_name, action);
+    }
+    operator KActionCollection*() { return m_collection; }
+    const QStringList& actionNames() const { return m_action_names; }
 private:
-  KActionCollection* m_collection;
-  QStringList& m_action_names;
+    KActionCollection* m_collection;
+    QStringList& m_action_names;
 };
 
 void MainWindow::setupActions()
@@ -2036,7 +2036,7 @@ bool MainWindow::closeCurrentDocument(bool saveChanges)
     if (docToClose == m_activeDocument) {
         delete m_activeDocument;
         m_activeDocument = NULL;
-       m_monitorManager->setDocument(m_activeDocument);
+        m_monitorManager->setDocument(m_activeDocument);
         m_effectStack->clear();
         m_transitionConfig->slotTransitionItemSelected(NULL, 0, QPoint(), false);
     } else {
@@ -2136,22 +2136,21 @@ void MainWindow::openFile(const KUrl &url)
         kDebug()<<"Opening archive, processing";
         QPointer<ArchiveWidget> ar = new ArchiveWidget(url);
         if (ar->exec() == QDialog::Accepted) {
-           openFile(KUrl(ar->extractedProjectFile()));
-       }
-       else if (!m_startUrl.isEmpty()) {
-           // we tried to open an invalid file from command line, init new project
-           newFile(false);
-       }
+            openFile(KUrl(ar->extractedProjectFile()));
+        } else if (!m_startUrl.isEmpty()) {
+            // we tried to open an invalid file from command line, init new project
+            newFile(false);
+        }
         delete ar;
         return;
     }
     if (!url.fileName().endsWith(".kdenlive")) {
         // This is not a Kdenlive project file, abort loading
         KMessageBox::sorry(this, i18n("File %1 is not a Kdenlive project file", url.path()));
-       if (!m_startUrl.isEmpty()) {
-           // we tried to open an invalid file from command line, init new project
-           newFile(false);
-       }
+        if (!m_startUrl.isEmpty()) {
+            // we tried to open an invalid file from command line, init new project
+            newFile(false);
+        }
         return;
     }
 
@@ -2539,18 +2538,18 @@ void MainWindow::slotUpdateMousePosition(int pos)
     if (m_activeDocument)
         switch (m_timeFormatButton->currentItem()) {
         case 0:
-           m_timeFormatButton->setText(m_activeDocument->timecode().getTimecodeFromFrames(pos) + " / " + m_activeDocument->timecode().getTimecodeFromFrames(m_activeTimeline->duration()));
+            m_timeFormatButton->setText(m_activeDocument->timecode().getTimecodeFromFrames(pos) + " / " + m_activeDocument->timecode().getTimecodeFromFrames(m_activeTimeline->duration()));
             break;
         default:
-           m_timeFormatButton->setText(QString::number(pos) + " / " + QString::number(m_activeTimeline->duration()));
+            m_timeFormatButton->setText(QString::number(pos) + " / " + QString::number(m_activeTimeline->duration()));
         }
 }
 
 void MainWindow::slotUpdateProjectDuration(int pos)
 {
     if (m_activeDocument) {
-       m_activeTimeline->setDuration(pos);
-       slotUpdateMousePosition(m_activeTimeline->projectView()->getMousePos());
+        m_activeTimeline->setDuration(pos);
+        slotUpdateMousePosition(m_activeTimeline->projectView()->getMousePos());
     }
 }
 
@@ -2614,7 +2613,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_activeDocument, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
             disconnect(m_effectStack, SIGNAL(updateEffect(ClipItem*,int,QDomElement,QDomElement,int,bool)), m_activeTimeline->projectView(), SLOT(slotUpdateClipEffect(ClipItem*,int,QDomElement,QDomElement,int,bool)));
             disconnect(m_effectStack, SIGNAL(removeEffect(ClipItem*,int,QDomElement)), m_activeTimeline->projectView(), SLOT(slotDeleteEffect(ClipItem*,int,QDomElement)));
-           disconnect(m_effectStack, SIGNAL(addEffect(ClipItem*,QDomElement)), trackView->projectView(), SLOT(slotAddEffect(ClipItem*,QDomElement)));
+            disconnect(m_effectStack, SIGNAL(addEffect(ClipItem*,QDomElement)), trackView->projectView(), SLOT(slotAddEffect(ClipItem*,QDomElement)));
             disconnect(m_effectStack, SIGNAL(changeEffectState(ClipItem*,int,QList<int>,bool)), m_activeTimeline->projectView(), SLOT(slotChangeEffectState(ClipItem*,int,QList<int>,bool)));
             disconnect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*,int,QList<int>,int)), m_activeTimeline->projectView(), SLOT(slotChangeEffectPosition(ClipItem*,int,QList<int>,int)));
             disconnect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), m_activeTimeline->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
@@ -2622,13 +2621,13 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_effectStack, SIGNAL(displayMessage(QString,int)), this, SLOT(slotGotProgressInfo(QString,int)));
             disconnect(m_transitionConfig, SIGNAL(transitionUpdated(Transition*,QDomElement)), m_activeTimeline->projectView() , SLOT(slotTransitionUpdated(Transition*,QDomElement)));
             disconnect(m_transitionConfig, SIGNAL(seekTimeline(int)), m_activeTimeline->projectView() , SLOT(setCursorPos(int)));
-           disconnect(m_transitionConfig, SIGNAL(importClipKeyframes(GRAPHICSRECTITEM)), m_activeTimeline->projectView() , SLOT(slotImportClipKeyframes(GRAPHICSRECTITEM)));
+            disconnect(m_transitionConfig, SIGNAL(importClipKeyframes(GRAPHICSRECTITEM)), m_activeTimeline->projectView() , SLOT(slotImportClipKeyframes(GRAPHICSRECTITEM)));
 
             disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(slotActivateMonitor()));
             disconnect(m_activeTimeline, SIGNAL(zoneMoved(int,int)), this, SLOT(slotZoneMoved(int,int)));
             disconnect(m_projectList, SIGNAL(loadingIsOver()), m_activeTimeline->projectView(), SLOT(slotUpdateAllThumbs()));
             disconnect(m_projectList, SIGNAL(refreshClip(QString)), m_activeTimeline->projectView(), SLOT(slotRefreshThumbs(QString)));
-           disconnect(m_projectList, SIGNAL(addMarkers(QString,QList<CommentedTime>)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(QString,QList<CommentedTime>)));
+            disconnect(m_projectList, SIGNAL(addMarkers(QString,QList<CommentedTime>)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(QString,QList<CommentedTime>)));
             m_effectStack->clear();
         }
         //m_activeDocument->setRenderer(NULL);
@@ -2936,11 +2935,11 @@ void MainWindow::slotAddClipMarker()
     QString id = clip->getId();
     CommentedTime marker(pos, i18n("Marker"), KdenliveSettings::default_marker_type());
     QPointer<MarkerDialog> d = new MarkerDialog(clip, marker,
-                       m_activeDocument->timecode(), i18n("Add Marker"), this);
+                                                m_activeDocument->timecode(), i18n("Add Marker"), this);
     if (d->exec() == QDialog::Accepted) {
         m_activeTimeline->projectView()->slotAddClipMarker(id, QList <CommentedTime>() << d->newMarker());
-       QString hash = clip->getClipHash();
-       if (!hash.isEmpty()) m_activeDocument->cacheImage(hash + '#' + QString::number(d->newMarker().time().frames(m_activeDocument->fps())), d->markerImage());
+        QString hash = clip->getClipHash();
+        if (!hash.isEmpty()) m_activeDocument->cacheImage(hash + '#' + QString::number(d->newMarker().time().frames(m_activeDocument->fps())), d->markerImage());
     }
     delete d;
 }
@@ -3024,11 +3023,11 @@ void MainWindow::slotEditClipMarker()
     }
 
     QPointer<MarkerDialog> d = new MarkerDialog(clip, oldMarker,
-                      m_activeDocument->timecode(), i18n("Edit Marker"), this);
+                                                m_activeDocument->timecode(), i18n("Edit Marker"), this);
     if (d->exec() == QDialog::Accepted) {
         m_activeTimeline->projectView()->slotAddClipMarker(id, QList <CommentedTime>() <<d->newMarker());
-       QString hash = clip->getClipHash();
-       if (!hash.isEmpty()) m_activeDocument->cacheImage(hash + '#' + QString::number(d->newMarker().time().frames(m_activeDocument->fps())), d->markerImage());
+        QString hash = clip->getClipHash();
+        if (!hash.isEmpty()) m_activeDocument->cacheImage(hash + '#' + QString::number(d->newMarker().time().frames(m_activeDocument->fps())), d->markerImage());
         if (d->newMarker().time() != pos) {
             // remove old marker
             oldMarker.setMarkerType(-1);
@@ -3052,7 +3051,7 @@ void MainWindow::slotAddMarkerGuideQuickly()
             return;
         }
         //TODO: allow user to set default marker category
-       CommentedTime marker(pos, m_activeDocument->timecode().getDisplayTimecode(pos, false), KdenliveSettings::default_marker_type());
+        CommentedTime marker(pos, m_activeDocument->timecode().getDisplayTimecode(pos, false), KdenliveSettings::default_marker_type());
         m_activeTimeline->projectView()->slotAddClipMarker(clip->getId(), QList <CommentedTime>() <<marker);
     } else {
         m_activeTimeline->projectView()->slotAddGuide(false);
@@ -3243,11 +3242,11 @@ void MainWindow::slotAddVideoEffect(QAction *result)
     if (info.isEmpty() || info.size() < 3) return;
     QDomElement effect ;
     if (info.last() == QString::number((int) EFFECT_VIDEO))
-            effect = videoEffects.getEffectByTag(info.at(0), info.at(1));
+        effect = videoEffects.getEffectByTag(info.at(0), info.at(1));
     else if (info.last() == QString::number((int) EFFECT_AUDIO))
-            effect = audioEffects.getEffectByTag(info.at(0), info.at(1));
+        effect = audioEffects.getEffectByTag(info.at(0), info.at(1));
     else
-            effect = customEffects.getEffectByTag(info.at(0), info.at(1));
+        effect = customEffects.getEffectByTag(info.at(0), info.at(1));
     if (!effect.isNull()) slotAddEffect(effect);
     else m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2", info.at(0), info.at(1)), ErrorMessage);
 }
@@ -3387,15 +3386,18 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip)
                 newprops.insert("out", QString::number(dia_ui->duration() - 1));
                 int currentLength = QString(clip->producerProperty("length")).toInt();
                 if (currentLength <= dia_ui->duration())
-                        newprops.insert("length", QString::number(dia_ui->duration()));
-                else newprops.insert("length", clip->producerProperty("length"));
+                    newprops.insert("length", QString::number(dia_ui->duration()));
+                else
+                    newprops.insert("length", clip->producerProperty("length"));
             }
             if (!path.isEmpty()) {
                 // we are editing an external file, asked if we want to detach from that file or save the result to that title file.
                 if (KMessageBox::questionYesNo(this, i18n("You are editing an external title clip (%1). Do you want to save your changes to the title file or save the changes for this project only?", path), i18n("Save Title"), KGuiItem(i18n("Save to title file")), KGuiItem(i18n("Save in project only"))) == KMessageBox::Yes) {
                     // save to external file
                     dia_ui->saveTitle(path);
-                } else newprops.insert("resource", QString());
+                } else {
+                    newprops.insert("resource", QString());
+                }
             }
             EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->currentProperties(newprops), newprops, true);
             m_activeDocument->commandStack()->push(command);
@@ -3412,20 +3414,20 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip)
     QList <ClipProperties *> list = findChildren<ClipProperties *>();
     for (int i = 0; i < list.size(); ++i) {
         if (list.at(i)->clipId() == clip->getId()) {
-           // We have one dialog, show it
-           list.at(i)->raise();
-           return;
-       }
+            // We have one dialog, show it
+            list.at(i)->raise();
+            return;
+        }
     }
 
     // any type of clip but a title
     ClipProperties *dia = new ClipProperties(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
 
     if (clip->clipType() == AV || clip->clipType() == VIDEO || clip->clipType() == PLAYLIST || clip->clipType() == SLIDESHOW) {
-       // request clip thumbnails
-       connect(m_activeDocument->clipManager(), SIGNAL(gotClipPropertyThumbnail(QString,QImage)), dia, SLOT(slotGotThumbnail(QString,QImage)));
-       connect(dia, SIGNAL(requestThumb(QString,QList<int>)), m_activeDocument->clipManager(), SLOT(slotRequestThumbs(QString,QList<int>)));
-       m_activeDocument->clipManager()->slotRequestThumbs(QString('?' + clip->getId()), QList<int>() << clip->getClipThumbFrame());
+        // request clip thumbnails
+        connect(m_activeDocument->clipManager(), SIGNAL(gotClipPropertyThumbnail(QString,QImage)), dia, SLOT(slotGotThumbnail(QString,QImage)));
+        connect(dia, SIGNAL(requestThumb(QString,QList<int>)), m_activeDocument->clipManager(), SLOT(slotRequestThumbs(QString,QList<int>)));
+        m_activeDocument->clipManager()->slotRequestThumbs(QString('?' + clip->getId()), QList<int>() << clip->getClipThumbFrame());
     }
     
     connect(dia, SIGNAL(addMarkers(QString,QList<CommentedTime>)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(QString,QList<CommentedTime>)));
@@ -3455,10 +3457,10 @@ void MainWindow::slotApplyNewClipProperties(const QString id, QMap <QString, QSt
 }
 
 
-void MainWindow::slotShowClipProperties(QList <DocClipBase *> cliplist, QMap<QString, QString> commonproperties)
+void MainWindow::slotShowClipProperties(const QList <DocClipBase *> &cliplist, const QMap<QString, QString> &commonproperties)
 {
     QPointer<ClipProperties> dia = new ClipProperties(cliplist,
-                         m_activeDocument->timecode(), commonproperties, this);
+                                                      m_activeDocument->timecode(), commonproperties, this);
     if (dia->exec() == QDialog::Accepted) {
         QUndoCommand *command = new QUndoCommand();
         command->setText(i18n("Edit clips"));
@@ -3490,9 +3492,9 @@ void MainWindow::customEvent(QEvent* e)
 void MainWindow::slotTimelineClipSelected(ClipItem* item, bool raise)
 {
     if (item != m_mainClip) {
-       if (m_mainClip) m_mainClip->setMainSelectedClip(false);
-       if (item) item->setMainSelectedClip(true);
-       m_mainClip = item;
+        if (m_mainClip) m_mainClip->setMainSelectedClip(false);
+        if (item) item->setMainSelectedClip(true);
+        m_mainClip = item;
     }
     m_effectStack->slotClipItemSelected(item);
     m_projectMonitor->slotSetSelectedClip(item);
@@ -3705,9 +3707,9 @@ void MainWindow::slotClipInTimeline(const QString &clipId)
 void MainWindow::slotClipInProjectTree()
 {
     if (m_activeTimeline) {
-       QStringList clipIds;
-       if (m_mainClip) clipIds << m_mainClip->clipProducer();
-       else clipIds = m_activeTimeline->projectView()->selectedClips();
+        QStringList clipIds;
+        if (m_mainClip) clipIds << m_mainClip->clipProducer();
+        else clipIds = m_activeTimeline->projectView()->selectedClips();
         if (clipIds.isEmpty())
             return;
         m_projectListDock->raise();
@@ -3796,7 +3798,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event)
 }
 
 
-void MainWindow::slotSaveZone(Render *render, QPoint zone, DocClipBase *baseClip, KUrl path)
+void MainWindow::slotSaveZone(Render *render, const QPoint &zone, DocClipBase *baseClip, KUrl path)
 {
     KDialog *dialog = new KDialog(this);
     dialog->setCaption("Save clip zone");
@@ -4011,52 +4013,52 @@ void MainWindow::slotMaximizeCurrent(bool)
 
 void MainWindow::loadClipActions()
 {
-       QMenu* actionMenu= static_cast<QMenu*>(factory()->container("clip_actions", this));
-       if (actionMenu){
-               actionMenu->clear();
-               Mlt::Profile profile;
-               Mlt::Filter *filter = Mlt::Factory::filter(profile,(char*)"videostab");
-               if (filter) {
-                       if (!filter->is_valid()) {
-                           delete filter;
-                       }
-                       else {
-                           delete filter;
-                           QAction *action=actionMenu->addAction(i18n("Stabilize (vstab)"));
-                           action->setData("videostab");
-                           connect(action,SIGNAL(triggered()), this, SLOT(slotStartClipAction()));
-                       }
-               }
-               filter = Mlt::Factory::filter(profile,(char*)"videostab2");
-               if (filter) {
-                       if (!filter->is_valid()) {
-                           delete filter;
-                       }
-                       else {
-                           delete filter;
-                           QAction *action=actionMenu->addAction(i18n("Stabilize (transcode)"));
-                           action->setData("videostab2");
-                           connect(action,SIGNAL(triggered()), this, SLOT(slotStartClipAction()));
-                       }
-               }
-               filter = Mlt::Factory::filter(profile,(char*)"motion_est");
-               if (filter) {
-                       if (!filter->is_valid()) {
-                           delete filter;
-                       }
-                       else {
-                           delete filter;
-                           QAction *action=actionMenu->addAction(i18n("Automatic scene split"));
-                           action->setData("motion_est");
-                           connect(action,SIGNAL(triggered()), this, SLOT(slotStartClipAction()));
-                       }
-               }
-               if (KdenliveSettings::producerslist().contains("framebuffer")) {
-                       QAction *action=actionMenu->addAction(i18n("Reverse clip"));
-                       action->setData("framebuffer");
-                       connect(action,SIGNAL(triggered()), this, SLOT(slotStartClipAction()));
-               }
-       }
+    QMenu* actionMenu= static_cast<QMenu*>(factory()->container("clip_actions", this));
+    if (actionMenu){
+        actionMenu->clear();
+        Mlt::Profile profile;
+        Mlt::Filter *filter = Mlt::Factory::filter(profile,(char*)"videostab");
+        if (filter) {
+            if (!filter->is_valid()) {
+                delete filter;
+            }
+            else {
+                delete filter;
+                QAction *action=actionMenu->addAction(i18n("Stabilize (vstab)"));
+                action->setData("videostab");
+                connect(action,SIGNAL(triggered()), this, SLOT(slotStartClipAction()));
+            }
+        }
+        filter = Mlt::Factory::filter(profile,(char*)"videostab2");
+        if (filter) {
+            if (!filter->is_valid()) {
+                delete filter;
+            }
+            else {
+                delete filter;
+                QAction *action=actionMenu->addAction(i18n("Stabilize (transcode)"));
+                action->setData("videostab2");
+                connect(action,SIGNAL(triggered()), this, SLOT(slotStartClipAction()));
+            }
+        }
+        filter = Mlt::Factory::filter(profile,(char*)"motion_est");
+        if (filter) {
+            if (!filter->is_valid()) {
+                delete filter;
+            }
+            else {
+                delete filter;
+                QAction *action=actionMenu->addAction(i18n("Automatic scene split"));
+                action->setData("motion_est");
+                connect(action,SIGNAL(triggered()), this, SLOT(slotStartClipAction()));
+            }
+        }
+        if (KdenliveSettings::producerslist().contains("framebuffer")) {
+            QAction *action=actionMenu->addAction(i18n("Reverse clip"));
+            action->setData("framebuffer");
+            connect(action,SIGNAL(triggered()), this, SLOT(slotStartClipAction()));
+        }
+    }
 
 }
 
@@ -4151,11 +4153,11 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
     QString scriptPath;
     QString playlistPath;
     if (scriptExport) {
-        QString scriptsFolder = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "scripts/";
+        //QString scriptsFolder = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "scripts/";
         QString path = m_renderWidget->getFreeScriptName(m_activeDocument->url());
-       QPointer<KUrlRequesterDialog> getUrl = new KUrlRequesterDialog(path, i18n("Create Render Script"), this);
-       getUrl->fileDialog()->setMode(KFile::File);
-       getUrl->fileDialog()->setOperationMode(KFileDialog::Saving);
+        QPointer<KUrlRequesterDialog> getUrl = new KUrlRequesterDialog(path, i18n("Create Render Script"), this);
+        getUrl->fileDialog()->setMode(KFile::File);
+        getUrl->fileDialog()->setOperationMode(KFileDialog::Saving);
         if (getUrl->exec() == QDialog::Rejected) {
             delete getUrl;
             return;
@@ -4377,7 +4379,7 @@ void MainWindow::slotChangePalette(QAction *action, const QString &themename)
         // Since there was a bug in createApplicationPalette in KDE < 4.6.3 we need
         // to do the palette loading stuff ourselves. (https://bugs.kde.org/show_bug.cgi?id=263497)
         QPalette::ColorGroup states[3] = { QPalette::Active, QPalette::Inactive,
-                                            QPalette::Disabled };
+                                           QPalette::Disabled };
         // TT thinks tooltips shouldn't use active, so we use our active colors for all states
         KColorScheme schemeTooltip(QPalette::Active, KColorScheme::Tooltip, config);
 
@@ -4490,7 +4492,7 @@ void MainWindow::slotInsertZoneToTimeline()
 }
 
 
-void MainWindow::slotDeleteProjectClips(QStringList ids, QMap<QString, QString> folderids)
+void MainWindow::slotDeleteProjectClips(const QStringList &ids, const QMap<QString, QString> &folderids)
 {
     if (m_activeDocument && m_activeTimeline) {
         if (!ids.isEmpty()) {
@@ -4565,10 +4567,10 @@ void MainWindow::slotOpenStopmotion()
         m_stopmotion = new StopmotionWidget(m_monitorManager, m_activeDocument->projectFolder(), m_stopmotion_actions->actions(), this);
         connect(m_stopmotion, SIGNAL(addOrUpdateSequence(QString)), m_projectList, SLOT(slotAddOrUpdateSequence(QString)));
         //for (int i = 0; i < m_gfxScopesList.count(); ++i) {
-            // Check if we need the renderer to send a new frame for update
-            /*if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;*/
-            //connect(m_stopmotion, SIGNAL(gotFrame(QImage)), static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget()), SLOT(slotRenderZoneUpdated(QImage)));
-            //static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->slotMonitorCapture();
+        // Check if we need the renderer to send a new frame for update
+        /*if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;*/
+        //connect(m_stopmotion, SIGNAL(gotFrame(QImage)), static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget()), SLOT(slotRenderZoneUpdated(QImage)));
+        //static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->slotMonitorCapture();
         //}
     }
     m_stopmotion->show();
@@ -4672,28 +4674,28 @@ void MainWindow::slotChangePalette()
 void MainWindow::slotSaveTimelineClip()
 {
     if (m_activeTimeline && m_projectMonitor->render) {
-       ClipItem *clip = m_activeTimeline->projectView()->getActiveClipUnderCursor(true);
-       if (!clip) {
-           m_messageLabel->setMessage(i18n("Select a clip to save"), InformationMessage);
-           return;
-       }
-       KUrl url = KFileDialog::getSaveUrl(m_activeDocument->projectFolder(), "video/mlt-playlist");
-       if (!url.isEmpty()) m_projectMonitor->render->saveClip(m_activeDocument->tracksCount() - clip->track(), clip->startPos(), url);
+        ClipItem *clip = m_activeTimeline->projectView()->getActiveClipUnderCursor(true);
+        if (!clip) {
+            m_messageLabel->setMessage(i18n("Select a clip to save"), InformationMessage);
+            return;
+        }
+        KUrl url = KFileDialog::getSaveUrl(m_activeDocument->projectFolder(), "video/mlt-playlist");
+        if (!url.isEmpty()) m_projectMonitor->render->saveClip(m_activeDocument->tracksCount() - clip->track(), clip->startPos(), url);
     }
 }
 
 void MainWindow::slotProcessImportKeyframes(GRAPHICSRECTITEM type, const QString& data, int maximum)
 {
     if (type == AVWIDGET) {
-       // This data should be sent to the effect stack
-       m_effectStack->setKeyframes(data, maximum);
+        // This data should be sent to the effect stack
+        m_effectStack->setKeyframes(data, maximum);
     }
     else if (type == TRANSITIONWIDGET) {
-       // This data should be sent to the transition stack
-       m_transitionConfig->setKeyframes(data, maximum);
+        // This data should be sent to the transition stack
+        m_transitionConfig->setKeyframes(data, maximum);
     }
     else {
-       // Error
+        // Error
     }
 }
 
@@ -4707,18 +4709,18 @@ void MainWindow::slotSetDeinterlacer(int ix)
 {
     QString value;
     switch (ix) {
-      
-      case 1:
-       value = "linearblend";
-       break;
-      case 2:
-       value = "yadif-nospatial";
-       break;
-      case 3:
-       value = "yadif";
-       break;
-      default:
-       value = "onefield";
+
+    case 1:
+        value = "linearblend";
+        break;
+    case 2:
+        value = "yadif-nospatial";
+        break;
+    case 3:
+        value = "yadif";
+        break;
+    default:
+        value = "onefield";
     }
     KdenliveSettings::setMltdeinterlacer(value);
     m_monitorManager->setConsumerProperty("deinterlace_method", value);
@@ -4728,17 +4730,17 @@ void MainWindow::slotSetInterpolation(int ix)
 {
     QString value;
     switch (ix) {
-      case 1:
-       value = "bilinear";
-       break;
-      case 2:
-       value = "bicubic";
-       break;
-      case 3:
-       value = "hyper";
-       break;
-      default:
-       value = "nearest";
+    case 1:
+        value = "bilinear";
+        break;
+    case 2:
+        value = "bicubic";
+        break;
+    case 3:
+        value = "hyper";
+        break;
+    default:
+        value = "nearest";
     }
     KdenliveSettings::setMltinterpolation(value);
     m_monitorManager->setConsumerProperty("rescale", value);
index 6b0f711aa7759dffaf4a6e3dd1137e99a9de5ba8..185f5478cca32d7371c681b17a258012d04b36fe 100644 (file)
@@ -364,7 +364,7 @@ private slots:
     void slotUpdateClip(const QString &id);
     void slotUpdateMousePosition(int pos);
     void slotUpdateProjectDuration(int pos);
-    void slotAddEffect(const QDomElement effect);
+    void slotAddEffect(const QDomElement &effect);
     void slotEditProfiles();
     void slotDetectAudioDriver();
     void slotEditProjectSettings();
@@ -428,7 +428,7 @@ private slots:
     void slotAddProjectClip(KUrl url, stringMap data = stringMap());
     void slotAddProjectClipList(KUrl::List urls);
     void slotShowClipProperties(DocClipBase *clip);
-    void slotShowClipProperties(QList <DocClipBase *>cliplist, QMap<QString, QString> commonproperties);
+    void slotShowClipProperties(const QList<DocClipBase *> &cliplist, const QMap<QString, QString> &commonproperties);
     void slotTimelineClipSelected(ClipItem* item, bool raise = true);
     void slotTrackSelected(int index, TrackInfo info, bool raise = true);
     void slotActivateTransitionView(Transition *);
@@ -461,7 +461,7 @@ private slots:
 
     void slotAdjustClipMonitor();
     void slotAdjustProjectMonitor();
-    void slotSaveZone(Render *render, QPoint zone, DocClipBase *baseClip = NULL, KUrl path = KUrl());
+    void slotSaveZone(Render *render, const QPoint &zone, DocClipBase *baseClip = NULL, KUrl path = KUrl());
 
     void slotSetInPoint();
     void slotSetOutPoint();
@@ -527,7 +527,7 @@ private slots:
     /** @brief Deletes items from timeline and document.
     * @param ids The ids of the clips to delete.
     * @param folderids The names and ids of the folders to delete. */
-    void slotDeleteProjectClips(QStringList ids, QMap<QString, QString> folderids);
+    void slotDeleteProjectClips(const QStringList &ids, const QMap<QString, QString> &folderids);
     void slotShowTitleBars(bool show);
     void slotSwitchTitles();
     /** @brief Update the capture folder if user asked a change. */
index 5467460c2ef514832e72ca1d54fb48dd7ef9d993..d5d8dfeba233cab6e162a926fb0398a8ee5e1b1e 100644 (file)
@@ -65,7 +65,9 @@ ManageCapturesDialog::ManageCapturesDialog(const KUrl::List &files, QWidget * pa
     adjustSize();
 }
 
-ManageCapturesDialog::~ManageCapturesDialog() {}
+ManageCapturesDialog::~ManageCapturesDialog()
+{
+}
 
 void ManageCapturesDialog::slotCheckItemIcon()
 {
index 032de2ceda90534d49f57c1c58c86f6fc3f35bfe..535728e24d4d186f7ef99937e327c850543b13d0 100644 (file)
@@ -39,7 +39,7 @@ class Frame;
 class Event;
 class Producer;
 class Profile;
-};
+}
 
 class MltDeviceCapture: public AbstractRender
 {
index 68f7b2495eb9957af5fe8393a494121cd40ddf67..f9fac8d20595811dfec3e7033ba5b3c6c460a2d6 100644 (file)
@@ -228,7 +228,7 @@ QWidget *Monitor::container()
 }
 
 #ifdef USE_OPENGL
-bool Monitor::createOpenGlWidget(QWidget *parent, const QString profile)
+bool Monitor::createOpenGlWidget(QWidget *parent, const QString &profile)
 {
     render = new Render(id(), 0, profile, this);
     m_glWidget = new VideoGLWidget(parent);
@@ -610,13 +610,13 @@ void Monitor::slotExtractCurrentFrame()
     fs->setMode(KFile::File);
     fs->setConfirmOverwrite(true);
     fs->setKeepLocation(true);
-    fs->exec();
-    QString path;
-    if (fs) path = fs->selectedFile();
-    delete fs;
-    if (!path.isEmpty()) {
-        frame.save(path);
+    if (fs->exec()) {
+        QString path = fs->selectedFile();
+        if (!path.isEmpty()) {
+            frame.save(path);
+        }
     }
+    delete fs;
 }
 
 void Monitor::setTimePos(const QString &pos)
@@ -958,7 +958,7 @@ void Monitor::resetProfile(const QString &profile)
         m_effectWidget->resetProfile(render);
 }
 
-void Monitor::saveSceneList(QString path, QDomElement info)
+void Monitor::saveSceneList(const QString &path, const QDomElement &info)
 {
     if (render == NULL) return;
     render->saveSceneList(path, info);
@@ -970,7 +970,7 @@ const QString Monitor::sceneList()
     return render->sceneList();
 }
 
-void Monitor::setClipZone(QPoint pos)
+void Monitor::setClipZone(const QPoint &pos)
 {
     if (m_currentClip == NULL) return;
     m_currentClip->setZone(pos);
index 5dc6f2a4eeb0bf49f65661b58adf3a83888b1509..c041bccb8b3047551080dac6ae46ae578e52736e 100644 (file)
@@ -101,18 +101,18 @@ public:
     QString getMarkerThumb(GenTime pos);
 
 protected:
-    virtual void mousePressEvent(QMouseEvent * event);
-    virtual void mouseReleaseEvent(QMouseEvent * event);
-    virtual void mouseDoubleClickEvent(QMouseEvent * event);
-    virtual void resizeEvent(QResizeEvent *event);
+    void mousePressEvent(QMouseEvent * event);
+    void mouseReleaseEvent(QMouseEvent * event);
+    void mouseDoubleClickEvent(QMouseEvent * event);
+    void resizeEvent(QResizeEvent *event);
 
     /** @brief Move to another position on mouse wheel event.
      *
      * Moves towards the end of the clip/timeline on mouse wheel down/back, the
      * opposite on mouse wheel up/forward.
      * Ctrl + wheel moves by a second, without Ctrl it moves by a single frame. */
-    virtual void wheelEvent(QWheelEvent * event);
-    virtual void mouseMoveEvent(QMouseEvent *event);
+    void wheelEvent(QWheelEvent * event);
+    void mouseMoveEvent(QMouseEvent *event);
     virtual QStringList mimeTypes() const;
    
     /*virtual void dragMoveEvent(QDragMoveEvent * event);
@@ -148,7 +148,7 @@ private:
 
 #ifdef USE_OPENGL
     VideoGLWidget *m_glWidget;
-    bool createOpenGlWidget(QWidget *parent, const QString profile);
+    bool createOpenGlWidget(QWidget *parent, const QString &profile);
 #endif
 
     GenTime getSnapForPos(bool previous);
@@ -167,7 +167,7 @@ private slots:
     void slotSetSizeOneToTwo();
     void slotSaveZone();
     void slotSeek();
-    void setClipZone(QPoint pos);
+    void setClipZone(const QPoint &pos);
     void slotSwitchMonitorInfo(bool show);
     void slotSwitchDropFrames(bool show);
     void slotGoToMarker(QAction *action);
@@ -194,7 +194,7 @@ public slots:
     void slotRewind(double speed = 0);
     void slotRewindOneFrame(int diff = 1);
     void slotForwardOneFrame(int diff = 1);
-    void saveSceneList(QString path, QDomElement info = QDomElement());
+    void saveSceneList(const QString &path, const QDomElement &info = QDomElement());
     void slotStart();
     void slotEnd();
     void slotSetZoneStart();
@@ -223,13 +223,13 @@ signals:
     void durationChanged(int);
     void refreshClipThumbnail(const QString &, bool);
     void adjustMonitorSize();
-    void zoneUpdated(QPoint);
-    void saveZone(Render *, QPoint, DocClipBase *);
+    void zoneUpdated(const QPoint&);
+    void saveZone(Render *, const QPoint&, DocClipBase *);
     /** @brief  Editing transitions / effects over the monitor requires the renderer to send frames as QImage.
      *      This causes a major slowdown, so we only enable it if required */
     void requestFrameForAnalysis(bool);
     /** @brief Request a zone extraction (ffmpeg transcoding). */
-    void extractZone(const QString &id, QPoint zone);
+    void extractZone(const QString &id, const QPoint &zone);
 };
 
 #endif
index 9cba158e34d441adca7d4f63ade922c0cb426c6a..35ad43d85aa1c8456dab93df94e410649fb6ea33 100644 (file)
@@ -205,7 +205,7 @@ void MonitorManager::slotEnd()
     else if (m_activeMonitor == m_projectMonitor) m_projectMonitor->slotEnd();
 }
 
-void MonitorManager::resetProfiles(Timecode tc)
+void MonitorManager::resetProfiles(const Timecode &tc)
 {
     m_timecode = tc;
     slotResetProfiles();
index 70eb597f1fe1641eb88e74880a7e64e5b7f71bbe..b9f7de2c2da501f6953049eac5bfa142078c2121 100644 (file)
@@ -37,7 +37,7 @@ public:
     void appendMonitor(AbstractMonitor *monitor);
     void removeMonitor(AbstractMonitor *monitor);
     Timecode timecode() const;
-    void resetProfiles(Timecode tc);
+    void resetProfiles(const Timecode &tc);
     void stopActiveMonitor();
     AbstractRender *activeRenderer();
     /** Searches for a monitor with the given name.
index f298bd79ca3084500332de9b93ae3bfe371ef496..c7ebc8c0b7ba18cccc281db07a241750edf853dc 100644 (file)
@@ -150,9 +150,9 @@ void ParameterPlotter::createParametersNew()
     QString paramlist;
     QTextStream txtstr(&paramlist);
     QDomNode pa = namenode.item(0);
-    if (namenode.count() > 0) {
+    if (!namenode.isEmpty()) {
         for (int i = 0; i < plotobjs.count(); ++i) {
-            QList<KPlotPoint*> points = plotobjs[i]->points();
+            QList<KPlotPoint*> points = plotobjs.at(i)->points();
             foreach(const KPlotPoint *o, points) {
                 txtstr << (int)o->y() ;
                 break;//first no keyframes
index 0c395164f59327f5dfe46c1d18ad60521b96a6b4..4979901e8a687cb62a3946230c04de7c510453df 100644 (file)
@@ -1707,7 +1707,7 @@ QString ProjectList::getExtensions()
     return allExtensions.simplified();
 }
 
-void ProjectList::slotAddClip(const QString url, const QString &groupName, const QString &groupId)
+void ProjectList::slotAddClip(const QString &url, const QString &groupName, const QString &groupId)
 {
     kDebug()<<"// Adding clip: "<<url;
     QList <QUrl> list;
@@ -1715,7 +1715,7 @@ void ProjectList::slotAddClip(const QString url, const QString &groupName, const
     slotAddClip(list, groupName, groupId);
 }
 
-void ProjectList::slotAddClip(const QList <QUrl> givenList, const QString &groupName, const QString &groupId)
+void ProjectList::slotAddClip(const QList <QUrl> &givenList, const QString &groupName, const QString &groupId)
 {
     if (!m_commandStack)
         kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
@@ -1735,45 +1735,46 @@ void ProjectList::slotAddClip(const QList <QUrl> givenList, const QString &group
         l->addWidget(c);
         l->addStretch(5);
         f->setLayout(l);
+
         QPointer<KFileDialog> d = new KFileDialog(KUrl("kfiledialog:///clipfolder"), dialogFilter, kapp->activeWindow(), f);
         d->setOperationMode(KFileDialog::Opening);
         d->setMode(KFile::Files);
         if (d->exec() == QDialog::Accepted) {
             KdenliveSettings::setAutoimagetransparency(c->isChecked());
-        }
-        list = d->selectedUrls();
-        if (b->isChecked() && list.count() == 1) {
-            // Check for image sequence
-            KUrl url = list.at(0);
-            QString fileName = url.fileName().section('.', 0, -2);
-            if (fileName.at(fileName.size() - 1).isDigit()) {
-                KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url);
-                if (item.mimetype().startsWith("image")) {
-                    // import as sequence if we found more than one image in the sequence
-                    QStringList list;
-                    QString pattern = SlideshowClip::selectedPath(url.path(), false, QString(), &list);
-                    int count = list.count();
-                    if (count > 1) {
-                        delete d;
-                        QStringList groupInfo = getGroup();
-
-                        // get image sequence base name
-                        while (fileName.at(fileName.size() - 1).isDigit()) {
-                            fileName.chop(1);
+            list = d->selectedUrls();
+            if (b->isChecked() && list.count() == 1) {
+                // Check for image sequence
+                KUrl url = list.at(0);
+                QString fileName = url.fileName().section('.', 0, -2);
+                if (fileName.at(fileName.size() - 1).isDigit()) {
+                    KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url);
+                    if (item.mimetype().startsWith("image")) {
+                        // import as sequence if we found more than one image in the sequence
+                        QStringList list;
+                        QString pattern = SlideshowClip::selectedPath(url.path(), false, QString(), &list);
+                        int count = list.count();
+                        if (count > 1) {
+                            delete d;
+                            QStringList groupInfo = getGroup();
+
+                            // get image sequence base name
+                            while (fileName.at(fileName.size() - 1).isDigit()) {
+                                fileName.chop(1);
+                            }
+                            QMap <QString, QString> properties;
+                            properties.insert("name", fileName);
+                            properties.insert("resource", pattern);
+                            properties.insert("in", "0");
+                            QString duration = m_timecode.reformatSeparators(KdenliveSettings::sequence_duration());
+                            properties.insert("out", QString::number(m_doc->getFramePos(duration) * count));
+                            properties.insert("ttl", QString::number(m_doc->getFramePos(duration)));
+                            properties.insert("loop", QString::number(false));
+                            properties.insert("crop", QString::number(false));
+                            properties.insert("fade", QString::number(false));
+                            properties.insert("luma_duration", QString::number(m_doc->getFramePos(m_timecode.getTimecodeFromFrames(int(ceil(m_timecode.fps()))))));
+                            m_doc->slotCreateSlideshowClipFile(properties, groupInfo.at(0), groupInfo.at(1));
+                            return;
                         }
-                        QMap <QString, QString> properties;
-                        properties.insert("name", fileName);
-                        properties.insert("resource", pattern);
-                        properties.insert("in", "0");
-                        QString duration = m_timecode.reformatSeparators(KdenliveSettings::sequence_duration());
-                        properties.insert("out", QString::number(m_doc->getFramePos(duration) * count));
-                        properties.insert("ttl", QString::number(m_doc->getFramePos(duration)));
-                        properties.insert("loop", QString::number(false));
-                        properties.insert("crop", QString::number(false));
-                        properties.insert("fade", QString::number(false));
-                        properties.insert("luma_duration", QString::number(m_doc->getFramePos(m_timecode.getTimecodeFromFrames(int(ceil(m_timecode.fps()))))));
-                        m_doc->slotCreateSlideshowClipFile(properties, groupInfo.at(0), groupInfo.at(1));
-                        return;
                     }
                 }
             }
index 3470239dd7010889e14bb30121ee0d25e50cebd8..fa5175c41053f4896d7a6b1d551c4e4eb53e2a12 100644 (file)
@@ -313,8 +313,8 @@ public slots:
 
     /** @brief Prepares removing the selected items. */
     void slotRemoveClip();
-    void slotAddClip(const QString url, const QString &groupName, const QString &groupId);
-    void slotAddClip(const QList <QUrl> givenList = QList <QUrl> (), const QString &groupName = QString(), const QString &groupId = QString());
+    void slotAddClip(const QString &url, const QString &groupName, const QString &groupId);
+    void slotAddClip(const QList <QUrl> &givenList = QList <QUrl> (), const QString &groupName = QString(), const QString &groupId = QString());
 
     /** @brief Adds, edits or deletes a folder item.
     *
index 8aaa60e2f8828952976e705284d4f277d41c5bed..e104426e1f03db10563f0796d4bf1596e8290fed 100644 (file)
@@ -970,7 +970,7 @@ void RecMonitor::manageCapturedFiles()
     kDebug() << "Found : " << capturedFiles.count() << " new capture files";
     kDebug() << capturedFiles;
 
-    if (capturedFiles.count() > 0) {
+    if (!capturedFiles.isEmpty()) {
         QPointer<ManageCapturesDialog> d = new ManageCapturesDialog(capturedFiles, this);
         if (d->exec() == QDialog::Accepted) {
             emit addProjectClipList(d->importFiles());
index be5edc3da6cb4112f9314be239e3a68b26d8b4ca..301e2c34eccffd0bf434b942dc8e200559292118 100644 (file)
@@ -1475,7 +1475,7 @@ void Render::saveZone(KUrl url, QString desc, QPoint zone)
 }
 
 
-bool Render::saveClip(int track, GenTime position, KUrl url, QString desc)
+bool Render::saveClip(int track, const GenTime &position, const KUrl &url, const QString &desc)
 {
     // find clip
     Mlt::Service service(m_mltProducer->parent().get_service());
@@ -1856,7 +1856,7 @@ void Render::exportFileToFirewire(QString /*srcFileName*/, int /*port*/, GenTime
     KMessageBox::sorry(0, i18n("Firewire is not enabled on your system.\n Please install Libiec61883 and recompile Kdenlive"));
 }
 
-void Render::exportCurrentFrame(KUrl url, bool /*notify*/)
+void Render::exportCurrentFrame(const KUrl &url, bool /*notify*/)
 {
     if (!m_mltProducer) {
         KMessageBox::sorry(qApp->activeWindow(), i18n("There is no clip, cannot extract frame."));
@@ -2109,7 +2109,7 @@ int Render::mltInsertClip(ItemInfo info, QDomElement element, Mlt::Producer *pro
 }
 
 
-bool Render::mltCutClip(int track, GenTime position)
+bool Render::mltCutClip(int track, const GenTime &position)
 {
     Mlt::Service service(m_mltProducer->parent().get_service());
     if (service.type() != tractor_type) {
index e44e59a3ace2f7a4f4269aa0bf3410441730f79b..1f0edec1120df4e16b35ebd6272269947da7fb21 100644 (file)
@@ -65,7 +65,7 @@ class Filter;
 class Profile;
 class Service;
 class Event;
-};
+}
 
 struct requestClipInfo {
     QDomElement xml;
@@ -73,10 +73,10 @@ struct requestClipInfo {
     int imageHeight;
     bool replaceProducer;
 
-bool operator==(const requestClipInfo &a)
-{
-    return clipId == a.clipId;
-}
+    bool operator==(const requestClipInfo &a)
+    {
+        return clipId == a.clipId;
+    }
 };
 
 class MltErrorEvent : public QEvent
@@ -94,7 +94,7 @@ private:
 
 class Render: public AbstractRender
 {
-Q_OBJECT public:
+    Q_OBJECT public:
 
     enum FailStates { OK = 0,
                       APP_NOEXIST
@@ -159,7 +159,7 @@ Q_OBJECT public:
     void saveZone(KUrl url, QString desc, QPoint zone);
     
     /** @brief Save a clip in timeline to an xml playlist. */
-    bool saveClip(int track, GenTime position, KUrl url, QString desc = QString());
+    bool saveClip(int track, const GenTime &position, const KUrl &url, const QString &desc = QString());
 
     /** @brief Return true if we are currently playing */
     bool isPlaying() const;
@@ -181,7 +181,7 @@ Q_OBJECT public:
     double consumerRatio() const;
 
     /** @brief Saves current producer frame as an image. */
-    void exportCurrentFrame(KUrl url, bool notify);
+    void exportCurrentFrame(const KUrl &url, bool notify);
 
     /** @brief Change the Mlt PROFILE
      * @param profileName The MLT profile name
@@ -215,7 +215,7 @@ Q_OBJECT public:
     Mlt::Producer *checkSlowMotionProducer(Mlt::Producer *prod, QDomElement element);
     int mltInsertClip(ItemInfo info, QDomElement element, Mlt::Producer *prod, bool overwrite = false, bool push = false);
     bool mltUpdateClip(Mlt::Tractor *tractor, ItemInfo info, QDomElement element, Mlt::Producer *prod);
-    bool mltCutClip(int track, GenTime position);
+    bool mltCutClip(int track, const GenTime &position);
     void mltInsertSpace(QMap <int, int> trackClipStartList, QMap <int, int> trackTransitionStartList, int track, const GenTime &duration, const GenTime &timeOffset);
     int mltGetSpaceLength(const GenTime &pos, int track, bool fromBlankStart);
 
@@ -239,7 +239,7 @@ Q_OBJECT public:
     bool mltAddEffect(Mlt::Service service, EffectsParameterList params, int duration, bool doRefresh);
     bool mltAddTrackEffect(int track, EffectsParameterList params);
     
-    /** @brief Enable / disable clip effects. 
+    /** @brief Enable / disable clip effects.
      * @param track The track where the clip is
      * @param position The start position of the clip
      * @param effectIndexes The list of effect indexes to enable / disable
index 16228dbacae73417a6b57f86f06d6d1952e6935d..a71ec3bf30f2a454d9f035bdefa72c8b2d1565b3 100644 (file)
@@ -516,7 +516,7 @@ void RenderWidget::slotSaveProfile()
 }
 
 
-void RenderWidget::saveProfile(QDomElement newprofile)
+void RenderWidget::saveProfile(const QDomElement &newprofile)
 {
     QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
     QDomDocument doc;
@@ -860,7 +860,7 @@ void RenderWidget::slotPrepareExport(bool scriptExport)
 }
 
 
-void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const QMap <QString, QString> metadata, const QString &playlistPath, const QString &scriptPath, bool exportAudio)
+void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const QMap<QString, QString> &metadata, const QString &playlistPath, const QString &scriptPath, bool exportAudio)
 {
     QListWidgetItem *item = m_view.size_list->currentItem();
     if (!item) return;
index 6e74ffa70709e0cf9d8dc415a93bb3469b08e26d..2c0c9ceef7b371ae14783d1daf0bf83fec4e745c 100644 (file)
@@ -142,7 +142,7 @@ protected:
     virtual void keyPressEvent(QKeyEvent *e);
 
 public slots:
-    void slotExport(bool scriptExport, int zoneIn, int zoneOut, const QMap <QString, QString> metadata, const QString &playlistPath, const QString &scriptPath, bool exportAudio);
+    void slotExport(bool scriptExport, int zoneIn, int zoneOut, const QMap <QString, QString> &metadata, const QString &playlistPath, const QString &scriptPath, bool exportAudio);
 
 private slots:
     void slotUpdateButtons(const KUrl &url);
@@ -202,7 +202,7 @@ private:
     /** @brief Check if a job needs to be started. */
     void checkRenderStatus();
     void startRendering(RenderJobItem *item);
-    void saveProfile(QDomElement newprofile);
+    void saveProfile(const QDomElement &newprofile);
     QList <QListWidgetItem *> m_renderItems;
     QList <QListWidgetItem *> m_renderCategory;
     void errorMessage(const QString &message);
@@ -212,7 +212,7 @@ signals:
     void openDvdWizard(const QString &url);
     /** Send the infos about rendering that will be saved in the document:
     (profile destination, profile name and url of rendered file */
-    void selectedRenderProfile(QMap <QString, QString> renderProps);
+    void selectedRenderProfile(const QMap <QString, QString> &renderProps);
     void prepareRenderingData(bool scriptExport, bool zoneOnly, const QString &chapterFile);
     void shutdown();
 };
index 89bb054604642092e4413b54686137ab417b9205..44451607d043ce39c8cb9fc062165c982a6bde18 100644 (file)
@@ -33,9 +33,6 @@ class SmallRuler : public QWidget
 
 public:
     explicit SmallRuler(Monitor *manager, Render *render, QWidget *parent = 0);
-    virtual void mousePressEvent(QMouseEvent * event);
-    virtual void mouseMoveEvent(QMouseEvent * event);
-    virtual void mouseReleaseEvent(QMouseEvent * event);
     void adjustScale(int maximum);
     void setZone(int start, int end);
     void setZoneStart();
@@ -49,6 +46,9 @@ protected:
     void paintEvent(QPaintEvent *e);
     void resizeEvent(QResizeEvent *);
     void leaveEvent(QEvent * event);
+    void mousePressEvent(QMouseEvent * event);
+    void mouseMoveEvent(QMouseEvent * event);
+    void mouseReleaseEvent(QMouseEvent * event);
 
 private:
     int m_cursorPosition;
index aa93a4a242c1d63e5107d2a3fdd79ec483d11642..a98659ed9b832de832a8cd74608cd9db9e42ea22 100644 (file)
@@ -96,7 +96,7 @@ void TimecodeDisplay::slotUpdateTimeCodeFormat()
     setTimeCodeFormat(KdenliveSettings::frametimecode());
 }
 
-void TimecodeDisplay::updateTimeCode(Timecode t)
+void TimecodeDisplay::updateTimeCode(const Timecode &t)
 {
     m_timecode = t;
     setTimeCodeFormat(KdenliveSettings::frametimecode());
index 467882e49985f27b9c19c0b0ab71029278ae71a0..285bde74c7b2245353e6b4cd74aa9fc1aa9b528b 100644 (file)
@@ -72,7 +72,7 @@ public:
 
     /** @brief Sets timecode for current project.
      * @param t the new timecode */
-    void updateTimeCode(Timecode t);
+    void updateTimeCode(const Timecode &t);
 
     virtual void stepBy(int steps);
 
index 64272842d2691239375264db0a2d778b4a5716c3..a92d6baca7f3909afabf42a4944f532f8689a4d4 100644 (file)
@@ -1881,8 +1881,9 @@ void TitleWidget::saveTitle(KUrl url)
         fs->setMode(KFile::File);
         fs->setConfirmOverwrite(true);
         fs->setKeepLocation(true);
-        fs->exec();
-        if (fs) url = fs->selectedUrl();
+        if (fs->exec()) {
+            url = fs->selectedUrl();
+        }
         delete fs;
     }
     if (!url.isEmpty()) {
index 4c44b631da33b069d8b2fa405d98c04552f7702f..4c6a351e5ef90016d18b4a228f76da60461c93c2 100644 (file)
@@ -104,9 +104,9 @@ public:
     static void refreshTitleTemplates();
 
 protected:
-    virtual void resizeEvent(QResizeEvent * event);
-    virtual void keyPressEvent(QKeyEvent *e);
-    virtual QSize sizeHint() const;
+    void resizeEvent(QResizeEvent * event);
+    void keyPressEvent(QKeyEvent *e);
+    QSize sizeHint() const;
 
 private:
 
index 67477671be67445c8b8c638ba9a7dc142d624085..755b8e11173c17c89da22afdb3ba519e651ee7c7 100644 (file)
@@ -80,7 +80,7 @@ public:
     void updatePalette();
 
 protected:
-    virtual void keyPressEvent(QKeyEvent * event);
+    void keyPressEvent(QKeyEvent * event);
 
 public slots:
     void slotDeleteClip(const QString &clipId);
index 715ad244d290433f8e1639db6e52319bcbd19a66..6afc76ec8f30047c2344ec4292c8ad02dbdd57b7 100644 (file)
@@ -211,7 +211,7 @@ void TransitionSettings::slotTransitionItemSelected(Transition* t, int nextTrack
     }
 }
 
-void TransitionSettings::slotUpdateEffectParams(const QDomElement oldparam, const QDomElement param)
+void TransitionSettings::slotUpdateEffectParams(const QDomElement &oldparam, const QDomElement &param)
 {
     if (m_usedTransition) {
         m_usedTransition->setTransitionParameters(param);
index ed59d25d7145ca47f5e5c82654c04cb8940dfb06..e1cc0c52a0d91fab9661349092dd4b4148a323e5 100644 (file)
@@ -50,7 +50,7 @@ private:
 public slots:
     void slotTransitionItemSelected(Transition* t, int nextTrack, const QPoint &p, bool update);
     void slotTransitionChanged(bool reinit = true, bool updateCurrent = false);
-    void slotUpdateEffectParams(const QDomElement, const QDomElement);
+    void slotUpdateEffectParams(const QDomElement &, const QDomElement&);
 
 private slots:
     /** @brief Sets the new B track for the transition (automatic or forced). */
index 6ccffff20e22cef78eee43db86bfc0c7b2254f93..05917a5604b72adcf25148a28ec68e864441c751 100644 (file)
@@ -38,7 +38,7 @@ AbstractService::~AbstractService()
 {
 }
 
-void AbstractService::slotStartSearch(const QString , int )
+void AbstractService::slotStartSearch(const QString , int )
 {
 }
 
index 2e52d6341e75e087ad3ddadaaf771190cf7d5972..1ed591e3174c9f934d1bc7849eb3aea57313ecd8 100644 (file)
@@ -74,7 +74,7 @@ public:
     SERVICETYPE serviceType;
 
 public slots:
-    virtual void slotStartSearch(const QString searchText, int page = 0);
+    virtual void slotStartSearch(const QString &searchText, int page = 0);
     virtual OnlineItemInfo displayItemDetails(QListWidgetItem *item);
     virtual bool startItemPreview(QListWidgetItem *item);
     virtual void stopItemPreview(QListWidgetItem *item);
index 601178985f39f0cb261dfc632f1f251a7210bbf8..e6b9296cf6d61f1bb455411392b0f385afab27eb 100644 (file)
@@ -52,7 +52,7 @@ ArchiveOrg::~ArchiveOrg()
     delete m_previewProcess;
 }
 
-void ArchiveOrg::slotStartSearch(const QString searchText, int page)
+void ArchiveOrg::slotStartSearch(const QString &searchText, int page)
 {
     m_listWidget->clear();
     QString uri = "http://www.archive.org/advancedsearch.php?q=";
index b0a5a0ec5d5536ac137e650bbc5d11fc14b33619..3ef1446fe69caa319bba1115f3052961c4e07705 100644 (file)
@@ -36,15 +36,15 @@ class ArchiveOrg : public AbstractService
 public:
     explicit ArchiveOrg(QListWidget *listWidget, QObject * parent = 0);
     virtual ~ArchiveOrg();
-    virtual QString getExtension(QListWidgetItem *item);
-    virtual QString getDefaultDownloadName(QListWidgetItem *item);
+    QString getExtension(QListWidgetItem *item);
+    QString getDefaultDownloadName(QListWidgetItem *item);
 
 
 public slots:
-    virtual void slotStartSearch(const QString searchText, int page = 0);
-    virtual OnlineItemInfo displayItemDetails(QListWidgetItem *item);
-    virtual bool startItemPreview(QListWidgetItem *item);
-    virtual void stopItemPreview(QListWidgetItem *item);    
+    void slotStartSearch(const QString &searchText, int page = 0);
+    OnlineItemInfo displayItemDetails(QListWidgetItem *item);
+    bool startItemPreview(QListWidgetItem *item);
+    void stopItemPreview(QListWidgetItem *item);
 
 private slots:
     void slotShowResults(KJob* job);
index 650f208fc518952618cb20e22d2d5942666e95ff..bd7393174b5e886289cbabcd8353dd4ba7635a9b 100644 (file)
@@ -50,12 +50,13 @@ FreeSound::~FreeSound()
     delete m_previewProcess;
 }
 
-void FreeSound::slotStartSearch(const QString searchText, int page)
+void FreeSound::slotStartSearch(const QString &searchText, int page)
 {
     m_listWidget->clear();
     QString uri = "http://www.freesound.org/api/sounds/search/?q=";
     uri.append(searchText);
-    if (page > 1) uri.append("&p=" + QString::number(page));
+    if (page > 1)
+        uri.append("&p=" + QString::number(page));
     uri.append("&api_key=a1772c8236e945a4bee30a64058dabf8");
 
     KJob* resolveJob = KIO::storedGet( KUrl(uri), KIO::NoReload, KIO::HideProgressInfo );
index 03906093a9b76daef417793811b1cf4cacecb954..db15d3452178d92602b9bf47365c1a7cad95a7ae 100644 (file)
@@ -36,15 +36,15 @@ class FreeSound : public AbstractService
 public:
     explicit FreeSound(QListWidget *listWidget, QObject * parent = 0);
     ~FreeSound();
-    virtual QString getExtension(QListWidgetItem *item);
-    virtual QString getDefaultDownloadName(QListWidgetItem *item);
+    QString getExtension(QListWidgetItem *item);
+    QString getDefaultDownloadName(QListWidgetItem *item);
 
 
 public slots:
-    virtual void slotStartSearch(const QString searchText, int page = 0);
-    virtual OnlineItemInfo displayItemDetails(QListWidgetItem *item);
-    virtual bool startItemPreview(QListWidgetItem *item);
-    virtual void stopItemPreview(QListWidgetItem *item);    
+    void slotStartSearch(const QString& searchText, int page = 0);
+    OnlineItemInfo displayItemDetails(QListWidgetItem *item);
+    bool startItemPreview(QListWidgetItem *item);
+    void stopItemPreview(QListWidgetItem *item);
 
 private slots:
     void slotShowResults(KJob* job);
index 94a54a2ee146e5757229bd1053f2fe42cd11b8e3..2130cba39dadfbb5a89c475f0e839d450b945920 100644 (file)
@@ -39,12 +39,13 @@ OpenClipArt::~OpenClipArt()
 {
 }
 
-void OpenClipArt::slotStartSearch(const QString searchText, int page)
+void OpenClipArt::slotStartSearch(const QString &searchText, int page)
 {
     m_listWidget->clear();
     QString uri = "http://openclipart.org/api/search/?query=";
     uri.append(searchText);
-    if (page > 1) uri.append("&page=" + QString::number(page));
+    if (page > 1)
+        uri.append("&page=" + QString::number(page));
         
     KJob* resolveJob = KIO::storedGet( KUrl(uri), KIO::NoReload, KIO::HideProgressInfo );
     connect( resolveJob, SIGNAL(result(KJob*)), this, SLOT(slotShowResults(KJob*)) );
index 1ba638c66d160bfdcf470b945f26022ea803f045..bc61a215c955e44e61eed2c9574d7a461f7e741e 100644 (file)
@@ -36,13 +36,13 @@ class OpenClipArt : public AbstractService
 public:
     explicit OpenClipArt(QListWidget *listWidget, QObject * parent = 0);
     ~OpenClipArt();
-    virtual QString getExtension(QListWidgetItem *item);
-    virtual QString getDefaultDownloadName(QListWidgetItem *item);
+    QString getExtension(QListWidgetItem *item);
+    QString getDefaultDownloadName(QListWidgetItem *item);
 
 
 public slots:
-    virtual void slotStartSearch(const QString searchText, int page = 0);
-    virtual OnlineItemInfo displayItemDetails(QListWidgetItem *item);
+    void slotStartSearch(const QString &searchText, int page = 0);
+    OnlineItemInfo displayItemDetails(QListWidgetItem *item);
  
 
 private slots:
index bee35725eddc7093bfbe82c8edbbe4d474fa6b48..cf0e247cce0ce27e2315d7ab7b4f657c26dce8f1 100644 (file)
@@ -59,11 +59,11 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
     char *devName = NULL;
     int captureEnabled = 1;
     if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0) {
-            fprintf(stderr, "Cannot get capabilities.");
-            //return NULL;
+        fprintf(stderr, "Cannot get capabilities.");
+        //return NULL;
     }
     else {
-       devName = strdup((char*) cap.card);
+        devName = strdup((char*) cap.card);
         if(!cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) {
             // Device cannot capture
             captureEnabled = 0;
@@ -71,7 +71,7 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
     }
 
     if (captureEnabled) {
-       struct v4l2_format format;
+        struct v4l2_format format;
         memset(&format,0,sizeof(format));
         format.type  = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 
@@ -85,20 +85,20 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
 
         struct v4l2_frmivalenum rates;
         memset(&rates,0,sizeof(rates));
-       char value[200];
+        char value[200];
 
         while (ioctl(fd, VIDIOC_ENUM_FMT, &fmt) != -1)
         {
-           if (pixelformatdescription.length() > 2000) break;
+            if (pixelformatdescription.length() > 2000) break;
             if (snprintf( value, sizeof(value), ">%c%c%c%c", fmt.pixelformat >> 0,  fmt.pixelformat >> 8, fmt.pixelformat >> 16, fmt.pixelformat >> 24 ) > 0)
-               pixelformatdescription.append(value);
+                pixelformatdescription.append(value);
             fprintf(stderr, "detected format: %s: %c%c%c%c\n", fmt.description, fmt.pixelformat >> 0,  fmt.pixelformat >> 8, fmt.pixelformat >> 16, fmt.pixelformat >> 24);
 
             sizes.pixel_format = fmt.pixelformat;
             sizes.index = 0;
             // Query supported frame size
             while (ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &sizes) != -1) {
-               struct v4l2_frmsize_discrete image_size = sizes.discrete;
+                struct v4l2_frmsize_discrete image_size = sizes.discrete;
                 // Query supported frame rates
                 rates.index = 0;
                 rates.pixel_format = fmt.pixelformat;
@@ -106,14 +106,14 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
                 rates.height = image_size.height;
                 if (pixelformatdescription.length() > 2000) break;
                 if (snprintf( value, sizeof(value), ":%dx%d=", image_size.width, image_size.height ) > 0)
-                   pixelformatdescription.append(value);
+                    pixelformatdescription.append(value);
                 fprintf(stderr, "Size: %dx%d: ", image_size.width, image_size.height);
                 while (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &rates) != -1) {
-                   if (pixelformatdescription.length() > 2000) break;
+                    if (pixelformatdescription.length() > 2000) break;
                     if (snprintf( value, sizeof(value), "%d/%d,", rates.discrete.denominator, rates.discrete.numerator ) > 0)
-                       pixelformatdescription.append(value);
+                        pixelformatdescription.append(value);
                     fprintf(stderr, "%d/%d, ", rates.discrete.numerator, rates.discrete.denominator);
-                   rates.index ++;
+                    rates.index ++;
                 }
                 fprintf(stderr, "\n");
                 sizes.index++;
@@ -125,7 +125,8 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
     free(src);
 
     QStringList result;
-    if (devName == NULL) return result; 
+    if (devName == NULL)
+        return result;
     QString deviceName(devName);
     result << (deviceName.isEmpty() ? input : deviceName) << pixelformatdescription;
     return result;