]> git.sesse.net Git - kdenlive/commitdiff
Fix indent, minor optimization. Const'ref etc.
authorMontel Laurent <montel@kde.org>
Thu, 23 May 2013 17:25:27 +0000 (19:25 +0200)
committerMontel Laurent <montel@kde.org>
Thu, 23 May 2013 17:25:27 +0000 (19:25 +0200)
20 files changed:
src/dvdwizardmenu.cpp
src/dvdwizardmenu.h
src/dvdwizardvob.cpp
src/dvdwizardvob.h
src/effectslistview.h
src/effectslistwidget.cpp
src/effectslistwidget.h
src/effectstackedit.h
src/encodingprofilesdialog.cpp
src/geometryval.cpp
src/geometryval.h
src/geometrywidget.cpp
src/geometrywidget.h
src/graphicsscenerectmove.cpp
src/graphicsscenerectmove.h
src/initeffects.cpp
src/initeffects.h
src/jogshuttleconfig.cpp
src/kdenlivedoc.cpp
src/kdenlivedoc.h

index 82e16c87817e72e64e3f1c5ae5403257e097ab33..569a062bbc615ace6a4b9f8d6b6c98ec522e909b 100644 (file)
 enum { DvdButtonItem = QGraphicsItem::UserType + 1, DvdButtonUnderlineItem = QGraphicsItem::UserType + 2 };
 
 DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) :
-        QWizardPage(parent),
-        m_color(NULL),
-        m_safeRect(NULL),
-        m_finalSize(720, 576),
-        m_movieLength(-1)
+    QWizardPage(parent),
+    m_color(NULL),
+    m_safeRect(NULL),
+    m_finalSize(720, 576),
+    m_movieLength(-1)
 {
     m_view.setupUi(this);
     m_view.play_text->setText(i18n("Play"));
@@ -89,10 +89,10 @@ DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) :
     //font.setStyleStrategy(QFont::NoAntialias);
 #if KDE_IS_VERSION(4,6,0)
     if (m_view.use_shadow->isChecked()) {
-       QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
-       shadow->setBlurRadius(7);
-       shadow->setOffset(4, 4);
-       button->setGraphicsEffect(shadow);
+        QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+        shadow->setBlurRadius(7);
+        shadow->setOffset(4, 4);
+        button->setGraphicsEffect(shadow);
     }
     connect(m_view.use_shadow, SIGNAL(stateChanged(int)), this, SLOT(slotEnableShadows(int)));
 #elif KDE_IS_VERSION(4,6,0)
@@ -161,11 +161,11 @@ void DvdWizardMenu::slotEnableShadows(int enable)
     for (int i = 0; i < list.count(); ++i) {
         if (list.at(i)->type() == DvdButtonItem) {
             if (enable) {
-               QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
-               shadow->setBlurRadius(7);
-               shadow->setOffset(4, 4);
-               list.at(i)->setGraphicsEffect(shadow);
-           }
+                QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+                shadow->setBlurRadius(7);
+                shadow->setOffset(4, 4);
+                list.at(i)->setGraphicsEffect(shadow);
+            }
             else list.at(i)->setGraphicsEffect(NULL);
         }
     }
@@ -190,9 +190,9 @@ bool DvdWizardMenu::isComplete() const
                 for (int j = 0; j < collisions.count(); j++) {
                     if (collisions.at(j)->type() == button->type()) {
 #if KDE_IS_VERSION(4,7,0)
-                       m_menuMessage->setText(i18n("Buttons overlapping"));
-                       m_menuMessage->setMessageType(KMessageWidget::Warning);
-                       m_menuMessage->show();
+                        m_menuMessage->setText(i18n("Buttons overlapping"));
+                        m_menuMessage->setMessageType(KMessageWidget::Warning);
+                        m_menuMessage->show();
 #else
                         m_view.error_message->setText(i18n("Buttons overlapping"));
                         m_view.error_message->setHidden(false);
@@ -321,10 +321,10 @@ void DvdWizardMenu::addButton()
     font.setPixelSize(m_view.font_size->value());
 #if KDE_IS_VERSION(4,6,0)
     if (m_view.use_shadow->isChecked()) {
-       QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
-       shadow->setBlurRadius(7);
-       shadow->setOffset(4, 4);
-       button->setGraphicsEffect(shadow);
+        QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+        shadow->setBlurRadius(7);
+        shadow->setOffset(4, 4);
+        button->setGraphicsEffect(shadow);
     }
 #endif
     //font.setStyleStrategy(QFont::NoAntialias);
@@ -352,25 +352,25 @@ void DvdWizardMenu::changeProfile(DVDFORMAT format)
 {
     m_format = format;
     switch (m_format) {
-       case PAL_WIDE:
-           m_finalSize = QSize(720, 576);
-           m_width = 1024;
-           m_height = 576;
-           break;
-       case NTSC_WIDE:
-           m_finalSize = QSize(720, 480);
-           m_width = 853;
-           m_height = 480;
-           break;
-       case NTSC:
-           m_finalSize = QSize(720, 480);
-           m_width = 640;
-           m_height = 480;
-           break;
-       default:
-           m_finalSize = QSize(720, 576);
-           m_width = 768;
-           m_height = 576;
+    case PAL_WIDE:
+        m_finalSize = QSize(720, 576);
+        m_width = 1024;
+        m_height = 576;
+        break;
+    case NTSC_WIDE:
+        m_finalSize = QSize(720, 480);
+        m_width = 853;
+        m_height = 480;
+        break;
+    case NTSC:
+        m_finalSize = QSize(720, 480);
+        m_width = 640;
+        m_height = 480;
+        break;
+    default:
+        m_finalSize = QSize(720, 576);
+        m_width = 768;
+        m_height = 576;
     }
     updatePreview();
 }
@@ -390,7 +390,7 @@ void DvdWizardMenu::updatePreview()
     if (m_safeRect) m_safeRect->setRect(safeW, safeH, m_width - 2 * safeW, m_height - 2 * safeH);
 }
 
-void DvdWizardMenu::setTargets(QStringList list, QStringList targetlist)
+void DvdWizardMenu::setTargets(const QStringList &list, const QStringList &targetlist)
 {
     m_view.target_list->clear();
     m_view.target_list->addItem(i18n("Play All"), "jump title 1");
@@ -455,15 +455,15 @@ void DvdWizardMenu::buildImage()
     } else if (m_view.background_list->currentIndex() == 2) {
         // video background
         m_movieLength = -1;
-       QString profileName = DvdWizardVob::getDvdProfile(m_format);
-       Mlt::Profile profile(profileName.toUtf8().constData());
-       profile.set_explicit(true);
-       Mlt::Producer *producer = new Mlt::Producer(profile, m_view.background_image->url().path().toUtf8().constData());
-       if (producer && producer->is_valid()) {
-           pix = QPixmap::fromImage(KThumb::getFrame(producer, 0, m_finalSize.width(), m_width, m_height));
-           m_movieLength = producer->get_length();
-       }
-       if (producer) delete producer;
+        QString profileName = DvdWizardVob::getDvdProfile(m_format);
+        Mlt::Profile profile(profileName.toUtf8().constData());
+        profile.set_explicit(true);
+        Mlt::Producer *producer = new Mlt::Producer(profile, m_view.background_image->url().path().toUtf8().constData());
+        if (producer && producer->is_valid()) {
+            pix = QPixmap::fromImage(KThumb::getFrame(producer, 0, m_finalSize.width(), m_width, m_height));
+            m_movieLength = producer->get_length();
+        }
+        if (producer) delete producer;
     }
     m_background->setPixmap(pix);
     m_scene->addItem(m_background);
@@ -510,20 +510,20 @@ void DvdWizardMenu::prepareUnderLines()
     QList<QGraphicsItem *> list = m_scene->items();
     for (int i = 0; i < list.count(); ++i) {
         if (list.at(i)->type() == DvdButtonItem) {
-           QRectF r = list.at(i)->sceneBoundingRect();
-           int bottom = r.bottom() - 1;
-           if (bottom % 2 == 1) bottom = bottom - 1;
-           int underlineHeight = r.height() / 10;
-           if (underlineHeight % 2 == 1) underlineHeight = underlineHeight - 1;
-           underlineHeight = qMin(underlineHeight, 10);
-           underlineHeight = qMax(underlineHeight, 2);
-           r.setTop(bottom - underlineHeight);
-           r.setBottom(bottom);
-           r.adjust(2, 0, -2, 0);
-           DvdButtonUnderline *underline = new DvdButtonUnderline(r);
-           m_scene->addItem(underline);
-           list.at(i)->setVisible(false);
-       }
+            QRectF r = list.at(i)->sceneBoundingRect();
+            int bottom = r.bottom() - 1;
+            if (bottom % 2 == 1) bottom = bottom - 1;
+            int underlineHeight = r.height() / 10;
+            if (underlineHeight % 2 == 1) underlineHeight = underlineHeight - 1;
+            underlineHeight = qMin(underlineHeight, 10);
+            underlineHeight = qMax(underlineHeight, 2);
+            r.setTop(bottom - underlineHeight);
+            r.setBottom(bottom);
+            r.adjust(2, 0, -2, 0);
+            DvdButtonUnderline *underline = new DvdButtonUnderline(r);
+            m_scene->addItem(underline);
+            list.at(i)->setVisible(false);
+        }
     }
 }
 
@@ -532,16 +532,16 @@ void DvdWizardMenu::resetUnderLines()
     QList<QGraphicsItem *> list = m_scene->items();
     QList<QGraphicsItem *> toDelete;
     for (int i = 0; i < list.count(); ++i) {
-       if (list.at(i)->type() == DvdButtonUnderlineItem) {
-           toDelete.append(list.at(i));
-       }
+        if (list.at(i)->type() == DvdButtonUnderlineItem) {
+            toDelete.append(list.at(i));
+        }
         if (list.at(i)->type() == DvdButtonItem) {
-           list.at(i)->setVisible(true);
-       }
+            list.at(i)->setVisible(true);
+        }
     }
     while (!toDelete.isEmpty()) {
-       QGraphicsItem *item = toDelete.takeFirst();
-       delete item;
+        QGraphicsItem *item = toDelete.takeFirst();
+        delete item;
     }
 }
 
@@ -551,15 +551,15 @@ void DvdWizardMenu::updateUnderlineColor(QColor c)
     for (int i = 0; i < list.count(); ++i) {
         if (list.at(i)->type() == DvdButtonUnderlineItem) {
             DvdButtonUnderline *underline = static_cast < DvdButtonUnderline* >(list.at(i));
-           underline->setPen(Qt::NoPen);
-           c.setAlpha(150);
-           underline->setBrush(c);
+            underline->setPen(Qt::NoPen);
+            c.setAlpha(150);
+            underline->setBrush(c);
         }
     }
 }
 
 
