]> git.sesse.net Git - kdenlive/commitdiff
Remove virtual keyword, fix indent. Const'ref
authorMontel Laurent <montel@kde.org>
Thu, 30 May 2013 11:12:01 +0000 (13:12 +0200)
committerMontel Laurent <montel@kde.org>
Thu, 30 May 2013 11:12:01 +0000 (13:12 +0200)
20 files changed:
src/abstractclipitem.h
src/abstractgroupitem.cpp
src/choosecolorwidget.cpp
src/clipdurationdialog.cpp
src/clipitem.cpp
src/clipitem.h
src/clipproperties.cpp
src/clipstabilize.cpp
src/cliptranscode.cpp
src/colorpickerwidget.h
src/complexparameter.h
src/customruler.h
src/customtrackview.cpp
src/customtrackview.h
src/onmonitoritems/onmonitorcornersitem.h
src/onmonitoritems/onmonitorpathitem.cpp
src/onmonitoritems/onmonitorrectitem.cpp
src/onmonitoritems/rotoscoping/bpointitem.cpp
src/scopes/colorscopes/waveform.cpp
src/stopmotion/stopmotion.cpp

index 4999a72f92e2a23750afd9a58369aacd010b1e01..1420788ed928901364fab1a84d6d95bb8b65d756 100644 (file)
@@ -129,7 +129,7 @@ protected:
       */
     void drawKeyFrames(QPainter *painter, const QTransform &transformation, bool limitedKeyFrames);
     int mouseOverKeyFrames(QPointF pos, double maxOffset);
-    virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
+    void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
 };
 
index ba40dd719cacc4995089387688dc0f860ab5f86f..e91d1f81a310108101e4efb937ab80000424e1dc 100644 (file)
@@ -34,8 +34,8 @@
 
 
 AbstractGroupItem::AbstractGroupItem(double /* fps */) :
-        QObject(),
-        QGraphicsItemGroup()
+    QObject(),
+    QGraphicsItemGroup()
 {
     setZValue(1);
     setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
@@ -57,14 +57,14 @@ int AbstractGroupItem::track() const
     int topTrack = -1;
     QList<QGraphicsItem *> children = childItems();
     for (int i = 0; i < children.count(); ++i) {
-       if (children.at(i)->type() == GROUPWIDGET) {
-           children.append(children.at(i)->childItems());
-           continue;
-       }
+        if (children.at(i)->type() == GROUPWIDGET) {
+            children.append(children.at(i)->childItems());
+            continue;
+        }
         AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
         if (item && (topTrack == -1 || topTrack > item->track())) {
-           topTrack = item->track();
-       }
+            topTrack = item->track();
+        }
     }
     return topTrack;
 }
