]> git.sesse.net Git - kdenlive/blobdiff - src/dvdwizardvob.cpp
Const'ify
[kdenlive] / src / dvdwizardvob.cpp
index cce398d5f92128256b1d1f30b46853668d93c4dd..0f8c172560adeac166350ec34f49aa95224926a9 100644 (file)
@@ -153,7 +153,7 @@ void DvdWizardVob::slotCheckProfiles()
 {
     bool conflict = false;
     int comboProfile = m_view.dvd_profile->currentIndex();
-    for (int i = 0; i < m_vobList->topLevelItemCount(); i++) {
+    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;
@@ -284,6 +284,7 @@ void DvdWizardVob::slotAddVobFile(KUrl url, const QString &chapters, bool checkF
        slotCheckVobList();
        slotCheckProfiles();
     }
+    emit prepareMonitor();
 }
 
 void DvdWizardVob::slotDeleteVobFile()
@@ -319,7 +320,7 @@ QStringList DvdWizardVob::selectedUrls() const
        // First movie is only for intro
        i = 1;
     }
-    for (; i < max; i++) {
+    for (; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
         if (item) result.append(item->text(0));
     }
@@ -332,7 +333,12 @@ QStringList DvdWizardVob::durations() const
     QStringList result;
     QString path;
     int max = m_vobList->topLevelItemCount();
-    for (int i = 0; i < max; i++) {
+    int i = 0;
+    if (m_view.use_intro->isChecked()) {
+       // First movie is only for intro
+       i = 1;
+    }
+    for (; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
         if (item) result.append(QString::number(item->data(1, Qt::UserRole).toInt()));
     }
@@ -344,7 +350,12 @@ QStringList DvdWizardVob::chapters() const
     QStringList result;
     QString path;
     int max = m_vobList->topLevelItemCount();
-    for (int i = 0; i < max; i++) {
+    int i = 0;
+    if (m_view.use_intro->isChecked()) {
+       // First movie is only for intro
+       i = 1;
+    }
+    for (; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
         if (item) {
             result.append(item->data(1, Qt::UserRole + 1).toString());
@@ -356,7 +367,12 @@ QStringList DvdWizardVob::chapters() const
 void DvdWizardVob::updateChapters(QMap <QString, QString> chaptersdata)
 {
     int max = m_vobList->topLevelItemCount();
-    for (int i = 0; i < max; i++) {
+    int i = 0;
+    if (m_view.use_intro->isChecked()) {
+       // First movie is only for intro
+       i = 1;
+    }
+    for (; i < max; ++i) {
         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
         if (chaptersdata.contains(item->text(0))) item->setData(1, Qt::UserRole + 1, chaptersdata.value(item->text(0)));
     }
@@ -398,7 +414,7 @@ void DvdWizardVob::slotCheckVobList()
     else m_view.button_down->setEnabled(hasItem);
 
     qint64 totalSize = 0;
-    for (int i = 0; i < max; i++) {
+    for (int i = 0; i < max; ++i) {
         item = m_vobList->topLevelItem(i);
         if (item) totalSize += (qint64) item->data(2, Qt::UserRole).toInt();
     }
@@ -519,7 +535,7 @@ void DvdWizardVob::slotTranscodeFiles()
     // 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++) {
+    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
@@ -541,7 +557,7 @@ void DvdWizardVob::slotTranscodeFiles()
                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)));
+           connect(d, SIGNAL(transcodedClip(KUrl,KUrl)), this, SLOT(slotTranscodedClip(KUrl,KUrl)));
            d->slotStartTransCode();
            d->show();
            
@@ -557,7 +573,7 @@ void DvdWizardVob::slotTranscodedClip(KUrl src, KUrl transcoded)
        return;
     }
     int max = m_vobList->topLevelItemCount();
-    for (int i = 0; i < max; i++) {
+    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
@@ -652,4 +668,7 @@ void DvdWizardVob::showError(const QString error)
     m_view.error_message->setText(error);
     m_view.error_message->setVisible(true);
 #endif    
-}
\ No newline at end of file
+}
+
+
+#include "dvdwizardvob.moc"