-void DvdWizardMenu::updateColor(QColor c)
+void DvdWizardMenu::updateColor(const QColor &c)
 {
     DvdButton *button = NULL;
     QList<QGraphicsItem *> list = m_scene->items();
@@ -576,33 +576,33 @@ void DvdWizardMenu::createButtonImages(const QString &selected_image, const QStr
 {
     if (m_view.create_menu->isChecked()) {
         m_scene->clearSelection();
-       QRectF source(0, 0, m_width, m_height);
-       QRectF target;
-       if (!letterbox) target = QRectF(0, 0, m_finalSize.width(), m_finalSize.height());
-       else {
-           // Scale the button images to fit a letterbox image
-           double factor = (double) m_width / m_finalSize.width();
-           int letterboxHeight = m_height / factor;
-           target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
-       }
+        QRectF source(0, 0, m_width, m_height);
+        QRectF target;
+        if (!letterbox) target = QRectF(0, 0, m_finalSize.width(), m_finalSize.height());
+        else {
+            // Scale the button images to fit a letterbox image
+            double factor = (double) m_width / m_finalSize.width();
+            int letterboxHeight = m_height / factor;
+            target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
+        }
         if (m_safeRect->scene() != 0) m_scene->removeItem(m_safeRect);
         if (m_color->scene() != 0) m_scene->removeItem(m_color);
         if (m_background->scene() != 0) m_scene->removeItem(m_background);
-       prepareUnderLines();
+        prepareUnderLines();
 #if QT_VERSION >= 0x040800
         QImage img(m_finalSize.width(), m_finalSize.height(), QImage::Format_ARGB32);
         img.fill(Qt::transparent);
-       updateUnderlineColor(m_view.highlighted_color->color());
+        updateUnderlineColor(m_view.highlighted_color->color());
 #else
-       QImage img(m_finalSize.width(), m_finalSize.height(), QImage::Format_Mono);
+        QImage img(m_finalSize.width(), m_finalSize.height(), QImage::Format_Mono);
         img.fill(Qt::white);
-       updateUnderlineColor(Qt::black);
+        updateUnderlineColor(Qt::black);
 #endif
-       QPainter p;
+        QPainter p;
         p.begin(&img);
         //p.setRenderHints(QPainter::Antialiasing, false);
         //p.setRenderHints(QPainter::TextAntialiasing, false);
-       m_scene->render(&p, target, source, Qt::IgnoreAspectRatio);
+        m_scene->render(&p, target, source, Qt::IgnoreAspectRatio);
         p.end();
 #if QT_VERSION >= 0x040800
 #elif QT_VERSION >= 0x040600
@@ -615,11 +615,11 @@ void DvdWizardMenu::createButtonImages(const QString &selected_image, const QStr
 
 #if QT_VERSION >= 0x040800
         img.fill(Qt::transparent);
-       updateUnderlineColor(m_view.selected_color->color());
+        updateUnderlineColor(m_view.selected_color->color());
 #else
         img.fill(Qt::white);
 #endif
-       p.begin(&img);
+        p.begin(&img);
         //p.setRenderHints(QPainter::Antialiasing, false);
         //p.setRenderHints(QPainter::TextAntialiasing, false);
         m_scene->render(&p, target, source, Qt::IgnoreAspectRatio);
@@ -653,17 +653,17 @@ void DvdWizardMenu::createBackgroundImage(const QString &img1, bool letterbox)
     QRectF target;
     if (!letterbox) target = QRectF(0, 0, m_finalSize.width(), m_finalSize.height());
     else {
-       // Scale the button images to fit a letterbox image
-       double factor = (double) m_width / m_finalSize.width();
-       int letterboxHeight = m_height / factor;
-       target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
+    // Scale the button images to fit a letterbox image
+    double factor = (double) m_width / m_finalSize.width();
+    int letterboxHeight = m_height / factor;
+    target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
     }*/
-       
+
     if (menuMovie()) {
-       showBg = true;
-       if (m_background->scene() != 0) m_scene->removeItem(m_background);
-       if (m_color->scene() != 0) m_scene->removeItem(m_color);
-       img.fill(Qt::transparent);
+        showBg = true;
+        if (m_background->scene() != 0) m_scene->removeItem(m_background);
+        if (m_color->scene() != 0) m_scene->removeItem(m_color);
+        img.fill(Qt::transparent);
     }
     updateColor(m_view.text_color->color());
     QPainter p(&img);
@@ -675,8 +675,8 @@ void DvdWizardMenu::createBackgroundImage(const QString &img1, bool letterbox)
     img.save(img1);
     m_scene->addItem(m_safeRect);
     if (showBg) {
-       m_scene->addItem(m_background);
-       m_scene->addItem(m_color);
+        m_scene->addItem(m_background);
+        m_scene->addItem(m_color);
     }
 }
 
@@ -702,7 +702,7 @@ QString DvdWizardMenu::menuMoviePath() const
 
 int DvdWizardMenu::menuMovieLength() const
 {
-  return m_movieLength;
+    return m_movieLength;
 }
 
 
@@ -714,16 +714,16 @@ QMap <QString, QRect> DvdWizardMenu::buttonsInfo(bool letterbox)
     double ratioy = 1;
     int offset = 0;
     if (letterbox) {
-       int letterboxHeight = m_height * ratiox;
-       ratioy = (double) letterboxHeight / m_finalSize.height();
-       offset = (m_finalSize.height() - letterboxHeight) / 2;
+        int letterboxHeight = m_height * ratiox;
+        ratioy = (double) letterboxHeight / m_finalSize.height();
+        offset = (m_finalSize.height() - letterboxHeight) / 2;
     }
     for (int i = 0; i < list.count(); ++i) {
         if (list.at(i)->type() == DvdButtonItem) {
             DvdButton *button = static_cast < DvdButton* >(list.at(i));
-           QRectF r = button->sceneBoundingRect();
-           QRect adjustedRect(r.x() * ratiox, offset + r.y() * ratioy, r.width() * ratiox, r.height() * ratioy);
-           // Make sure y1 is not odd (requested by spumux)
+            QRectF r = button->sceneBoundingRect();
+            QRect adjustedRect(r.x() * ratiox, offset + r.y() * ratioy, r.width() * ratiox, r.height() * ratioy);
+            // Make sure y1 is not odd (requested by spumux)
             if (adjustedRect.height() % 2 == 1) adjustedRect.setHeight(adjustedRect.height() + 1);
             if (adjustedRect.y() % 2 == 1) adjustedRect.setY(adjustedRect.y() - 1);
             QString command = button->command();
@@ -825,12 +825,12 @@ void DvdWizardMenu::loadXml(DVDFORMAT format, const QDomElement &xml)
         QFont font(e.attribute("font_family"));
         font.setPixelSize(e.attribute("font_size").toInt());
 #if KDE_IS_VERSION(4,6,0)
-       if (m_view.use_shadow->isChecked()) {
-           QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
-           shadow->setBlurRadius(7);
-           shadow->setOffset(4, 4);
-           button->setGraphicsEffect(shadow);
-       }
+        if (m_view.use_shadow->isChecked()) {
+            QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+            shadow->setBlurRadius(7);
+            shadow->setOffset(4, 4);
+            button->setGraphicsEffect(shadow);
+        }
 #endif
 
         //font.setStyleStrategy(QFont::NoAntialias);
index 8a74612cc06fb6098bd94a7bbd0b8c9f93832003..c0edadb5f0afa55f7f2f1d82483f06c214283595 100644 (file)
@@ -40,7 +40,7 @@
 
 class DvdScene : public QGraphicsScene
 {
-Q_OBJECT
+    Q_OBJECT
 public:
     DvdScene(QObject * parent = 0): QGraphicsScene(parent) {
         m_width = 0; m_height = 0;
@@ -62,8 +62,8 @@ private:
     
 protected:
     void mouseReleaseEvent( QGraphicsSceneMouseEvent * mouseEvent ) {
-       QGraphicsScene::mouseReleaseEvent(mouseEvent);
-       emit sceneChanged();
+        QGraphicsScene::mouseReleaseEvent(mouseEvent);
+        emit sceneChanged();
     }
 signals:
     void sceneChanged();
@@ -91,7 +91,7 @@ public:
         setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
 #endif
     }
-    void setTarget(int t, QString c) {
+    void setTarget(int t, const QString &c) {
         m_target = t;
         m_command = c;
     }
@@ -156,7 +156,7 @@ public:
     bool createMenu() const;
     void createBackgroundImage(const QString &img1, bool letterbox);
     void createButtonImages(const QString &selected_image, const QString &highlighted_image, bool letterbox);
-    void setTargets(QStringList list, QStringList targetlist);
+    void setTargets(const QStringList &list, const QStringList &targetlist);
     QMap <QString, QRect> buttonsInfo(bool letterbox = false);
     bool loopMovie() const;
     bool menuMovie() const;
@@ -195,7 +195,7 @@ private slots:
     void setButtonTarget(int ix);
     void deleteButton();
     void updateColor();
-    void updateColor(QColor c);
+    void updateColor(const QColor &c);
     void updateUnderlineColor(QColor c);
     void setBackToMenu(bool backToMenu);
     void slotZoom();
index 0f8c172560adeac166350ec34f49aa95224926a9..6bc64d2b6d7426238db5255d59f08941d1ac7aa3 100644 (file)
 #include <unistd.h>
 
 DvdTreeWidget::DvdTreeWidget(QWidget *parent) :
-        QTreeWidget(parent)
+    QTreeWidget(parent)
 {
     setAcceptDrops(true);
 }
 
 void DvdTreeWidget::dragEnterEvent(QDragEnterEvent * event ) {
     if (event->mimeData()->hasUrls()) {
-       event->setDropAction(Qt::CopyAction);
-       event->setAccepted(true);
+        event->setDropAction(Qt::CopyAction);
+        event->setAccepted(true);
     }
     else QTreeWidget::dragEnterEvent(event);
 }
 
 void DvdTreeWidget::dragMoveEvent(QDragMoveEvent * event) {
-       event->acceptProposedAction();
+    event->acceptProposedAction();
 }
 
 void DvdTreeWidget::mouseDoubleClickEvent( QMouseEvent * )
@@ -66,8 +66,8 @@ void DvdTreeWidget::dropEvent(QDropEvent * event ) {
 }
 
 DvdWizardVob::DvdWizardVob(QWidget *parent) :
-        QWizardPage(parent),
-        m_installCheck(true)
+    QWizardPage(parent),
+    m_installCheck(true)
 {
     m_view.setupUi(this);
     m_view.button_add->setIcon(KIcon("list-add"));
@@ -95,8 +95,8 @@ DvdWizardVob::DvdWizardVob(QWidget *parent) :
     if (KStandardDirs::findExe("dvdauthor").isEmpty()) errorMessage.append(i18n("<strong>Program %1 is required for the DVD wizard.</strong>", i18n("dvdauthor")));
     if (KStandardDirs::findExe("mkisofs").isEmpty() && KStandardDirs::findExe("genisoimage").isEmpty()) errorMessage.append(i18n("<strong>Program %1 or %2 is required for the DVD wizard.</strong>", i18n("mkisofs"), i18n("genisoimage")));
     if (!errorMessage.isEmpty()) {
-       m_view.button_add->setEnabled(false);
-       m_view.dvd_profile->setEnabled(false);
+        m_view.button_add->setEnabled(false);
+        m_view.dvd_profile->setEnabled(false);
     }
 
     m_view.dvd_profile->addItems(QStringList() << i18n("PAL 4:3") << i18n("PAL 16:9") << i18n("NTSC 4:3") << i18n("NTSC 16:9"));
@@ -122,22 +122,22 @@ DvdWizardVob::DvdWizardVob(QWidget *parent) :
     QGridLayout *s =  static_cast <QGridLayout*> (layout());
     s->addWidget(m_warnMessage, 2, 0, 1, -1);
     if (!errorMessage.isEmpty()) {
-       m_warnMessage->setMessageType(KMessageWidget::Error);
-       m_warnMessage->setText(errorMessage);
-       m_installCheck = false;
+        m_warnMessage->setMessageType(KMessageWidget::Error);
+        m_warnMessage->setText(errorMessage);
+        m_installCheck = false;
     }else {
-       m_warnMessage->setMessageType(KMessageWidget::Warning);
-       m_warnMessage->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
-       m_warnMessage->addAction(m_transcodeAction);
-       m_warnMessage->hide();
+        m_warnMessage->setMessageType(KMessageWidget::Warning);
+        m_warnMessage->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
+        m_warnMessage->addAction(m_transcodeAction);
+        m_warnMessage->hide();
     }
     m_view.button_transcode->setHidden(true);
 #else
     m_view.button_transcode->setDefaultAction(m_transcodeAction);
     m_view.button_transcode->setEnabled(false);
     if (!errorMessage.isEmpty()) {
-       m_view.error_message->setText(errorMessage);
-       m_installCheck = false;
+        m_view.error_message->setText(errorMessage);
+        m_installCheck = false;
     }
 #endif
     
@@ -156,27 +156,27 @@ void DvdWizardVob::slotCheckProfiles()
     for (int i = 0; i < m_vobList->topLevelItemCount(); ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
         if (item->data(0, Qt::UserRole + 1).toInt() != comboProfile) {
-           conflict = true;
-           break;
-       }
+            conflict = true;
+            break;
+        }
     }
     m_transcodeAction->setEnabled(conflict);
     if (conflict) {
-       showProfileError();
+        showProfileError();
     }
     else {
 #if KDE_IS_VERSION(4,7,0)      
-       m_warnMessage->animatedHide();
+        m_warnMessage->animatedHide();
 #else
-       if (m_installCheck) m_view.error_message->setVisible(false);
+        if (m_installCheck) m_view.error_message->setVisible(false);
 #endif
     }
 }
 
-void DvdWizardVob::slotAddVobList(QList <QUrl>list)
+void DvdWizardVob::slotAddVobList(const QList<QUrl> &list)
 {
-    foreach (const QUrl url, list) {
-       slotAddVobFile(KUrl(url), QString(), false);
+    foreach (const QUrl &url, list) {
+        slotAddVobFile(KUrl(url), QString(), false);
     }
     slotCheckVobList();
     slotCheckProfiles();
@@ -200,60 +200,60 @@ void DvdWizardVob::slotAddVobFile(KUrl url, const QString &chapters, bool checkF
     resource.prepend("avformat:");
     Mlt::Producer *producer = new Mlt::Producer(profile, resource.toUtf8().data());
     if (producer && producer->is_valid() && !producer->is_blank()) {
-       //Mlt::Frame *frame = producer->get_frame();
-       //delete frame;
-       profile.from_producer(*producer);
+        //Mlt::Frame *frame = producer->get_frame();
+        //delete frame;
+        profile.from_producer(*producer);
         int width = 45.0 * profile.dar();
         int swidth = 45.0 * profile.width() / profile.height();
         if (width % 2 == 1) width++;
-       item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
+        item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
         int playTime = producer->get_playtime();
         item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
         item->setData(1, Qt::UserRole, playTime);
-       int standard = -1;
-       int aspect = profile.dar() * 100;
-       if (profile.height() == 576 && profile.fps() == 25.0) {
-           if (aspect > 150) standard = 1;
-           else standard = 0;
-       }
-       else if (profile.height() == 480 && qAbs(profile.fps() - 30000.0 / 1001) < 0.2) {
-           if (aspect > 150) standard = 3;
-           else standard = 2;
-       }
-       QString standardName;
-       switch (standard) {
-         case 3:
-             standardName = i18n("NTSC 16:9");
-             break;
-         case 2:
-             standardName = i18n("NTSC 4:3");
-             break;
-         case 1:
-             standardName = i18n("PAL 16:9");
-             break;
-         case 0:
-             standardName = i18n("PAL 4:3");
-             break;
-         default:
-             standardName = i18n("Unknown");
-       }
-       standardName.append(QString(" | %1x%2, %3fps").arg(profile.width()).arg(profile.height()).arg(profile.fps()));
-       item->setData(0, Qt::UserRole, standardName);
-       item->setData(0, Qt::UserRole + 1, standard);
-       item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
-       if (m_vobList->topLevelItemCount() == 1) {
-           // This is the first added movie, auto select DVD format
-           if (standard >= 0) {
-               m_view.dvd_profile->blockSignals(true);
-               m_view.dvd_profile->setCurrentIndex(standard);
-               m_view.dvd_profile->blockSignals(false);
-           }
-       }
-       
+        int standard = -1;
+        int aspect = profile.dar() * 100;
+        if (profile.height() == 576 && profile.fps() == 25.0) {
+            if (aspect > 150) standard = 1;
+            else standard = 0;
+        }
+        else if (profile.height() == 480 && qAbs(profile.fps() - 30000.0 / 1001) < 0.2) {
+            if (aspect > 150) standard = 3;
+            else standard = 2;
+        }
+        QString standardName;
+        switch (standard) {
+        case 3:
+            standardName = i18n("NTSC 16:9");
+            break;
+        case 2:
+            standardName = i18n("NTSC 4:3");
+            break;
+        case 1:
+            standardName = i18n("PAL 16:9");
+            break;
+        case 0:
+            standardName = i18n("PAL 4:3");
+            break;
+        default:
+            standardName = i18n("Unknown");
+        }
+        standardName.append(QString(" | %1x%2, %3fps").arg(profile.width()).arg(profile.height()).arg(profile.fps()));
+        item->setData(0, Qt::UserRole, standardName);
+        item->setData(0, Qt::UserRole + 1, standard);
+        item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
+        if (m_vobList->topLevelItemCount() == 1) {
+            // This is the first added movie, auto select DVD format
+            if (standard >= 0) {
+                m_view.dvd_profile->blockSignals(true);
+                m_view.dvd_profile->setCurrentIndex(standard);
+                m_view.dvd_profile->blockSignals(false);
+            }
+        }
+
     }
     else {
-       // Cannot load movie, reject
-       showError(i18n("The clip %1 is invalid.", url.fileName()));
+        // Cannot load movie, reject
+        showError(i18n("The clip %1 is invalid.", url.fileName()));
     }
     if (producer) delete producer;
 
@@ -281,8 +281,8 @@ void DvdWizardVob::slotAddVobFile(KUrl url, const QString &chapters, bool checkF
         item->setData(1, Qt::UserRole + 1, "0");
 
     if (checkFormats) {
-       slotCheckVobList();
-       slotCheckProfiles();
+        slotCheckVobList();
+        slotCheckProfiles();
     }
     emit prepareMonitor();
 }
@@ -317,8 +317,8 @@ QStringList DvdWizardVob::selectedUrls() const
     int max = m_vobList->topLevelItemCount();
     int i = 0;
     if (m_view.use_intro->isChecked()) {
-       // First movie is only for intro
-       i = 1;
+        // First movie is only for intro
+        i = 1;
     }
     for (; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
@@ -335,8 +335,8 @@ QStringList DvdWizardVob::durations() const
     int max = m_vobList->topLevelItemCount();
     int i = 0;
     if (m_view.use_intro->isChecked()) {
-       // First movie is only for intro
-       i = 1;
+        // First movie is only for intro
+        i = 1;
     }
     for (; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
@@ -352,8 +352,8 @@ QStringList DvdWizardVob::chapters() const
     int max = m_vobList->topLevelItemCount();
     int i = 0;
     if (m_view.use_intro->isChecked()) {
-       // First movie is only for intro
-       i = 1;
+        // First movie is only for intro
+        i = 1;
     }
     for (; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
@@ -369,8 +369,8 @@ void DvdWizardVob::updateChapters(QMap <QString, QString> chaptersdata)
     int max = m_vobList->topLevelItemCount();
     int i = 0;
     if (m_view.use_intro->isChecked()) {
-       // First movie is only for intro
-       i = 1;
+        // First movie is only for intro
+        i = 1;
     }
     for (; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
@@ -452,17 +452,17 @@ const QString DvdWizardVob::dvdProfile() const
 {
     QString profile;
     switch (m_view.dvd_profile->currentIndex()) {
-       case PAL_WIDE:
-           profile = "dv_pal_wide";
-           break;
-       case NTSC:
-           profile = "dv_ntsc";
-           break;
-       case NTSC_WIDE:
-           profile = "dv_ntsc_wide";
-           break;
-       default:
-           profile = "dv_pal";
+    case PAL_WIDE:
+        profile = "dv_pal_wide";
+        break;
+    case NTSC:
+        profile = "dv_ntsc";
+        break;
+    case NTSC_WIDE:
+        profile = "dv_ntsc_wide";
+        break;
+    default:
+        profile = "dv_pal";
     }
     return profile;
 }
@@ -472,17 +472,17 @@ QString DvdWizardVob::getDvdProfile(DVDFORMAT format)
 {
     QString profile;
     switch (format) {
-       case PAL_WIDE:
-           profile = "dv_pal_wide";
-           break;
-       case NTSC:
-           profile = "dv_ntsc";
-           break;
-       case NTSC_WIDE:
-           profile = "dv_ntsc_wide";
-           break;
-       default:
-           profile = "dv_pal";
+    case PAL_WIDE:
+        profile = "dv_pal_wide";
+        break;
+    case NTSC:
+        profile = "dv_ntsc";
+        break;
+    case NTSC_WIDE:
+        profile = "dv_ntsc_wide";
+        break;
+    default:
+        profile = "dv_pal";
     }
     return profile;
 }
@@ -510,137 +510,137 @@ void DvdWizardVob::slotTranscodeFiles()
     QSize destSize;
     QSize finalSize;
     switch (m_view.dvd_profile->currentIndex()) {
-       case PAL_WIDE:
-           profileEasyName = "DVD PAL 16:9";
-           destSize = QSize(1024, 576);
-           finalSize = QSize(720, 576);
-           break;
-       case NTSC:
-           profileEasyName = "DVD NTSC 4:3";
-           destSize = QSize(640, 480);
-           finalSize = QSize(720, 480);
-           break;
-       case NTSC_WIDE:
-           profileEasyName = "DVD NTSC 16:9";
-           destSize = QSize(853, 480);
-           finalSize = QSize(720, 480);
-           break;
-       default:
-           profileEasyName = "DVD PAL 4:3";
-           destSize = QSize(768, 576);
-           finalSize = QSize(720, 576);
+    case PAL_WIDE:
+        profileEasyName = "DVD PAL 16:9";
+        destSize = QSize(1024, 576);
+        finalSize = QSize(720, 576);
+        break;
+    case NTSC:
+        profileEasyName = "DVD NTSC 4:3";
+        destSize = QSize(640, 480);
+        finalSize = QSize(720, 480);
+        break;
+    case NTSC_WIDE:
+        profileEasyName = "DVD NTSC 16:9";
+        destSize = QSize(853, 480);
+        finalSize = QSize(720, 480);
+        break;
+    default:
+        profileEasyName = "DVD PAL 4:3";
+        destSize = QSize(768, 576);
+        finalSize = QSize(720, 576);
     }
-    QString params = transConfig.readEntry(profileEasyName);    
-  
+    QString params = transConfig.readEntry(profileEasyName);
+
     // Transcode files that do not match selected profile
     int max = m_vobList->topLevelItemCount();
     int format = m_view.dvd_profile->currentIndex();
     for (int i = 0; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
-       if (item->data(0, Qt::UserRole + 1).toInt() != format) {
-           // File needs to be transcoded
-           m_transcodeAction->setEnabled(false);
-           QSize original = item->data(0, Qt::UserRole + 2).toSize();
-           double input_aspect= (double) original.width() / original.height();
-           QStringList postParams;
-           if (input_aspect > (double) destSize.width() / destSize.height()) {
-               // letterboxing
-               int conv_height = (int) (destSize.width() / input_aspect);
-               int conv_pad = (int) (((double) (destSize.height() - conv_height)) / 2.0);
-               if (conv_pad %2 == 1) conv_pad --;
-               postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:0:%5,setdar=%6").arg(finalSize.width()).arg(destSize.height() - 2 * conv_pad).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
-           } else {
-               // pillarboxing
-               int conv_width = (int) (destSize.height() * input_aspect);
-               int conv_pad = (int) (((double) (destSize.width() - conv_width)) / destSize.width() * finalSize.width() / 2.0);
-               if (conv_pad %2 == 1) conv_pad --;
-               postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:%5:0,setdar=%6").arg(finalSize.width() - 2 * conv_pad).arg(destSize.height()).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
-           }
-           ClipTranscode *d = new ClipTranscode(KUrl::List () << KUrl(item->text(0)), params.section(';', 0, 0), postParams, i18n("Transcoding to DVD format"), true, this);
-           connect(d, SIGNAL(transcodedClip(KUrl,KUrl)), this, SLOT(slotTranscodedClip(KUrl,KUrl)));
-           d->slotStartTransCode();
-           d->show();
-           
-       }
+        if (item->data(0, Qt::UserRole + 1).toInt() != format) {
+            // File needs to be transcoded
+            m_transcodeAction->setEnabled(false);
+            QSize original = item->data(0, Qt::UserRole + 2).toSize();
+            double input_aspect= (double) original.width() / original.height();
+            QStringList postParams;
+            if (input_aspect > (double) destSize.width() / destSize.height()) {
+                // letterboxing
+                int conv_height = (int) (destSize.width() / input_aspect);
+                int conv_pad = (int) (((double) (destSize.height() - conv_height)) / 2.0);
+                if (conv_pad %2 == 1) conv_pad --;
+                postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:0:%5,setdar=%6").arg(finalSize.width()).arg(destSize.height() - 2 * conv_pad).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
+            } else {
+                // pillarboxing
+                int conv_width = (int) (destSize.height() * input_aspect);
+                int conv_pad = (int) (((double) (destSize.width() - conv_width)) / destSize.width() * finalSize.width() / 2.0);
+                if (conv_pad %2 == 1) conv_pad --;
+                postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:%5:0,setdar=%6").arg(finalSize.width() - 2 * conv_pad).arg(destSize.height()).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
+            }
+            ClipTranscode *d = new ClipTranscode(KUrl::List () << KUrl(item->text(0)), params.section(';', 0, 0), postParams, i18n("Transcoding to DVD format"), true, this);
+            connect(d, SIGNAL(transcodedClip(KUrl,KUrl)), this, SLOT(slotTranscodedClip(KUrl,KUrl)));
+            d->slotStartTransCode();
+            d->show();
+
+        }
     }
 }
 
 void DvdWizardVob::slotTranscodedClip(KUrl src, KUrl transcoded)
 {
     if (transcoded.isEmpty()) {
-       // Transcoding canceled or failed
-       m_transcodeAction->setEnabled(true);
-       return;
+        // Transcoding canceled or failed
+        m_transcodeAction->setEnabled(true);
+        return;
     }
     int max = m_vobList->topLevelItemCount();
     for (int i = 0; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
-       if (KUrl(item->text(0)).path() == src.path()) {
-           // Replace movie with transcoded version
-           item->setText(0, transcoded.path());
-
-           QFile f(transcoded.path());
-           qint64 fileSize = f.size();
-
-           Mlt::Profile profile;
-           profile.set_explicit(false);
-           item->setText(2, KIO::convertSize(fileSize));
-           item->setData(2, Qt::UserRole, fileSize);
-           item->setData(0, Qt::DecorationRole, KIcon("video-x-generic").pixmap(60, 45));
-           item->setToolTip(0, transcoded.path());
-
-           QString resource = transcoded.path();
-           resource.prepend("avformat:");
-           Mlt::Producer *producer = new Mlt::Producer(profile, resource.toUtf8().data());
-           if (producer && producer->is_valid() && !producer->is_blank()) {
-               profile.from_producer(*producer);
-               int width = 45.0 * profile.dar();
-               int swidth = 45.0 * profile.width() / profile.height();
-               if (width % 2 == 1) width++;
-               item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
-               int playTime = producer->get_playtime();
-               item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
-               item->setData(1, Qt::UserRole, playTime);
-               int standard = -1;
-               int aspect = profile.dar() * 100;
-               if (profile.height() == 576) {
-                   if (aspect > 150) standard = 1;
-                   else standard = 0;
-               }
-               else if (profile.height() == 480) {
-                   if (aspect > 150) standard = 3;
-                   else standard = 2;
-               }
-               QString standardName;
-               switch (standard) {
-                 case 3:
-                     standardName = i18n("NTSC 16:9");
-                     break;
-                 case 2:
-                     standardName = i18n("NTSC 4:3");
-                     break;
-                 case 1:
-                     standardName = i18n("PAL 16:9");
-                     break;
-                 case 0:
-                     standardName = i18n("PAL 4:3");
-                     break;
-                 default:
-                     standardName = i18n("Unknown");
-               }
-               item->setData(0, Qt::UserRole, standardName);
-               item->setData(0, Qt::UserRole + 1, standard);
-               item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
-           }
-           else {
-               // Cannot load movie, reject
-               showError(i18n("The clip %1 is invalid.", transcoded.fileName()));
-           }
-           if (producer) delete producer;
-           slotCheckVobList();
-           slotCheckProfiles();
-           break;
-       }
+        if (KUrl(item->text(0)).path() == src.path()) {
+            // Replace movie with transcoded version
+            item->setText(0, transcoded.path());
+
+            QFile f(transcoded.path());
+            qint64 fileSize = f.size();
+
+            Mlt::Profile profile;
+            profile.set_explicit(false);
+            item->setText(2, KIO::convertSize(fileSize));
+            item->setData(2, Qt::UserRole, fileSize);
+            item->setData(0, Qt::DecorationRole, KIcon("video-x-generic").pixmap(60, 45));
+            item->setToolTip(0, transcoded.path());
+
+            QString resource = transcoded.path();
+            resource.prepend("avformat:");
+            Mlt::Producer *producer = new Mlt::Producer(profile, resource.toUtf8().data());
+            if (producer && producer->is_valid() && !producer->is_blank()) {
+                profile.from_producer(*producer);
+                int width = 45.0 * profile.dar();
+                int swidth = 45.0 * profile.width() / profile.height();
+                if (width % 2 == 1) width++;
+                item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
+                int playTime = producer->get_playtime();
+                item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
+                item->setData(1, Qt::UserRole, playTime);
+                int standard = -1;
+                int aspect = profile.dar() * 100;
+                if (profile.height() == 576) {
+                    if (aspect > 150) standard = 1;
+                    else standard = 0;
+                }
+                else if (profile.height() == 480) {
+                    if (aspect > 150) standard = 3;
+                    else standard = 2;
+                }
+                QString standardName;
+                switch (standard) {
+                case 3:
+                    standardName = i18n("NTSC 16:9");
+                    break;
+                case 2:
+                    standardName = i18n("NTSC 4:3");
+                    break;
+                case 1:
+                    standardName = i18n("PAL 16:9");
+                    break;
+                case 0:
+                    standardName = i18n("PAL 4:3");
+                    break;
+                default:
+                    standardName = i18n("Unknown");
+                }
+                item->setData(0, Qt::UserRole, standardName);
+                item->setData(0, Qt::UserRole + 1, standard);
+                item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
+            }
+            else {
+                // Cannot load movie, reject
+                showError(i18n("The clip %1 is invalid.", transcoded.fileName()));
+            }
+            if (producer) delete producer;
+            slotCheckVobList();
+            slotCheckProfiles();
+            break;
+        }
     }
 }
 
@@ -657,7 +657,7 @@ void DvdWizardVob::showProfileError()
 #endif
 }
 
-void DvdWizardVob::showError(const QString error)
+void DvdWizardVob::showError(const QString &error)
 {
 #if KDE_IS_VERSION(4,7,0)
     m_warnMessage->setText(error);
index 2dd461f0cc07d1b5c969b2207a012904975e056f..1b73608c4f7f880740bc3cf6aa7213576888f5c0 100644 (file)
@@ -54,7 +54,7 @@ protected:
 
 signals:
     void addNewClip();
-    void addClips(QList<QUrl>);
+    void addClips(const QList<QUrl>&);
 };
 
 class DvdViewDelegate : public QStyledItemDelegate
@@ -68,7 +68,7 @@ public:
         if (index.column() == 0) {
             painter->save();
             QStyleOptionViewItemV4 opt(option);
-           QRect r1 = option.rect;
+            QRect r1 = option.rect;
             QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
             const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
             style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
@@ -78,7 +78,7 @@ public:
             painter->drawPixmap(pixmapPoint, pixmap);
             int decoWidth = pixmap.width() + 2 * textMargin;
 
-           QFont font = painter->font();
+            QFont font = painter->font();
             font.setBold(true);
             painter->setFont(font);
             int mid = (int)((r1.height() / 2));
@@ -129,11 +129,11 @@ private:
     KMessageWidget *m_warnMessage;
 #endif
     void showProfileError();
-    void showError(const QString error);
+    void showError(const QString &error);
 
 public slots:
     void slotAddVobFile(KUrl url = KUrl(), const QString &chapters = QString(), bool checkFormats = true);
-    void slotAddVobList(QList <QUrl>list);
+    void slotAddVobList(const QList<QUrl> &list);
     void slotCheckProfiles();
 
 private slots:
index 0efbc74e04c6a53e92bf83b1faa024b970517f64..ab84655407d624869e88a257976248b73585093e 100644 (file)
@@ -90,7 +90,7 @@ private slots:
     void slotAutoExpand(const QString &text);
 
 signals:
-    void addEffect(const QDomElement);
+    void addEffect(const QDomElement&);
     void reloadEffects();
 };
 
index 01ef3ed60b5ac4693fc94106074196bac98e02da..328d95813c03384289fdce8e4df54b58f70273be 100644 (file)
@@ -220,7 +220,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
     }
 }
 
-void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString current, bool *found)
+void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString &current, bool *found)
 {
     QStringList effectInfo, l;
     QTreeWidgetItem *parentItem;
index b3fd80b02b37e01b477f0eda604f95ecc8e9e63b..5df95d1a5de77c8c465e1c3eb660644c2cda76ee 100644 (file)
@@ -61,7 +61,7 @@ private:
      * @param current name of selected effect before reload; if an effect name matches this one it will become selected
      * @param found will be set to true if an effect name matches current
      */
-    void loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString current, bool *found);
+    void loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString &current, bool *found);
 
 private slots:
     void slotExpandItem(const QModelIndex & index);
index dd3bddfe5db165e01a205835739bf4accf032b99..552f20a75b0b729abd0d88342fbaaba6045ab59a 100644 (file)
@@ -70,7 +70,7 @@ public slots:
     void slotSyncEffectsPos(int pos);
 
 signals:
-    void parameterChanged(const QDomElement, const QDomElement, int);
+    void parameterChanged(const QDomElement&, const QDomElement&, int);
     void seekTimeline(int);
     void displayMessage(const QString&, int);
     void checkMonitorPosition(int);
@@ -78,7 +78,7 @@ signals:
     void showComments(bool show);
     void effectStateChanged(bool enabled);
     /** @brief Start an MLT filter job on this clip. */
-    void startFilterJob(const QString &filterName, const QString &filterParams, const QString &consumer, const QString &consumerParams, const QMap <QString, QString>);
+    void startFilterJob(const QString &filterName, const QString &filterParams, const QString &consumer, const QString &consumerParams, const QMap <QString, QString>&);
     void importClipKeyframes(GRAPHICSRECTITEM = AVWIDGET);
 };
 
index 8d9401b7df116cf78b039474a7279e3452d76650..13a93f25821b464c2bffff6d9628ae42abc23eb9 100644 (file)
@@ -70,19 +70,19 @@ void EncodingProfilesDialog::slotLoadProfiles()
     profile_list->clear();
     QString group;
     switch (profile_type->currentIndex()) {
-        case 0: 
-            group = "proxy";
-            break;          
-        case 1: 
-            group = "video4linux";
-            break;
-       case 2: 
-            group = "screengrab";
-            break;
-        default:
-        case 3: 
-            group = "decklink";
-            break;
+    case 0:
+        group = "proxy";
+        break;
+    case 1:
+        group = "video4linux";
+        break;
+    case 2:
+        group = "screengrab";
+        break;
+    default:
+    case 3:
+        group = "decklink";
+        break;
     }
 
     delete m_configGroup;
index 934474100ed954858211046660ba5c974aa3303d..7fa246e65c99893f9003940ea58f35efe66ccfea 100644 (file)
@@ -489,7 +489,7 @@ void Geometryval::slotResetPosition()
     }
 }
 
-void Geometryval::setFrameSize(QPoint p)
+void Geometryval::setFrameSize(const QPoint &p)
 {
     m_frameSize = p;
 }
index 96c9f5bd9fc3917445e887d396419dbbe2dfc215..a0215a80cb1c5d678ba0231d5befdc8b4f2d0aeb 100644 (file)
@@ -44,7 +44,7 @@ public:
     virtual ~Geometryval();
     QDomElement getParamDesc();
     QString getValue() const;
-    void setFrameSize(QPoint p);
+    void setFrameSize(const QPoint &p);
     /** @brief Updates the timecode display according to settings (frame number or hh:mm:ss:ff) */
     void updateTimecodeFormat();
     void slotUpdateRange(int inPoint, int outPoint);
index 661b388d972e3b9d52336153ddd45ba6d0d93a66..44377e0fdfc57f113ef6cb931fe74f031cbd3b66 100644 (file)
@@ -269,12 +269,12 @@ GeometryWidget::~GeometryWidget()
     delete m_spinHeight;
     delete m_opacity;
     if (m_rect) {
-       m_scene->removeItem(m_rect);
-       delete m_rect;
+        m_scene->removeItem(m_rect);
+        delete m_rect;
     }
     if (m_geomPath) {
-       m_scene->removeItem(m_geomPath);
-       delete m_geomPath;
+        m_scene->removeItem(m_geomPath);
+        delete m_geomPath;
     }
     delete m_previous;
     delete m_geometry;
@@ -296,8 +296,8 @@ void GeometryWidget::slotShowPath(bool show)
 {
     KdenliveSettings::setOnmonitoreffects_geometryshowpath(show);
     if (m_geomPath) {
-       if (show) m_scene->addItem(m_geomPath);
-       else m_scene->removeItem(m_geomPath);
+        if (show) m_scene->addItem(m_geomPath);
+        else m_scene->removeItem(m_geomPath);
     }
     slotPositionChanged(-1, false);
 }
@@ -356,12 +356,12 @@ void GeometryWidget::setupParam(const QDomElement &elem, int minframe, int maxfr
     Mlt::GeometryItem item;
     m_geometry->fetch(&item, 0);
     if (m_rect) {
-       m_scene->removeItem(m_rect);
-       delete m_rect;
+        m_scene->removeItem(m_rect);
+        delete m_rect;
     }
     if (m_geomPath) {
-       m_scene->removeItem(m_geomPath);
-       delete m_geomPath;
+        m_scene->removeItem(m_geomPath);
+        delete m_geomPath;
     }
     m_rect = new OnMonitorRectItem(QRectF(0, 0, item.w(), item.h()), m_monitor->render->dar());
     m_rect->setPos(item.x(), item.y());
@@ -373,7 +373,7 @@ void GeometryWidget::setupParam(const QDomElement &elem, int minframe, int maxfr
     m_geomPath->setPen(QPen(Qt::red));
     m_geomPath->setPoints(m_geometry);
     if (KdenliveSettings::onmonitoreffects_geometryshowpath())
-       m_scene->addItem(m_geomPath);
+        m_scene->addItem(m_geomPath);
     m_scene->centerView();
     slotPositionChanged(0, false);
 }
@@ -547,9 +547,9 @@ void GeometryWidget::slotDeleteKeyframe(int pos)
 
     m_timeline->update();
     if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
-       m_scene->removeItem(m_geomPath);
-       m_geomPath->setPoints(m_geometry);
-       m_scene->addItem(m_geomPath);
+        m_scene->removeItem(m_geomPath);
+        m_geomPath->setPoints(m_geometry);
+        m_scene->addItem(m_geomPath);
     }
     slotPositionChanged(pos, false);
     emit parameterChanged();
@@ -595,13 +595,13 @@ void GeometryWidget::slotUpdatePath()
     int pos = 0;
     int ix = 0;
     while (ix < points.count() && !m_geometry->next_key(&item, pos)) {
-       QPointF center = points.at(ix);
-       QSizeF size(item.w(), item.h());
-       item.x(center.x() - size.width()/2);
-       item.y(center.y() - size.height()/2);
-       m_geometry->insert(item);
-       pos = item.frame() + 1;
-       ix++;
+        QPointF center = points.at(ix);
+        QSizeF size(item.w(), item.h());
+        item.x(center.x() - size.width()/2);
+        item.y(center.y() - size.height()/2);
+        m_geometry->insert(item);
+        pos = item.frame() + 1;
+        ix++;
     }
     slotPositionChanged(-1, false);
     emit parameterChanged();
@@ -636,9 +636,9 @@ void GeometryWidget::slotUpdateGeometry()
         }
     }
     if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
-       m_scene->removeItem(m_geomPath);
-       m_geomPath->setPoints(m_geometry);
-       m_scene->addItem(m_geomPath);
+        m_scene->removeItem(m_geomPath);
+        m_geomPath->setPoints(m_geometry);
+        m_scene->addItem(m_geomPath);
     }
     emit parameterChanged();
 }