@@ -138,7 +138,7 @@ QPainterPath AbstractGroupItem::spacerGroupShape(GRAPHICSRECTITEM type, const QP
         if (children.at(i)->type() == (int)type) {
             QRectF r(children.at(i)->sceneBoundingRect());
             r.translate(offset);
-           r.setRight(scene()->width());
+            r.setRight(scene()->width());
             path.addRect(r);
         } else if (children.at(i)->type() == GROUPWIDGET) {
             QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
@@ -146,7 +146,7 @@ QPainterPath AbstractGroupItem::spacerGroupShape(GRAPHICSRECTITEM type, const QP
                 if (subchildren.at(j)->type() == (int)type) {
                     QRectF r(subchildren.at(j)->sceneBoundingRect());
                     r.translate(offset);
-                   r.setRight(scene()->width());
+                    r.setRight(scene()->width());
                     path.addRect(r);
                 }
             }
@@ -214,23 +214,23 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
         xpos = qMax(xpos, 0);
         //kDebug()<<"GRP XPOS:"<<xpos<<", START:"<<start.x()<<",NEW:"<<newPos.x()<<"; SCENE:"<<scenePos().x()<<",POS:"<<pos().x();
         newPos.setX((int)(pos().x() + xpos - (int) start.x()));
-       QStringList lockedTracks = property("locked_tracks").toStringList();
+        QStringList lockedTracks = property("locked_tracks").toStringList();
         int proposedTrack = (property("y_absolute").toInt() + newPos.y()) / trackHeight;
         // Check if top item is a clip or a transition
         int offset = 0;
         int topTrack = -1;
-       QList<int> groupTracks;
+        QList<int> groupTracks;
         QList<QGraphicsItem *> children = childItems();
         for (int i = 0; i < children.count(); ++i) {
             int currentTrack = 0;
-           if (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET) {
-               currentTrack = static_cast <AbstractClipItem*> (children.at(i))->track();
-               if (!groupTracks.contains(currentTrack)) groupTracks.append(currentTrack);
-           }
-           else if (children.at(i)->type() == GROUPWIDGET) {
-               currentTrack = static_cast <AbstractGroupItem*> (children.at(i))->track();
-           }
-           else continue;
+            if (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET) {
+                currentTrack = static_cast <AbstractClipItem*> (children.at(i))->track();
+                if (!groupTracks.contains(currentTrack)) groupTracks.append(currentTrack);
+            }
+            else if (children.at(i)->type() == GROUPWIDGET) {
+                currentTrack = static_cast <AbstractGroupItem*> (children.at(i))->track();
+            }
+            else continue;
             if (children.at(i)->type() == AVWIDGET) {
                 if (topTrack == -1 || currentTrack <= topTrack) {
                     offset = 0;
@@ -246,8 +246,8 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
                 bool clipGroup = false;
                 for (int j = 0; j < subchildren.count(); j++) {
                     if (subchildren.at(j)->type() == AVWIDGET || subchildren.at(j)->type() == TRANSITIONWIDGET) {
-                       int subTrack = static_cast <AbstractClipItem*> (subchildren.at(j))->track();
-                       if (!groupTracks.contains(subTrack)) groupTracks.append(subTrack);
+                        int subTrack = static_cast <AbstractClipItem*> (subchildren.at(j))->track();
+                        if (!groupTracks.contains(subTrack)) groupTracks.append(subTrack);
                         clipGroup = true;
                     }
                 }
@@ -266,22 +266,22 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
         }
         // Check no clip in the group goes outside of existing tracks
         int maximumTrack = projectScene()->tracksCount() - 1;
-       int groupHeight = 0;
-       for (int i = 0; i < groupTracks.count(); ++i) {
-           int offset = groupTracks.at(i) - topTrack;
-           if (offset > groupHeight) groupHeight = offset; 
-       }
-       maximumTrack -= groupHeight;
+        int groupHeight = 0;
+        for (int i = 0; i < groupTracks.count(); ++i) {
+            int offset = groupTracks.at(i) - topTrack;
+            if (offset > groupHeight) groupHeight = offset;
+        }
+        maximumTrack -= groupHeight;
         proposedTrack = qMin(proposedTrack, maximumTrack);
         proposedTrack = qMax(proposedTrack, 0);
-       int groupOffset = proposedTrack - topTrack;
-       if (!lockedTracks.isEmpty()) {
-           for (int i = 0; i < groupTracks.count(); ++i) {
-               if (lockedTracks.contains(QString::number(groupTracks.at(i) + groupOffset))) {
-                   return pos();
-               }
-           }
-       }
+        int groupOffset = proposedTrack - topTrack;
+        if (!lockedTracks.isEmpty()) {
+            for (int i = 0; i < groupTracks.count(); ++i) {
+                if (lockedTracks.contains(QString::number(groupTracks.at(i) + groupOffset))) {
+                    return pos();
+                }
+            }
+        }
         newPos.setY((int)((proposedTrack) * trackHeight) + offset);
         //if (newPos == start) return start;
 
@@ -431,11 +431,11 @@ void AbstractGroupItem::dropEvent(QGraphicsSceneDragDropEvent * event)
     QList<QGraphicsItem *> selection = scene()->items(dropPos);
     AbstractClipItem *dropChild = NULL;
     for (int i = 0; i < selection.count(); ++i) {
-       if (selection.at(i)->type() == AVWIDGET) {
+        if (selection.at(i)->type() == AVWIDGET) {
             dropChild = (AbstractClipItem *) selection.at(i);
-           break;
+            break;
         }
-    }           
+    }
     if (view) view->slotAddGroupEffect(e, this, dropChild);
 }
 
@@ -457,15 +457,15 @@ void AbstractGroupItem::mousePressEvent(QGraphicsSceneMouseEvent * event)
         // User want to do a rectangle selection, so ignore the event to pass it to the view
         event->ignore();
     } else {
-       QList <QGraphicsItem *>list = scene()->items(event->scenePos());
-       // only allow group move if we click over an item in the group
-       foreach(const QGraphicsItem *item, list) {
-           if (item->type() == TRANSITIONWIDGET || item->type() == AVWIDGET) {
-               QGraphicsItem::mousePressEvent(event);
-               return;
-           }
-       }
-       event->ignore();
+        QList <QGraphicsItem *>list = scene()->items(event->scenePos());
+        // only allow group move if we click over an item in the group
+        foreach(const QGraphicsItem *item, list) {
+            if (item->type() == TRANSITIONWIDGET || item->type() == AVWIDGET) {
+                QGraphicsItem::mousePressEvent(event);
+                return;
+            }
+        }
+        event->ignore();
     }
 }
 
index 0b11af05ba72eee07cb6373d2964c6069e190f22..f8b8d3024b7050e30d4883316808a8948ae64a9b 100644 (file)
@@ -78,11 +78,9 @@ static QString colorToString(const QColor &color, bool alpha)
     stream.setFieldAlignment(QTextStream::AlignRight);
     stream.setPadChar('0');
     stream <<  color.red() << color.green() << color.blue();
-    if(alpha)
-    {
+    if (alpha) {
         stream << color.alpha();
-    }
-    else {
+    } else {
        // MLT always wants 0xRRGGBBAA format
        stream << "ff";
     }
index f761c02e581ba817e444472870c4bdbe19282b5d..853339380b4f5d4b08dd1cb804ebd0a3d8ec0b29 100644 (file)
@@ -49,7 +49,7 @@ ClipDurationDialog::ClipDurationDialog(AbstractClipItem *clip, const Timecode &t
     bool allowCrop = true;
     if (clip->type() == AVWIDGET) {
         ClipItem *item = static_cast <ClipItem *>(clip);
-        int t = item->clipType();
+        const int t = item->clipType();
         if (t == COLOR || t == IMAGE || t == TEXT)
             allowCrop = false;
     }
index 59d54d900e1af19656842dda4d28130bda339d60..2875be2b820c089a3b31a940942cd543fade982a 100644 (file)
@@ -342,10 +342,10 @@ const QString ClipItem::adjustKeyframes(const QString &keyframes, int offset)
 {
     QStringList result;
     // Simple keyframes
-    const QStringList list = keyframes.split(';', QString::SkipEmptyParts);
+    const QStringList list = keyframes.split(QLatin1Char(';'), QString::SkipEmptyParts);
     foreach(const QString &keyframe, list) {
-        int pos = keyframe.section(':', 0, 0).toInt() - offset;
-        QString newKey = QString::number(pos) + ":" + keyframe.section(':', 1);
+        const int pos = keyframe.section(':', 0, 0).toInt() - offset;
+        const QString newKey = QString::number(pos) + ":" + keyframe.section(':', 1);
         result.append(newKey);
     }
     return result.join(";");
@@ -559,7 +559,8 @@ void ClipItem::updateKeyframeEffect()
 
 QDomElement ClipItem::selectedEffect()
 {
-    if (m_selectedEffect == -1 || m_effectList.isEmpty()) return QDomElement();
+    if (m_selectedEffect == -1 || m_effectList.isEmpty())
+        return QDomElement();
     return effectAtIndex(m_selectedEffect);
 }
 
index ac9f1df9cbb71f8ee2a3b3c7233a5b930c1866c1..bb51610ee0573d2429698cc670d35211c45b84fe 100644 (file)
@@ -197,12 +197,12 @@ public:
 
 protected:
     //virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event);
-    virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
-    virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
-    virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
+    void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
+    void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
+    void dropEvent(QGraphicsSceneDragDropEvent *event);
     //virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *);
     //virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *);
-    virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
+    QVariant itemChange(GraphicsItemChange change, const QVariant &value);
 
 private:
     DocClipBase *m_clip;
index a9e6afe6e9e235af49cd32ce18f1310540140f26..79b8c2c222d5587b576f77fafc412021dd54038c 100644 (file)
@@ -209,8 +209,9 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
         QStringList values = i.value();
         QString parentName;
         QString iconName;
-        if (values.count() > 1 && !values.at(1).isEmpty()) parentName = values.at(1);
-        else {
+        if (values.count() > 1 && !values.at(1).isEmpty()) {
+            parentName = values.at(1);
+        } else {
             if (KdenliveSettings::ffmpegpath().endsWith("avconv")) {
                 parentName = i18n("Libav");
                 iconName = "meta_libav.png";
@@ -222,9 +223,11 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
         }
         QTreeWidgetItem *parent = NULL;
         QList <QTreeWidgetItem *> matches = m_view.metadata_list->findItems(parentName, Qt::MatchExactly);
-        if (!matches.isEmpty()) parent = matches.at(0);
-        else {
-            if (parentName == "Magic Lantern") iconName = "meta_magiclantern.png";
+        if (!matches.isEmpty()) {
+            parent = matches.at(0);
+        } else {
+            if (parentName == "Magic Lantern")
+                iconName = "meta_magiclantern.png";
             parent = new QTreeWidgetItem(m_view.metadata_list, QStringList() << parentName);
             if (!iconName.isEmpty()) {
                 KIcon icon(KStandardDirs::locate("appdata", iconName));
@@ -314,7 +317,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
             m_view.image_transparency->setChecked(props.value("transparency").toInt());
         connect(m_view.image_transparency, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
         int width = 180.0 * KdenliveSettings::project_display_ratio();
-        if (width % 2 == 1) width++;
+        if (width % 2 == 1)
+            width++;
         m_view.clip_thumb->setPixmap(QPixmap(url.path()).scaled(QSize(width, 180), Qt::KeepAspectRatio));
     } else if (t == COLOR) {
         m_view.clip_path->setEnabled(false);
@@ -327,7 +331,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
         m_view.clip_color->setColor(QColor('#' + props.value("colour").right(8).left(6)));
         connect(m_view.clip_color, SIGNAL(changed(QColor)), this, SLOT(slotModified()));
     } else if (t == SLIDESHOW) {
-        if (url.fileName().startsWith(".all.")) {
+        if (url.fileName().startsWith(QLatin1String(".all."))) {
             // the image sequence is defined by mimetype
             m_view.clip_path->setText(url.directory());
         } else {
@@ -452,7 +456,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
         
         m_view.clip_thumb->setMinimumSize(180 * KdenliveSettings::project_display_ratio(), 180);
         
-        if (t == IMAGE || t == VIDEO || t == PLAYLIST) m_view.tabWidget->removeTab(AUDIOTAB);
+        if (t == IMAGE || t == VIDEO || t == PLAYLIST)
+            m_view.tabWidget->removeTab(AUDIOTAB);
     } else {
         m_view.tabWidget->removeTab(IMAGETAB);
         m_view.tabWidget->removeTab(SLIDETAB);
@@ -470,8 +475,9 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
     }
     m_view.clip_duration->setInputMask(tc.mask());
     m_view.clip_duration->setText(tc.getTimecode(m_clip->duration()));
-    if (t != IMAGE && t != COLOR && t != TEXT) m_view.clip_duration->setReadOnly(true);
-    else {
+    if (t != IMAGE && t != COLOR && t != TEXT) {
+        m_view.clip_duration->setReadOnly(true);
+    } else {
         connect(m_view.clip_duration, SIGNAL(editingFinished()), this, SLOT(slotCheckMaxLength()));
         connect(m_view.clip_duration, SIGNAL(textChanged(QString)), this, SLOT(slotModified()));
     }
@@ -702,7 +708,9 @@ ClipProperties::ClipProperties(const QList <DocClipBase *> &cliplist, const Time
         if (commonproperties.value("out").toInt() > 0) {
             m_view.clip_force_out->setChecked(true);
             m_view.clip_out->setText(m_tc.getTimecodeFromFrames(commonproperties.value("out").toInt()));
-        } else m_view.clip_out->setText(KdenliveSettings::image_duration());
+        } else {
+            m_view.clip_out->setText(KdenliveSettings::image_duration());
+        }
     } else {
         m_view.clip_force_out->setHidden(true);
         m_view.clip_out->setHidden(true);
@@ -752,7 +760,8 @@ void ClipProperties::loadVideoProperties(const QMap <QString, QString> &props)
 
 void ClipProperties::slotGotThumbnail(const QString &id, const QImage &img)
 {
-    if (id != m_clip->getId()) return;
+    if (id != m_clip->getId())
+        return;
     QPixmap framedPix(img.width(), img.height());
     framedPix.fill(Qt::transparent);
     QPainter p(&framedPix);
@@ -779,13 +788,15 @@ void ClipProperties::slotApplyProperties()
 
 void ClipProperties::slotReloadVideoProperties()
 {
-    if (m_clip == NULL) return;
+    if (m_clip == NULL)
+        return;
     loadVideoProperties(m_clip->properties());
 }
 
 void ClipProperties::slotReloadVideoThumb()
 {
-    if (m_clip == NULL) return;
+    if (m_clip == NULL)
+        return;
     emit requestThumb(QString('?' + m_clip->getId()), QList<int>() << m_clip->getClipThumbFrame());
 }
 
@@ -915,8 +926,9 @@ void ClipProperties::slotDeleteAnalysis()
 
 void ClipProperties::slotSaveAnalysis()
 {
-    QString url = KFileDialog::getSaveFileName(KUrl("kfiledialog:///projectfolder"), "text/plain", this, i18n("Save Analysis Data"));
-    if (url.isEmpty()) return;
+    const QString url = KFileDialog::getSaveFileName(KUrl("kfiledialog:///projectfolder"), "text/plain", this, i18n("Save Analysis Data"));
+    if (url.isEmpty())
+        return;
     KSharedConfigPtr config = KSharedConfig::openConfig(url, KConfig::SimpleConfig);
     KConfigGroup analysisConfig(config, "Analysis");
     QTreeWidgetItem *current = m_view.analysis_list->currentItem();
@@ -925,8 +937,9 @@ void ClipProperties::slotSaveAnalysis()
 
 void ClipProperties::slotLoadAnalysis()
 {
-    QString url = KFileDialog::getOpenFileName(KUrl("kfiledialog:///projectfolder"), "text/plain", this, i18n("Open Analysis Data"));
-    if (url.isEmpty()) return;
+    const QString url = KFileDialog::getOpenFileName(KUrl("kfiledialog:///projectfolder"), "text/plain", this, i18n("Open Analysis Data"));
+    if (url.isEmpty())
+        return;
     KSharedConfigPtr config = KSharedConfig::openConfig(url, KConfig::SimpleConfig);
     KConfigGroup transConfig(config, "Analysis");
     // read the entries
@@ -1240,8 +1253,9 @@ void ClipProperties::parseFolder(bool reloadThumb)
 
 void ClipProperties::slotCheckMaxLength()
 {
-    if (m_clip->maxDuration() == GenTime()) return;
-    int duration = m_tc.getFrameCount(m_view.clip_duration->text());
+    if (m_clip->maxDuration() == GenTime())
+        return;
+    const int duration = m_tc.getFrameCount(m_view.clip_duration->text());
     if (duration > m_clip->maxDuration().frames(m_fps)) {
         m_view.clip_duration->setText(m_tc.getTimecode(m_clip->maxDuration()));
     }
@@ -1249,7 +1263,7 @@ void ClipProperties::slotCheckMaxLength()
 
 void ClipProperties::slotUpdateDurationFormat(int ix)
 {
-    bool framesFormat = ix == 1;
+    bool framesFormat = (ix == 1);
     if (framesFormat) {
         // switching to frames count, update widget
         m_view.slide_duration_frames->setValue(m_tc.getFrameCount(m_view.slide_duration->text()));
@@ -1271,10 +1285,11 @@ void ClipProperties::slotUpdateDurationFormat(int ix)
 
 void ClipProperties::slotDeleteProxy()
 {
-    QString proxy = m_clip->getProperty("proxy");
-    if (proxy.isEmpty()) return;
+    const QString proxy = m_clip->getProperty("proxy");
+    if (proxy.isEmpty())
+        return;
     emit deleteProxy(proxy);
-    if (m_proxyContainer) delete m_proxyContainer;
+    delete m_proxyContainer;
 }
 
 void ClipProperties::slotOpenUrl(const QString &url)
index 857d49f6a71616fb128c6a9b133a344cb0909a34..c35586a8556031717a4f90567b4ea5577fee6638 100644 (file)
@@ -68,6 +68,7 @@ ClipStabilize::ClipStabilize(const QStringList &urls, const QString &filterName,
                                dest_url->setMode(KFile::File);
                                dest_url->setUrl(KUrl(newFile));
                                dest_url->fileDialog()->setOperationMode(KFileDialog::Saving);
+
 } else {
                                label_dest->setText(i18n("Destination folder"));
                                dest_url->setMode(KFile::Directory);
index 87797a885d2d402cb682e5f9647f10290407eb9d..4f6218c49747c765a8f2062d0d4fd61fc27e2983 100644 (file)
@@ -28,7 +28,7 @@
 
 
 ClipTranscode::ClipTranscode(const KUrl::List &urls, const QString &params, const QStringList &postParams, const QString &description, bool automaticMode, QWidget * parent) :
-        QDialog(parent), m_urls(urls), m_duration(0), m_automaticMode(automaticMode), m_postParams(postParams)
+    QDialog(parent), m_urls(urls), m_duration(0), m_automaticMode(automaticMode), m_postParams(postParams)
 {
     setFont(KGlobalSettings::toolBarFont());
     setupUi(this);
@@ -43,7 +43,7 @@ ClipTranscode::ClipTranscode(const KUrl::List &urls, const QString &params, cons
     log_text->setHidden(true);
     setWindowTitle(i18n("Transcode Clip"));
     if (m_automaticMode) {
-       auto_add->setHidden(true);
+        auto_add->setHidden(true);
     }
     auto_add->setText(i18np("Add clip to project", "Add clips to project", m_urls.count()));
     auto_add->setChecked(KdenliveSettings::add_new_clip());
@@ -144,27 +144,27 @@ void ClipTranscode::slotStartTransCode()
     parameters << "-i" << s_url;
     if (QFile::exists(destination + extension)) {
         if (KMessageBox::questionYesNo(this, i18n("File %1 already exists.\nDo you want to overwrite it?", destination + extension)) == KMessageBox::No) {
-           // Abort operation
-           if (m_automaticMode) {
-               // inform caller that we aborted
-               emit transcodedClip(source_url->url(), KUrl());
-               close();
-           }
-           return;
-       }
+            // Abort operation
+            if (m_automaticMode) {
+                // inform caller that we aborted
+                emit transcodedClip(source_url->url(), KUrl());
+                close();
+            }
+            return;
+        }
         parameters << "-y";
     }
 
     bool replaceVfParams = false;
     foreach(QString s, params.split(' ')) {
-       if (replaceVfParams) {
-           s= m_postParams.at(1);
-           replaceVfParams = false;
-       }
+        if (replaceVfParams) {
+            s= m_postParams.at(1);
+            replaceVfParams = false;
+        }
         parameters << s.replace("%1", destination);
-       if (s == "-vf") {
-           replaceVfParams = true;
-       }
+        if (s == "-vf") {
+            replaceVfParams = true;
+        }
     }
     
     buttonBox->button(QDialogButtonBox::Abort)->setText(i18n("Abort"));
@@ -229,7 +229,7 @@ void ClipTranscode::slotTranscodeFinished(int exitCode, QProcess::ExitStatus exi
                 QString extension = params.section("%1", 1, 1).section(' ', 0, 0);
                 url = KUrl(dest_url->url().path(KUrl::AddTrailingSlash) + source_url->url().fileName() + extension);
             } else url = dest_url->url();
-           if (m_automaticMode) emit transcodedClip(source_url->url(), url);
+            if (m_automaticMode) emit transcodedClip(source_url->url(), url);
             else emit addClip(url);
         }
         if (urls_list->count() > 0 && m_urls.count() > 0) {
index eeede832106524e50e488f537eb31b44dd7e88dd..ac9913ead55399ba7e3083eea976e828e87341dc 100644 (file)
@@ -63,9 +63,9 @@ public:
     virtual ~ColorPickerWidget();
 
 protected:
-    virtual void mousePressEvent(QMouseEvent *event);
-    virtual void mouseReleaseEvent(QMouseEvent *event);
-    virtual void mouseMoveEvent(QMouseEvent *event);
+    void mousePressEvent(QMouseEvent *event);
+    void mouseReleaseEvent(QMouseEvent *event);
+    void mouseMoveEvent(QMouseEvent *event);
     bool eventFilter(QObject *object, QEvent *event);
 
 private:
index b1519af184900a336cd6f6d1b5724708ff58b0be..b4fb4cfb84c002536b8352338c71d5c2e384758f 100644 (file)
@@ -31,11 +31,6 @@ class ComplexParameter : public QWidget
 public:
     explicit ComplexParameter(QWidget *parent = 0);
     QDomElement getParamDesc() const;
-private:
-    Ui::KeyframeWidget_UI m_ui;
-    QDomElement m_param;
-    void setupListView();
-    void updateButtonStatus();
 
 public slots:
     void slotSetMoveX();
@@ -48,11 +43,17 @@ public slots:
     void setupParam(const QDomElement &, const QString& paramName, int, int);
     void slotUpdateEffectParams(const QDomElement &e);
     void slotUpdateParameterList(const QStringList &);
+
 signals:
     void removeEffect(ClipItem*, const QDomElement &);
     void updateClipEffect(ClipItem*, const QDomElement &);
     void parameterChanged();
 
+private:
+    Ui::KeyframeWidget_UI m_ui;
+    QDomElement m_param;
+    void setupListView();
+    void updateButtonStatus();
 };
 
 #endif
index 33e006fa55cbb4c8c6a11bc8649752ad53a1fa1f..9466e83c34279df172c48f3e6925373be6e3c4e0 100644 (file)
@@ -52,12 +52,12 @@ public:
     void updatePalette();
     
 protected:
-    virtual void paintEvent(QPaintEvent * /*e*/);
-    virtual void wheelEvent(QWheelEvent * e);
-    virtual void mousePressEvent(QMouseEvent * event);
-    virtual void mouseReleaseEvent(QMouseEvent * event);
-    virtual void mouseMoveEvent(QMouseEvent * event);
-    virtual void leaveEvent(QEvent * event);
+    void paintEvent(QPaintEvent * /*e*/);
+    void wheelEvent(QWheelEvent * e);
+    void mousePressEvent(QMouseEvent * event);
+    void mouseReleaseEvent(QMouseEvent * event);
+    void mouseMoveEvent(QMouseEvent * event);
+    void leaveEvent(QEvent * event);
 
 private:
     Timecode m_timecode;
index d8dab1960181259dd764d816c8466e0b7a146297..1c464842a2a4952ba1ce08016a45260394035f3d 100644 (file)
@@ -1835,13 +1835,14 @@ void CustomTrackView::dragEnterEvent(QDragEnterEvent * event)
     } else QGraphicsView::dragEnterEvent(event);
 }
 
-bool CustomTrackView::itemCollision(AbstractClipItem *item, ItemInfo newPos)
+bool CustomTrackView::itemCollision(AbstractClipItem *item, const ItemInfo &newPos)
 {
     QRectF shape = QRectF(newPos.startPos.frames(m_document->fps()), newPos.track * m_tracksHeight + 1, (newPos.endPos - newPos.startPos).frames(m_document->fps()) - 0.02, m_tracksHeight - 1);
     QList<QGraphicsItem*> collindingItems = scene()->items(shape, Qt::IntersectsItemShape);
     collindingItems.removeAll(item);
-    if (collindingItems.isEmpty()) return false;
-    else {
+    if (collindingItems.isEmpty()) {
+        return false;
+    } else {
         for (int i = 0; i < collindingItems.count(); ++i) {
             QGraphicsItem *collision = collindingItems.at(i);
             if (collision->type() == item->type()) {
@@ -1913,7 +1914,7 @@ void CustomTrackView::addEffect(int track, GenTime pos, QDomElement effect)
     } else emit displayMessage(i18n("Cannot find clip to add effect"), ErrorMessage);
 }
 
-void CustomTrackView::deleteEffect(int track, GenTime pos, QDomElement effect)
+void CustomTrackView::deleteEffect(int track, const GenTime &pos, const QDomElement &effect)
 {
     QString index = effect.attribute("kdenlive_ix");
     if (pos < GenTime()) {
@@ -1999,7 +2000,7 @@ void CustomTrackView::slotAddGroupEffect(QDomElement effect, AbstractGroupItem *
     }
 }
 
-void CustomTrackView::slotAddEffect(ClipItem *clip, QDomElement effect)
+void CustomTrackView::slotAddEffect(ClipItem *clip, const QDomElement &effect)
 {
     if (clip) slotAddEffect(effect, clip->startPos(), clip->track());
 }
@@ -5249,7 +5250,7 @@ void CustomTrackView::prepareResizeClipEnd(AbstractClipItem* item, ItemInfo oldI
     }
 }
 
-void CustomTrackView::updatePositionEffects(ClipItem* item, ItemInfo info, bool standalone)
+void CustomTrackView::updatePositionEffects(ClipItem* item, const ItemInfo &info, bool standalone)
 {
     int end = item->fadeIn();
     if (end != 0) {
index f3a6fa05a129e66f139d28208b3c855557e9273e..31baffa9ae8edd7e88055ff2d40cc34dade10611 100644 (file)
@@ -86,7 +86,7 @@ public:
     void slotAddEffect(QDomElement effect, const GenTime &pos, int track);
     void slotAddGroupEffect(QDomElement effect, AbstractGroupItem *group, AbstractClipItem *dropTarget = NULL);
     void addEffect(int track, GenTime pos, QDomElement effect);
-    void deleteEffect(int track, GenTime pos, QDomElement effect);
+    void deleteEffect(int track, const GenTime &pos, const QDomElement &effect);
     void updateEffect(int track, GenTime pos, QDomElement insertedEffect, bool refreshEffectStack = false);
     /** @brief Enable / disable a list of effects */
     void updateEffectState(int track, GenTime pos, QList <int> effectIndexes, bool disable, bool updateEffectStack);
@@ -295,7 +295,7 @@ public slots:
     * @param skipSelectedItems if true, the selected item start and end points will not be added to snap list */
     void updateSnapPoints(AbstractClipItem *selected, QList <GenTime> offsetList = QList <GenTime> (), bool skipSelectedItems = false);
     
-    void slotAddEffect(ClipItem *clip, QDomElement effect);
+    void slotAddEffect(ClipItem *clip, const QDomElement &effect);
     void slotImportClipKeyframes(GRAPHICSRECTITEM type);
 
     /** @brief Get effect parameters ready for MLT*/
@@ -399,7 +399,7 @@ private:
 
     /** Get the index of the video track that is just below current track */
     int getPreviousVideoTrack(int track);
-    void updatePositionEffects(ClipItem * item, ItemInfo info, bool standalone = true);
+    void updatePositionEffects(ClipItem * item, const ItemInfo &info, bool standalone = true);
     bool insertDropClips(const QMimeData *data, const QPoint &pos);
     bool canBePastedTo(QList <ItemInfo> infoList, int type) const;
     bool canBePasted(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
@@ -414,7 +414,7 @@ private:
     void getTransitionAvailableSpace(AbstractClipItem *item, GenTime &minimum, GenTime &maximum);
     void updateClipTypeActions(ClipItem *clip);
     /** Whether an item can be moved to a new position without colliding with similar items */
-    bool itemCollision(AbstractClipItem *item, ItemInfo newPos);
+    bool itemCollision(AbstractClipItem *item, const ItemInfo &newPos);
     /** Selects all items in the scene rect, and sets ok to false if a group going over several tracks is found in it */
     QList<QGraphicsItem *> checkForGroups(const QRectF &rect, bool *ok);
     /** Adjust clips under another one when working in overwrite mode */
index 8bb113cff6061c90d442d5ba349d374144c1971f..082f03b2d59b75785fc1d13544f3e4829d89c5e6 100644 (file)
@@ -38,7 +38,7 @@ public:
     cornersActions getMode(const QPointF &pos, int *corner);
 
     /** @brief Reimplemented to draw the handles. */
-    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0 );
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0 );
 
 protected:
     void mousePressEvent(QGraphicsSceneMouseEvent *event);
index c3b79df524fbeb6cd08d452f4b14f56afb573fd7..d6a04e7de2ee62a86b5d154b063ca71ae8334213 100644 (file)
 #include <mlt++/Mlt.h>
 
 OnMonitorPathItem::OnMonitorPathItem(double dar, QGraphicsItem* parent) :
-        QGraphicsPathItem(parent),
-        m_dar(dar),
-        m_modified(false),
-        m_view(NULL),
-        m_activePoint(-1)
+    QGraphicsPathItem(parent),
+    m_dar(dar),
+    m_modified(false),
+    m_view(NULL),
+    m_activePoint(-1)
 {
     setFlags(QGraphicsItem::ItemIsMovable);
 
@@ -52,9 +52,9 @@ void OnMonitorPathItem::setPoints(Mlt::Geometry *geometry)
     int pos = 0;
     Mlt::GeometryItem item;
     while (!geometry->next_key(&item, pos)) {
-       r = QRectF(item.x(), item.y(), item.w(), item.h());
-       m_points << r.center();
-       pos = item.frame() + 1;
+        r = QRectF(item.x(), item.y(), item.w(), item.h());
+        m_points << r.center();
+        pos = item.frame() + 1;
     }
     rebuildShape();
 }
@@ -66,16 +66,16 @@ void OnMonitorPathItem::rebuildShape()
     QPainterPath shape;
 
     if (!m_points.isEmpty()) {
-       QRectF r(0, 0, 20, 20);
-       r.moveCenter(m_points.at(0));
-       shape.addRect(r);
-       
-       p.moveTo(m_points.at(0));
-       for (int i = 1; i < m_points.count(); ++i) {
-           p.lineTo(m_points.at(i));
-           r.moveCenter(m_points.at(i));
-           shape.addRect(r);
-       }
+        QRectF r(0, 0, 20, 20);
+        r.moveCenter(m_points.at(0));
+        shape.addRect(r);
+
+        p.moveTo(m_points.at(0));
+        for (int i = 1; i < m_points.count(); ++i) {
+            p.lineTo(m_points.at(i));
+            r.moveCenter(m_points.at(i));
+            shape.addRect(r);
+        }
     }
     prepareGeometryChange();
     m_shape = shape;
@@ -90,10 +90,10 @@ void OnMonitorPathItem::getMode(const QPointF &pos)
     }
     // Item mapped coordinates
     for (int i = 0; i < m_points.count(); ++i) {
-       if ((pos - m_points.at(i)).manhattanLength() <= dist) {
-           m_activePoint = i;
-           return;
-       }
+        if ((pos - m_points.at(i)).manhattanLength() <= dist) {
+            m_activePoint = i;
+            return;
+        }
     }
     m_activePoint = -1;
 }
@@ -106,11 +106,11 @@ void OnMonitorPathItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
     }*/
 
     if (m_activePoint >= 0 && event->buttons() & Qt::LeftButton) {
-       QPointF mousePos = event->pos();
-       m_points[m_activePoint] = mousePos;
-       rebuildShape();
-       m_modified = true;
-       update();
+        QPointF mousePos = event->pos();
+        m_points[m_activePoint] = mousePos;
+        rebuildShape();
+        m_modified = true;
+        update();
     }
 
     if (m_modified) {
@@ -151,8 +151,8 @@ QPainterPath OnMonitorPathItem::shape () const
 void OnMonitorPathItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* /*event*/)
 {
     if (m_activePoint != -1) {
-       m_activePoint = -1;
-       update();
+        m_activePoint = -1;
+        update();
     }
     unsetCursor();
 }
@@ -179,12 +179,12 @@ void OnMonitorPathItem::paint(QPainter* painter, const QStyleOptionGraphicsItem*
     double h = 6;
     if (getView()) {
         w /= m_view->matrix().m11();
-       h /= m_view->matrix().m22();
+        h /= m_view->matrix().m22();
     }
 
     QRectF handle(0, 0, w, h);
     for (int i = 0; i < m_points.count(); ++i) {
-       handle.moveCenter(m_points.at(i));
+        handle.moveCenter(m_points.at(i));
         painter->fillRect(handle, m_activePoint == i ? Qt::blue : pen().color());
     }
 }
index 44e6f4217e1ce3347bdea5d12061d595f6728226..810fb932e40d5bc9a06792e3e7dbfe83e2a435e0 100644 (file)
 #include <QGraphicsView>
 
 OnMonitorRectItem::OnMonitorRectItem(const QRectF &rect, double dar, QGraphicsItem* parent) :
-        QGraphicsRectItem(rect, parent)
-        , m_dar(dar)
-       , m_mode(NoAction)
-        , m_modified(false)
-        , m_view(NULL)
+    QGraphicsRectItem(rect, parent)
+  , m_dar(dar)
+  , m_mode(NoAction)
+  , m_modified(false)
+  , m_view(NULL)
 {
     setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
 
@@ -61,7 +61,7 @@ rectActions OnMonitorRectItem::getMode(const QPointF &pos)
     qreal ysize = 12;
     if (getView()) {
         xsize /= m_view->matrix().m11();
-       ysize /= m_view->matrix().m22();
+        ysize /= m_view->matrix().m22();
     }
     mouseArea.addRect(pos.x() - xsize / 2, pos.y() - ysize / 2, xsize, ysize);
 
@@ -176,7 +176,7 @@ void OnMonitorRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
 
         // Keep aspect ratio
         if (event->modifiers() == Qt::ControlModifier) {
-            // compare to rect during mouse press: 
+            // compare to rect during mouse press:
             // if we subtract rect() we'll get a whole lot of flickering
             // because of diffWidth > diffHeight changing all the time
             int diffWidth = qAbs(r.width() - m_oldRect.width());
@@ -270,13 +270,13 @@ void OnMonitorRectItem::paint(QPainter* painter, const QStyleOptionGraphicsItem*
     painter->drawRect(r);
     QRectF handle = painter->worldTransform().inverted().mapRect(QRectF(0, 0, 6, 6));
     if (isEnabled()) {
-       handle.moveTopLeft(r.topLeft());
+        handle.moveTopLeft(r.topLeft());
         painter->fillRect(handle, QColor(Qt::yellow));
-       handle.moveTopRight(r.topRight());
+        handle.moveTopRight(r.topRight());
         painter->fillRect(handle, QColor(Qt::yellow));
-       handle.moveBottomLeft(r.bottomLeft());
+        handle.moveBottomLeft(r.bottomLeft());
         painter->fillRect(handle, QColor(Qt::yellow));
-       handle.moveBottomRight(r.bottomRight());
+        handle.moveBottomRight(r.bottomRight());
         painter->fillRect(handle, QColor(Qt::yellow));
     }
     
index a91cc22815029708d27603bc4ef6f039f5b3fe96..8024cffd03efcdd07dbfbbba2dd516f0681364e2 100644 (file)
@@ -40,7 +40,7 @@ BPointItem::BPointItem(const BPoint &point, QGraphicsItem* parent) :
     m_point.h2 = mapFromScene(point.h2);
     m_point.handlesLinked = false;
 
-    m_view = scene()->views()[0];
+    m_view = scene()->views().first();
 }
 
 BPoint BPointItem::getPoint() const
index f639704ecf525e1e255adb444f323dbc3010f8eb..0e7e60ba8c77eff6bb5228a62e7700b1d4a0b2c1 100644 (file)
@@ -175,7 +175,7 @@ QImage Waveform::renderGfxScope(uint accelFactor, const QImage &qimage)
     QTime start = QTime::currentTime();
     start.start();
 
-    int paintmode = ui->paintMode->itemData(ui->paintMode->currentIndex()).toInt();
+    const int paintmode = ui->paintMode->itemData(ui->paintMode->currentIndex()).toInt();
     WaveformGenerator::Rec rec = m_aRec601->isChecked() ? WaveformGenerator::Rec_601 : WaveformGenerator::Rec_709;
     QImage wave = m_waveformGenerator->calculateWaveform(scopeRect().size() - m_textWidth - QSize(0,m_paddingBottom), qimage,
                                                          (WaveformGenerator::PaintMode) paintmode, true, rec, accelFactor);
index 6235ac91485874d904866f5c2f2298f3028645e0..ccf55383ccf6289f05e6b320e90fd04aa7d87594 100644 (file)
@@ -347,7 +347,8 @@ StopmotionWidget::~StopmotionWidget()
 
 void StopmotionWidget::slotUpdateOverlayEffect(QAction* act)
 {
-    if (act) m_effectIndex = act->data().toInt();
+    if (act)
+        m_effectIndex = act->data().toInt();
     KdenliveSettings::setStopmotioneffect(m_effectIndex);
     slotUpdateOverlay();
 }
@@ -552,7 +553,7 @@ void StopmotionWidget::slotShowOverlay(bool isOn)
 
 void StopmotionWidget::reloadOverlay()
 {
-    QString path = getPathForFrame(m_sequenceFrame - 1);
+    const QString path = getPathForFrame(m_sequenceFrame - 1);
     if (!QFile::exists(path)) {
         log_box->insertItem(-1, i18n("No previous frame found"));
         log_box->setCurrentIndex(0);
@@ -651,10 +652,12 @@ void StopmotionWidget::slotCaptureFrame()
     m_sequenceFrame++;
     button_addsequence->setEnabled(true);
     if (capture_interval->isChecked()) {
-        if (KdenliveSettings::sm_prenotify()) QTimer::singleShot((KdenliveSettings::captureinterval() - KdenliveSettings::sm_notifytime()) * 1000, this, SLOT(slotPreNotify()));
+        if (KdenliveSettings::sm_prenotify())
+            QTimer::singleShot((KdenliveSettings::captureinterval() - KdenliveSettings::sm_notifytime()) * 1000, this, SLOT(slotPreNotify()));
         m_intervalTimer.start();
     }
-    else m_captureAction->setChecked(false);
+    else
+        m_captureAction->setChecked(false);
 }
 
 void StopmotionWidget::slotPreNotify()
@@ -674,7 +677,8 @@ void StopmotionWidget::slotNewThumb(const QString &path)
 
 void StopmotionWidget::slotPrepareThumbs()
 {
-    if (m_filesList.isEmpty()) return;
+    if (m_filesList.isEmpty())
+        return;
     QString path = m_filesList.takeFirst();
     emit doCreateThumbs(QImage(path), SlideshowClip::getFrameNumberFromPath(path));