X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fdvdwizardvob.cpp;h=0f8c172560adeac166350ec34f49aa95224926a9;hb=aa37ed1efa7f18af7b851c0bb3aaadb9ff8ebe3e;hp=655d086ed511506e12a328ac6c271901bdac8df8;hpb=b94d740d404a3528c7d93a5ea2c734d9a092d78a;p=kdenlive diff --git a/src/dvdwizardvob.cpp b/src/dvdwizardvob.cpp index 655d086e..0f8c1725 100644 --- a/src/dvdwizardvob.cpp +++ b/src/dvdwizardvob.cpp @@ -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; @@ -320,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)); } @@ -333,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())); } @@ -345,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()); @@ -357,7 +367,12 @@ QStringList DvdWizardVob::chapters() const void DvdWizardVob::updateChapters(QMap 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))); } @@ -399,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(); } @@ -520,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 @@ -542,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(); @@ -558,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 @@ -653,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"