@@ -769,7 +769,7 @@ void GeometryWidget::slotSetSynchronize(bool sync)
         emit seekToPos(m_clipPos + m_timePos->getValue());
 }
 
-void GeometryWidget::setFrameSize(QPoint size)
+void GeometryWidget::setFrameSize(const QPoint &size)
 {
     m_frameSize = size;
 }
@@ -823,15 +823,15 @@ void GeometryWidget::slotResetKeyframes()
     // Delete existing keyframes
     Mlt::GeometryItem item;
     while (!m_geometry->next_key(&item, 1)) {
-       m_geometry->remove(item.frame());
+        m_geometry->remove(item.frame());
     }
 
     // Delete extra geometry keyframes too
     for (int i = 0; i < m_extraGeometries.count(); ++i) {
         Mlt::Geometry *geom = m_extraGeometries.at(i);
-       while (!geom->next_key(&item, 1)) {
-           geom->remove(item.frame());
-       }
+        while (!geom->next_key(&item, 1)) {
+            geom->remove(item.frame());
+        }
     }
 
     // Create neutral first keyframe
@@ -844,9 +844,9 @@ void GeometryWidget::slotResetKeyframes()
     m_geometry->insert(item);
     m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
     if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
-       m_scene->removeItem(m_geomPath);
-       m_geomPath->setPoints(m_geometry);
-       m_scene->addItem(m_geomPath);
+        m_scene->removeItem(m_geomPath);
+        m_geomPath->setPoints(m_geometry);
+        m_scene->addItem(m_geomPath);
     }
     slotPositionChanged(-1, false);
     emit parameterChanged();
@@ -858,32 +858,32 @@ void GeometryWidget::slotResetNextKeyframes()
     Mlt::GeometryItem item;
     int pos = m_timePos->getValue();
     while (!m_geometry->next_key(&item, pos)) {
-       m_geometry->remove(item.frame());
+        m_geometry->remove(item.frame());
     }
 
     // Delete extra geometry keyframes too
     for (int i = 0; i < m_extraGeometries.count(); ++i) {
         Mlt::Geometry *geom = m_extraGeometries.at(i);
-       while (!geom->next_key(&item, pos)) {
-           geom->remove(item.frame());
-       }
+        while (!geom->next_key(&item, pos)) {
+            geom->remove(item.frame());
+        }
     }
 
     // Make sure we have at least one keyframe
     if (m_geometry->next_key(&item, 0)) {
-       item.frame(0);
-       item.x(0);
-       item.y(0);
-       item.w(m_monitor->render->frameRenderWidth());
-       item.h(m_monitor->render->renderHeight());
-       item.mix(100);
-       m_geometry->insert(item);
+        item.frame(0);
+        item.x(0);
+        item.y(0);
+        item.w(m_monitor->render->frameRenderWidth());
+        item.h(m_monitor->render->renderHeight());
+        item.mix(100);
+        m_geometry->insert(item);
     }
     m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
     if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
-       m_scene->removeItem(m_geomPath);
-       m_geomPath->setPoints(m_geometry);
-       m_scene->addItem(m_geomPath);
+        m_scene->removeItem(m_geomPath);
+        m_geomPath->setPoints(m_geometry);
+        m_scene->addItem(m_geomPath);
     }
     slotPositionChanged(-1, false);
     emit parameterChanged();
@@ -895,44 +895,44 @@ void GeometryWidget::slotResetPreviousKeyframes()
     Mlt::GeometryItem item;
     int pos = 0;
     while (!m_geometry->next_key(&item, pos) && pos < m_timePos->getValue()) {
-       pos = item.frame() + 1;
-       m_geometry->remove(item.frame());
+        pos = item.frame() + 1;
+        m_geometry->remove(item.frame());
     }
 
     // Delete extra geometry keyframes too
     for (int i = 0; i < m_extraGeometries.count(); ++i) {
         Mlt::Geometry *geom = m_extraGeometries.at(i);
-       pos = 0;
-       while (!geom->next_key(&item, pos) && pos < m_timePos->getValue()) {
-           pos = item.frame() + 1;
-           geom->remove(item.frame());
-       }
+        pos = 0;
+        while (!geom->next_key(&item, pos) && pos < m_timePos->getValue()) {
+            pos = item.frame() + 1;
+            geom->remove(item.frame());
+        }
     }
 
     // Make sure we have at least one keyframe
     if (!m_geometry->next_key(&item, 0)) {
-       item.frame(0);
-       /*item.x(0);
-       item.y(0);
-       item.w(m_monitor->render->frameRenderWidth());
-       item.h(m_monitor->render->renderHeight());
-       item.mix(100);*/
-       m_geometry->insert(item);
+        item.frame(0);
+        /*item.x(0);
+    item.y(0);
+    item.w(m_monitor->render->frameRenderWidth());
+    item.h(m_monitor->render->renderHeight());
+    item.mix(100);*/
+        m_geometry->insert(item);
     }
     else {
-       item.frame(0);
-       item.x(0);
-       item.y(0);
-       item.w(m_monitor->render->frameRenderWidth());
-       item.h(m_monitor->render->renderHeight());
-       item.mix(100);
-       m_geometry->insert(item);
+        item.frame(0);
+        item.x(0);
+        item.y(0);
+        item.w(m_monitor->render->frameRenderWidth());
+        item.h(m_monitor->render->renderHeight());
+        item.mix(100);
+        m_geometry->insert(item);
     }
     m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
     if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
-       m_scene->removeItem(m_geomPath);
-       m_geomPath->setPoints(m_geometry);
-       m_scene->addItem(m_geomPath);
+        m_scene->removeItem(m_geomPath);
+        m_geomPath->setPoints(m_geometry);
+        m_scene->addItem(m_geomPath);
     }
     slotPositionChanged(-1, false);
     emit parameterChanged();
@@ -950,45 +950,45 @@ void GeometryWidget::importKeyframes(const QString &data, int maximum)
     Mlt::GeometryItem item;
     
     while (!m_geometry->next_key(&item, 0)) {
-       m_geometry->remove(item.frame());
+        m_geometry->remove(item.frame());
     }
     
     int offset = 1;
     if (maximum > 0 && list.count() > maximum) {
-       offset = list.count() / maximum;
+        offset = list.count() / maximum;
     }
     for (int i = 0; i < list.count(); i += offset) {
-       QString geom = list.at(i);
-       if (geom.contains('=')) {
-           item.frame(geom.section('=', 0, 0).toInt());
-           geom = geom.section('=', 1);
-       }
-       else item.frame(0);
-       if (geom.contains('/')) {
-           item.x(geom.section('/', 0, 0).toDouble());
-           item.y(geom.section('/', 1, 1).section(':', 0, 0).toDouble());
-       }
-       else {
-           item.x(0);
-           item.y(0);
-       }
-       if (geom.contains('x')) {
-           item.w(geom.section('x', 0, 0).section(':', 1, 1).toDouble());
-           item.h(geom.section('x', 1, 1).section(':', 0, 0).toDouble());
-       }
-       else {
-           item.w(screenSize.x());
-           item.h(screenSize.y());
-       }
-       //TODO: opacity
-       item.mix(100);
-       m_geometry->insert(item);
+        QString geom = list.at(i);
+        if (geom.contains('=')) {
+            item.frame(geom.section('=', 0, 0).toInt());
+            geom = geom.section('=', 1);
+        }
+        else item.frame(0);
+        if (geom.contains('/')) {
+            item.x(geom.section('/', 0, 0).toDouble());
+            item.y(geom.section('/', 1, 1).section(':', 0, 0).toDouble());
+        }
+        else {
+            item.x(0);
+            item.y(0);
+        }
+        if (geom.contains('x')) {
+            item.w(geom.section('x', 0, 0).section(':', 1, 1).toDouble());
+            item.h(geom.section('x', 1, 1).section(':', 0, 0).toDouble());
+        }
+        else {
+            item.w(screenSize.x());
+            item.h(screenSize.y());
+        }
+        //TODO: opacity
+        item.mix(100);
+        m_geometry->insert(item);
     }
     m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
     if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
-       m_scene->removeItem(m_geomPath);
-       m_geomPath->setPoints(m_geometry);
-       m_scene->addItem(m_geomPath);
+        m_scene->removeItem(m_geomPath);
+        m_geomPath->setPoints(m_geometry);
+        m_scene->addItem(m_geomPath);
     }
     slotPositionChanged(-1, false);
     emit parameterChanged();
@@ -999,7 +999,7 @@ void GeometryWidget::slotUpdateRange(int inPoint, int outPoint)
     m_inPoint = inPoint;
     m_outPoint = outPoint;
     m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
-    m_timePos->setRange(0, m_outPoint - m_inPoint);    
+    m_timePos->setRange(0, m_outPoint - m_inPoint);
 }
 
 #include "geometrywidget.moc"
index dceadd6d4320a1fd8cc6f1c70e0c9e018b0cbee7..3f7414408c63f7191a30457ff4cb800fb345c25f 100644 (file)
@@ -48,7 +48,7 @@ public:
     * @param isEffect true if used in an effect, false if used in a transition
     * @param showRotation Should we show or hide the rotation sliders
     * @param parent (optional) Parent widget */
-    GeometryWidget(Monitor *monitor, const Timecode &timecode, int clipPos, bool isEffect, bool showRotation, QWidget* parent = 0);
+    explicit GeometryWidget(Monitor *monitor, const Timecode &timecode, int clipPos, bool isEffect, bool showRotation, QWidget* parent = 0);
     virtual ~GeometryWidget();
     /** @brief Gets the geometry as a serialized string. */
     QString getValue() const;
@@ -56,7 +56,7 @@ public:
     /** @brief Updates the timecode display according to settings (frame number or hh:mm:ss:ff) */
     void updateTimecodeFormat();
     /** @brief Sets the size of the original clip. */
-    void setFrameSize(QPoint size);
+    void setFrameSize(const QPoint &size);
     void addParameter(const QDomElement &elem);
     void importKeyframes(const QString &data, int maximum);
     int currentPosition() const;
index 5c768459aec11b5435ad1225b75c0e61a6432ef1..ed563581621e5b04f990b3bbafc8bde1c8a7565e 100644 (file)
 
 
 GraphicsSceneRectMove::GraphicsSceneRectMove(QObject *parent) :
-        QGraphicsScene(parent),
-        m_selectedItem(NULL),
-        m_resizeMode(NoResize),
-        m_tool(TITLE_RECTANGLE)
+    QGraphicsScene(parent),
+    m_selectedItem(NULL),
+    m_resizeMode(NoResize),
+    m_tool(TITLE_RECTANGLE)
 {
     //grabMouse();
     m_zoom = 1.0;
@@ -53,7 +53,7 @@ void GraphicsSceneRectMove::setSelectedItem(QGraphicsItem *item)
     update();
 }
 
-TITLETOOL GraphicsSceneRectMove::tool()
+TITLETOOL GraphicsSceneRectMove::tool() const
 {
     return m_tool;
 }
@@ -108,9 +108,9 @@ void GraphicsSceneRectMove::keyPressEvent(QKeyEvent * keyEvent)
     case Qt::Key_Delete:
     case Qt::Key_Backspace:
         foreach (QGraphicsItem *qgi, selectedItems()) {
-           if (qgi->data(-1).toInt() == -1) continue;
-           removeItem(qgi);
-           delete qgi;
+            if (qgi->data(-1).toInt() == -1) continue;
+            removeItem(qgi);
+            delete qgi;
         }
         m_selectedItem = NULL;
         emit selectionChanged();
@@ -168,7 +168,7 @@ void GraphicsSceneRectMove::mousePressEvent(QGraphicsSceneMouseEvent* e)
         }
         if (item == NULL  || !(item->flags() & QGraphicsItem::ItemIsSelectable)) {
             if (m_selectedItem && m_selectedItem->type() == QGraphicsTextItem::Type) {
-                // disable text editing
+                // disable text editing
                 QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
                 t->textCursor().setPosition(0);
                 QTextBlock cur = t->textCursor().block();
@@ -257,7 +257,7 @@ void GraphicsSceneRectMove::mousePressEvent(QGraphicsSceneMouseEvent* e)
 void GraphicsSceneRectMove::clearTextSelection()
 {
     if (m_selectedItem && m_selectedItem->type() == QGraphicsTextItem::Type) {
-        // disable text editing
+        // disable text editing
         QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
         t->textCursor().setPosition(0);
         QTextBlock cur = t->textCursor().block();
@@ -421,7 +421,7 @@ void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e)
             if (resizeMode == Left || resizeMode == Right ) s = m_selectedItem->boundingRect().width() / newrect.width();
             else s = m_selectedItem->boundingRect().height() / newrect.height();
             m_selectedItem->scale( 1 / s, 1 / s );
-            kDebug()<<"/// SCALING SVG, RESIZE MODE: "<<resizeMode<<", RECT:"<<m_selectedItem->boundingRect();
+            kDebug()<<"/// SCALING SVG, RESIZE MODE: "<<resizeMode<<", RECT:"<<m_selectedItem->boundingRect();
             }*/
             //gi->setPos(m_selectedItem->scenePos());
             /*if (resizeMode == NoResize) {
index 11bc9851dc1b196bce78912e977dcbddcd9f1972..3ed50cef7ca6f421f0a095111a7f36cc4157bf92 100644 (file)
@@ -36,7 +36,7 @@ public:
     void setScale(double s);
     void setZoom(double s);
     void setTool(TITLETOOL tool);
-    TITLETOOL tool();
+    TITLETOOL tool() const;
     void clearTextSelection();
 
 public slots:
index 6bc56d098779e9cc44c1a8676959bbf64c13d1d0..7a7b160972050a04fd4b03ff31802d7c3eb4b538 100644 (file)
@@ -741,7 +741,7 @@ void initEffects::fillTransitionsList(Mlt::Repository *repository, EffectsList *
     transitions->append(ret.documentElement());*/
 }
 
-QDomElement initEffects::quickParameterFill(QDomDocument & doc, QString name, QString tag, QString type, QString def, QString min, QString max, QString list, QString listdisplaynames, QString factor, QString namedesc, QString format, QString opacity)
+QDomElement initEffects::quickParameterFill(QDomDocument & doc, const QString &name, const QString &tag, const QString &type, const QString &def, const QString &min, const QString &max, const QString &list, const QString &listdisplaynames, const QString &factor, const QString &namedesc, const QString &format, const QString &opacity)
 {
     QDomElement parameter = doc.createElement("parameter");
     parameter.setAttribute("tag", tag);
index 5230046703923410f95a30517c8753a601e6a59f..780a80565abe8e3fe7a05ede6216883caf230a93 100644 (file)
@@ -77,17 +77,19 @@ public:
      * @param tag parameter tag
      * @param type parameter type (string, double, bool, etc.)
      * @return element with the parameter information */
-    static QDomElement quickParameterFill(QDomDocument & doc, QString name,
-                                          QString tag, QString type,
-                                          QString def = QString(),
-                                          QString min = QString(),
-                                          QString max = QString(),
-                                          QString list = QString(),
-                                          QString listdisplaynames = QString(),
-                                          QString factor = QString(),
-                                          QString namedesc = QString(),
-                                          QString format = QString(),
-                                          QString opacity = QString());
+    static QDomElement quickParameterFill(QDomDocument & doc,
+                                          const QString &name,
+                                          const QString &tag,
+                                          const QString &type,
+                                          const QString &def = QString(),
+                                          const QString &min = QString(),
+                                          const QString &max = QString(),
+                                          const QString &list = QString(),
+                                          const QString &listdisplaynames = QString(),
+                                          const QString &factor = QString(),
+                                          const QString &namedesc = QString(),
+                                          const QString &format = QString(),
+                                          const QString &opacity = QString());
 
     /** @brief Parses a file to record information about one or more effects.
      * @param customEffectList list of custom effect
index b82b6fbb4c5c8be0027e494fc684c4c80bbcd5e8..fc3b77bd2a422377de32c75e4cccd075aacef251 100644 (file)
@@ -66,7 +66,7 @@ QString JogShuttleConfig::actionMap(const QStringList& actionMap)
   for (int i=0; i < actionMap.size(); ++i) {
       if (actionMap[i].isEmpty())
           continue;
-      mappings << QString("%1%2%3%4").arg(BUTTON_PREFIX).arg(i).arg(KEY_VALUE_SEP).arg(actionMap[i]);
+      mappings << QString::fromLatin1("%1%2%3%4").arg(BUTTON_PREFIX).arg(i).arg(KEY_VALUE_SEP).arg(actionMap[i]);
   }
 
   return mappings.join(DELIMITER);
index d648261df1fdea58bd293f825b0c5df66e3e27a2..07471af0c3f0599079f26c979f9b2dff615bea2b 100644 (file)
@@ -125,7 +125,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
         systemLocale.setNumberOptions(QLocale::OmitGroupSeparator);
         QLocale::setDefault(systemLocale);
         // locale conversion might need to be redone
-       initEffects::parseEffectFiles(setlocale(LC_NUMERIC, NULL));
+        initEffects::parseEffectFiles(setlocale(LC_NUMERIC, NULL));
     }
 
     *openBackup = false;
@@ -143,50 +143,50 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
         else {
             QFile file(tmpFile);
             QString errorMsg;
-           int line;
-           int col;
+            int line;
+            int col;
             QDomImplementation::setInvalidDataPolicy(QDomImplementation::DropInvalidChars);
             success = m_document.setContent(&file, false, &errorMsg, &line, &col);
-           file.close();
+            file.close();
 
             if (!success) {
                 // It is corrupted
-               int answer = KMessageBox::warningYesNoCancel (parent, i18n("Cannot open the project file, error is:\n%1 (line %2, col %3)\nDo you want to open a backup file?", errorMsg, line, col), i18n("Error opening file"), KGuiItem(i18n("Open Backup")), KGuiItem(i18n("Recover")));
+                int answer = KMessageBox::warningYesNoCancel (parent, i18n("Cannot open the project file, error is:\n%1 (line %2, col %3)\nDo you want to open a backup file?", errorMsg, line, col), i18n("Error opening file"), KGuiItem(i18n("Open Backup")), KGuiItem(i18n("Recover")));
                 if (answer == KMessageBox::Yes) {
-                   *openBackup = true;
-               }
-               else if (answer == KMessageBox::No) {
-                   // Try to recover broken file produced by Kdenlive 0.9.4
-                   if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
-                       int correction = 0;
-                       QString playlist = file.readAll();
-                       while (!success && correction < 2) {
-                           int errorPos = 0;
-                           line--;
-                           col = col - 2;
-                           for (int j = 0; j < line && errorPos < playlist.length(); j++) {
-                               errorPos = playlist.indexOf("\n", errorPos);
-                               errorPos++;
-                           }
-                           errorPos += col;
-                           if (errorPos >= playlist.length()) break;
-                           playlist.remove(errorPos, 1);
-                           line = 0;
-                           col = 0;
-                           success = m_document.setContent(playlist, false, &errorMsg, &line, &col);
-                           correction++;
-                       }
-                       if (!success) {
-                           KMessageBox::sorry(parent, i18n("Cannot recover this project file"));
-                       }
-                       else {
-                           // Document was modified, ask for backup
-                           QDomElement mlt = m_document.documentElement();
-                           QDomElement info = mlt.firstChildElement("kdenlivedoc");
-                           if (!info.isNull()) info.setAttribute("modified", 1);
-                       }
-                   }
-               }
+                    *openBackup = true;
+                }
+                else if (answer == KMessageBox::No) {
+                    // Try to recover broken file produced by Kdenlive 0.9.4
+                    if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+                        int correction = 0;
+                        QString playlist = file.readAll();
+                        while (!success && correction < 2) {
+                            int errorPos = 0;
+                            line--;
+                            col = col - 2;
+                            for (int j = 0; j < line && errorPos < playlist.length(); j++) {
+                                errorPos = playlist.indexOf("\n", errorPos);
+                                errorPos++;
+                            }
+                            errorPos += col;
+                            if (errorPos >= playlist.length()) break;
+                            playlist.remove(errorPos, 1);
+                            line = 0;
+                            col = 0;
+                            success = m_document.setContent(playlist, false, &errorMsg, &line, &col);
+                            correction++;
+                        }
+                        if (!success) {
+                            KMessageBox::sorry(parent, i18n("Cannot recover this project file"));
+                        }
+                        else {
+                            // Document was modified, ask for backup
+                            QDomElement mlt = m_document.documentElement();
+                            QDomElement info = mlt.firstChildElement("kdenlivedoc");
+                            if (!info.isNull()) info.setAttribute("modified", 1);
+                        }
+                    }
+                }
             }
             if (success) {
                 parent->slotGotProgressInfo(i18n("Validating"), 0);
@@ -250,7 +250,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
                                         projectTrack.isBlind = e.attribute("blind").toInt();
                                         projectTrack.isLocked = e.attribute("locked").toInt();
                                         projectTrack.trackName = e.attribute("trackname");
-                                       projectTrack.effectsList = EffectsList(true);
+                                        projectTrack.effectsList = EffectsList(true);
                                         m_tracksList.append(projectTrack);
                                     }
                                 }
@@ -316,11 +316,11 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
                                     for (int k = 0; k < maxchild; k++) {
                                         e = markerslist.at(k).toElement();
                                         if (e.tagName() == "marker") {
-                                           CommentedTime marker(GenTime(e.attribute("time").toDouble()), e.attribute("comment"), e.attribute("type").toInt());
-                                           DocClipBase *baseClip = m_clipManager->getClipById(e.attribute("id"));
+                                            CommentedTime marker(GenTime(e.attribute("time").toDouble()), e.attribute("comment"), e.attribute("type").toInt());
+                                            DocClipBase *baseClip = m_clipManager->getClipById(e.attribute("id"));
                                             if (baseClip) baseClip->addSnapMarker(marker);
-                                           else kDebug()<< " / / Warning, missing clip: "<< e.attribute("id");
-                                       }
+                                            else kDebug()<< " / / Warning, missing clip: "<< e.attribute("id");
+                                        }
                                     }
                                     infoXml.removeChild(markers);
                                 }
@@ -425,7 +425,7 @@ QDomDocument KdenliveDoc::createEmptyDocument(int videotracks, int audiotracks)
         audioTrack.isLocked = false;
         audioTrack.trackName = QString("Audio ") + QString::number(audiotracks - i);
         audioTrack.duration = 0;
-       audioTrack.effectsList = EffectsList(true);
+        audioTrack.effectsList = EffectsList(true);
         m_tracksList.append(audioTrack);
 
     }
@@ -437,7 +437,7 @@ QDomDocument KdenliveDoc::createEmptyDocument(int videotracks, int audiotracks)
         videoTrack.isLocked = false;
         videoTrack.trackName = QString("Video ") + QString::number(videotracks - i);
         videoTrack.duration = 0;
-       videoTrack.effectsList = EffectsList(true);
+        videoTrack.effectsList = EffectsList(true);
         m_tracksList.append(videoTrack);
     }
     return createEmptyDocument(m_tracksList);
@@ -763,7 +763,7 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList &
             marker.setAttribute("time", marks.at(j).time().ms() / 1000);
             marker.setAttribute("comment", marks.at(j).comment());
             marker.setAttribute("id", e.attribute("id"));
-           marker.setAttribute("type", marks.at(j).markerType());
+            marker.setAttribute("type", marks.at(j).markerType());
             markers.appendChild(marker);
         }
     }
@@ -808,7 +808,7 @@ bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene, const
     if (!autosave) {
         cleanupBackupFiles();
         QFileInfo info(file);
-        QString fileName = KUrl(path).fileName().section('.', 0, -2);   
+        QString fileName = KUrl(path).fileName().section('.', 0, -2);
         fileName.append('-' + m_documentProperties.value("documentid"));
         fileName.append(info.lastModified().toString("-yyyy-MM-dd-hh-mm"));
         fileName.append(".kdenlive.png");
@@ -1054,7 +1054,7 @@ KUrl KdenliveDoc::url() const
     return m_url;
 }
 
-void KdenliveDoc::setUrl(KUrl url)
+void KdenliveDoc::setUrl(const KUrl &url)
 {
     m_url = url;
 }
@@ -1082,7 +1082,7 @@ const QString KdenliveDoc::description() const
         return m_url.fileName() + " / " + m_profile.description;
 }
 
-bool KdenliveDoc::addClip(QDomElement elem, QString clipId, bool createClipItem)
+bool KdenliveDoc::addClip(QDomElement elem, const QString &clipId, bool createClipItem)
 {
     const QString producerId = clipId.section('_', 0, 0);
     DocClipBase *clip = m_clipManager->getClipById(producerId);
@@ -1215,7 +1215,7 @@ QString KdenliveDoc::searchFileRecursively(const QDir &dir, const QString &match
     return foundFileName;
 }
 
-bool KdenliveDoc::addClipInfo(QDomElement elem, QDomElement orig, QString clipId)
+bool KdenliveDoc::addClipInfo(QDomElement elem, QDomElement orig, const QString &clipId)
 {
     DocClipBase *clip = m_clipManager->getClipById(clipId);
     if (clip == NULL) {
@@ -1226,7 +1226,7 @@ bool KdenliveDoc::addClipInfo(QDomElement elem, QDomElement orig, QString clipId
         QDomNamedNodeMap attributes = elem.attributes();
         for (int i = 0; i < attributes.count(); ++i) {
             QString attrname = attributes.item(i).nodeName();
-           if (attrname != "resource")
+            if (attrname != "resource")
                 properties.insert(attrname, attributes.item(i).nodeValue());
             //kDebug() << attrname << " = " << attributes.item(i).nodeValue();
         }
@@ -1238,9 +1238,9 @@ bool KdenliveDoc::addClipInfo(QDomElement elem, QDomElement orig, QString clipId
         for (QDomNode m = orig.firstChild(); !m.isNull(); m = m.nextSibling()) {
             QString name = m.toElement().attribute("name");
             if (name.startsWith("meta.attr")) {
-               if (name.endsWith(".markup")) name = name.section('.', 0, -2);
+                if (name.endsWith(".markup")) name = name.section('.', 0, -2);
                 meta.insert(name.section('.', 2, -1), m.firstChild().nodeValue());
-           }
+            }
         }
         if (!meta.isEmpty()) {
             if (clip == NULL)
@@ -1283,21 +1283,21 @@ DocClipBase *KdenliveDoc::getBaseClip(const QString &clipId)
     return m_clipManager->getClipById(clipId);
 }
 
-void KdenliveDoc::slotCreateXmlClip(const QString &name, const QDomElement xml, QString group, const QString &groupId)
+void KdenliveDoc::slotCreateXmlClip(const QString &name, const QDomElement &xml, const QString &group, const QString &groupId)
 {
     m_clipManager->slotAddXmlClipFile(name, xml, group, groupId);
     setModified(true);
     emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
 }
 
-void KdenliveDoc::slotCreateColorClip(const QString &name, const QString &color, const QString &duration, QString group, const QString &groupId)
+void KdenliveDoc::slotCreateColorClip(const QString &name, const QString &color, const QString &duration, const QString &group, const QString &groupId)
 {
     m_clipManager->slotAddColorClipFile(name, color, duration, group, groupId);
     setModified(true);
     emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
 }
 
-void KdenliveDoc::slotCreateSlideshowClipFile(QMap <QString, QString> properties, QString group, const QString &groupId)
+void KdenliveDoc::slotCreateSlideshowClipFile(const QMap <QString, QString> &properties, const QString &group, const QString &groupId)
 {
     m_clipManager->slotAddSlideshowClipFile(properties, group, groupId);
     setModified(true);
@@ -1317,7 +1317,7 @@ void KdenliveDoc::slotCreateTextClip(QString group, const QString &groupId, cons
     delete dia_ui;
 }
 
-void KdenliveDoc::slotCreateTextTemplateClip(QString group, const QString &groupId, KUrl path)
+void KdenliveDoc::slotCreateTextTemplateClip(const QString &group, const QString &groupId, KUrl path)
 {
     QString titlesFolder = projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
     if (path.isEmpty()) {
@@ -1384,7 +1384,7 @@ void KdenliveDoc::switchTrackVideo(int ix, bool hide)
 
 int KdenliveDoc::trackDuration(int ix)
 {
-    return m_tracksList.at(ix).duration; 
+    return m_tracksList.at(ix).duration;
 }
 
 void KdenliveDoc::setTrackDuration(int ix, int duration)
@@ -1392,7 +1392,7 @@ void KdenliveDoc::setTrackDuration(int ix, int duration)
     m_tracksList[ix].duration = duration;
 }
 
-void KdenliveDoc::insertTrack(int ix, TrackInfo type)
+void KdenliveDoc::insertTrack(int ix, const TrackInfo &type)
 {
     if (ix == -1) m_tracksList << type;
     else m_tracksList.insert(ix, type);
@@ -1407,7 +1407,7 @@ void KdenliveDoc::deleteTrack(int ix)
     m_tracksList.removeAt(ix);
 }
 
-void KdenliveDoc::setTrackType(int ix, TrackInfo type)
+void KdenliveDoc::setTrackType(int ix, const TrackInfo &type)
 {
     if (ix < 0 || ix >= m_tracksList.count()) {
         kWarning() << "SET Track Type outisde of range";
@@ -1541,7 +1541,7 @@ void KdenliveDoc::addTrackEffect(int ix, QDomElement effect)
     m_tracksList[ix].effectsList.append(effect);
 }
 
-void KdenliveDoc::removeTrackEffect(int ix, QDomElement effect)
+void KdenliveDoc::removeTrackEffect(int ix, const QDomElement &effect)
 {
     if (ix < 0 || ix >= m_tracksList.count()) {
         kWarning() << "Remove Track effect outisde of range";
@@ -1574,7 +1574,7 @@ void KdenliveDoc::setTrackEffect(int trackIndex, int effectIndex, QDomElement ef
     //m_tracksList[trackIndex].effectsList.updateEffect(effect);
 }
 
-void KdenliveDoc::enableTrackEffects(int trackIndex, QList <int> effectIndexes, bool disable)
+void KdenliveDoc::enableTrackEffects(int trackIndex, const QList <int> &effectIndexes, bool disable)
 {
     if (trackIndex < 0 || trackIndex >= m_tracksList.count()) {
         kWarning() << "Set Track effect outisde of range";
@@ -1583,8 +1583,8 @@ void KdenliveDoc::enableTrackEffects(int trackIndex, QList <int> effectIndexes,
     EffectsList list = m_tracksList.at(trackIndex).effectsList;
     QDomElement effect;
     for (int i = 0; i < effectIndexes.count(); ++i) {
-       effect = list.itemFromIndex(effectIndexes.at(i));
-       if (!effect.isNull()) effect.setAttribute("disable", (int) disable);
+        effect = list.itemFromIndex(effectIndexes.at(i));
+        if (!effect.isNull()) effect.setAttribute("disable", (int) disable);
     }
 }
 
@@ -1618,15 +1618,15 @@ int KdenliveDoc::hasTrackEffect(int trackIndex, const QString &tag, const QStrin
     return list.hasEffect(tag, id);
 }
 
-bool KdenliveDoc::saveCustomEffects(QDomNodeList customeffects)
+bool KdenliveDoc::saveCustomEffects(const QDomNodeList &customeffects)
 {
     QDomElement e;
     QStringList importedEffects;
     int maxchild = customeffects.count();
     for (int i = 0; i < maxchild; ++i) {
         e = customeffects.at(i).toElement();
-        QString id = e.attribute("id");
-        QString tag = e.attribute("tag");
+        const QString id = e.attribute("id");
+        const QString tag = e.attribute("tag");
         if (!id.isEmpty()) {
             // Check if effect exists or save it
             if (MainWindow::customEffects.hasEffect(tag, id) == -1) {
@@ -1645,7 +1645,8 @@ bool KdenliveDoc::saveCustomEffects(QDomNodeList customeffects)
             }
         }
     }
-    if (!importedEffects.isEmpty()) KMessageBox::informationList(kapp->activeWindow(), i18n("The following effects were imported from the project:"), importedEffects);
+    if (!importedEffects.isEmpty())
+        KMessageBox::informationList(kapp->activeWindow(), i18n("The following effects were imported from the project:"), importedEffects);
     return (!importedEffects.isEmpty());
 }
 
@@ -1746,7 +1747,7 @@ void KdenliveDoc::backupLastSavedVersion(const QString &path)
         if (!QFile::copy(path, backupFile.path())) {
             KMessageBox::information(kapp->activeWindow(), i18n("Cannot create backup copy:\n%1", backupFile.path()));
         }
-    }    
+    }
 }
 
 void KdenliveDoc::cleanupBackupFiles()
index 286f8045ed74a818687abe4301c4ab6bc9d8dbb0..0851011c961c9cbf1b3dad6dce4522063c2d50fd 100644 (file)
@@ -50,7 +50,8 @@ class KProgressDialog;
 
 class KdenliveDoc: public QObject
 {
-Q_OBJECT public:
+    Q_OBJECT
+public:
 
     KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, KTextEdit *notes, bool *openBackup, MainWindow *parent = 0, KProgressDialog *progressDialog = 0);
     ~KdenliveDoc();
@@ -72,7 +73,7 @@ Q_OBJECT public:
 
     /** @brief Adds a clip to the project tree.
      * @return false if the user aborted the operation, true otherwise */
-    bool addClip(QDomElement elem, QString clipId, bool createClipItem = true);
+    bool addClip(QDomElement elem, const QString &clipId, bool createClipItem = true);
 
     /** @brief Updates information about a clip.
      * @param elem the <kdenlive_producer />
@@ -82,7 +83,7 @@ Q_OBJECT public:
      *     there yet), true otherwise
      *
      * If the clip wasn't added before, it tries to add it to the project. */
-    bool addClipInfo(QDomElement elem, QDomElement orig, QString clipId);
+    bool addClipInfo(QDomElement elem, QDomElement orig, const QString &clipId);
     void slotAddClipList(const KUrl::List urls, stringMap data = stringMap());
     void deleteClip(const QString &clipId);
     int getFramePos(QString duration);
@@ -94,7 +95,7 @@ Q_OBJECT public:
     const QString &profilePath() const;
     MltVideoProfile mltProfile() const;
     const QString description() const;
-    void setUrl(KUrl url);
+    void setUrl(const KUrl &url);
 
     /** @brief Updates the project profile.
      * @return true if frame rate was changed */
@@ -117,9 +118,9 @@ Q_OBJECT public:
     bool saveSceneList(const QString &path, const QString &scene, const QStringList &expandedFolders, bool autosave = false);
     int tracksCount() const;
     TrackInfo trackInfoAt(int ix) const;
-    void insertTrack(int ix, TrackInfo type);
+    void insertTrack(int ix, const TrackInfo &type);
     void deleteTrack(int ix);
-    void setTrackType(int ix, TrackInfo type);
+    void setTrackType(int ix, const TrackInfo &type);
     const QList <TrackInfo> tracksList() const;
 
     /** @brief Gets the number of audio and video tracks and returns them as a QPoint with x = video, y = audio. */
@@ -150,11 +151,11 @@ Q_OBJECT public:
     /** @brief Gets the list of renderer properties saved into the document. */
     QMap <QString, QString> getRenderProperties() const;
     void addTrackEffect(int ix, QDomElement effect);
-    void removeTrackEffect(int ix, QDomElement effect);
+    void removeTrackEffect(int ix, const QDomElement &effect);
     void setTrackEffect(int trackIndex, int effectIndex, QDomElement effect);
     const EffectsList getTrackEffects(int ix);
     /** @brief Enable / disable an effect in Kdenlive's xml list. */
-    void enableTrackEffects(int trackIndex, QList <int> effectIndexes, bool disable);
+    void enableTrackEffects(int trackIndex, const QList<int> &effectIndexes, bool disable);
     QDomElement getTrackEffect(int trackIndex, int effectIndex) const;
     /** @brief Check if a track already contains a specific effect. */
     int hasTrackEffect(int trackIndex, const QString &tag, const QString &id) const;
@@ -203,7 +204,7 @@ private:
     QDomDocument createEmptyDocument(QList <TrackInfo> tracks);
     /** @brief Saves effects embedded in project file.
     *   @return True if effects were imported.  */
-    bool saveCustomEffects(QDomNodeList customeffects);
+    bool saveCustomEffects(const QDomNodeList &customeffects);
 
     /** @brief Updates the project folder location entry in the kdenlive file dialogs to point to the current project folder. */
     void updateProjectFolderPlacesEntry();
@@ -211,11 +212,11 @@ private:
     void cleanupBackupFiles();
 
 public slots:
-    void slotCreateXmlClip(const QString &name, const QDomElement xml, QString group, const QString &groupId);
-    void slotCreateColorClip(const QString &name, const QString &color, const QString &duration, QString group, const QString &groupId);
-    void slotCreateSlideshowClipFile(QMap <QString, QString> properties, QString group, const QString &groupId);
+    void slotCreateXmlClip(const QString &name, const QDomElement &xml, const QString &group, const QString &groupId);
+    void slotCreateColorClip(const QString &name, const QString &color, const QString &duration, const QString &group, const QString &groupId);
+    void slotCreateSlideshowClipFile(const QMap<QString, QString> &properties, const QString &group, const QString &groupId);
     void slotCreateTextClip(QString group, const QString &groupId, const QString &templatePath = QString());
-    void slotCreateTextTemplateClip(QString group, const QString &groupId, KUrl path);
+    void slotCreateTextTemplateClip(const QString &group, const QString &groupId, KUrl path);
 
     /** @brief Sets the document as modified or up to date.
      * @param mod (optional) true if the document has to be saved */