X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fwizard.cpp;h=47de0a01b1460d5ed8359c4c2ff146f81ec32444;hb=3c844989ad9fdb96bb9258a990a9874773b3d792;hp=61a232b18374bc94c4b4af79edbafd6e0516c168;hpb=e0fa1332f109b6455207ea701da386b2fddddf09;p=kdenlive diff --git a/src/wizard.cpp b/src/wizard.cpp index 61a232b1..47de0a01 100644 --- a/src/wizard.cpp +++ b/src/wizard.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include @@ -360,7 +360,7 @@ void Wizard::checkMltComponents() result << QString(formats.get(i)); m_mltCheck.formats_list->addItems(result); KdenliveSettings::setSupportedformats(result); - checkMissingCodecs(); + checkMissingCodecs(); delete consumer; } @@ -428,24 +428,24 @@ void Wizard::checkMissingCodecs() QStringList requiredACodecs; QStringList requiredVCodecs; foreach(const QString &filename, fileList) { - QDomDocument doc; - QFile file(exportFolder + filename); - doc.setContent(&file, false); - file.close(); - QString std; - QString format; - QDomNodeList profiles = doc.elementsByTagName("profile"); - for (int i = 0; i < profiles.count(); ++i) { - std = profiles.at(i).toElement().attribute("args"); - format.clear(); + QDomDocument doc; + QFile file(exportFolder + filename); + doc.setContent(&file, false); + file.close(); + QString std; + QString format; + QDomNodeList profiles = doc.elementsByTagName("profile"); + for (int i = 0; i < profiles.count(); ++i) { + std = profiles.at(i).toElement().attribute("args"); + format.clear(); if (std.startsWith("acodec=")) format = std.section("acodec=", 1, 1); - else if (std.contains(" acodec=")) format = std.section(" acodec=", 1, 1); + else if (std.contains(" acodec=")) format = std.section(" acodec=", 1, 1); if (!format.isEmpty()) requiredACodecs << format.section(' ', 0, 0).toLower(); - format.clear(); + format.clear(); if (std.startsWith("vcodec=")) format = std.section("vcodec=", 1, 1); - else if (std.contains(" vcodec=")) format = std.section(" vcodec=", 1, 1); + else if (std.contains(" vcodec=")) format = std.section(" vcodec=", 1, 1); if (!format.isEmpty()) requiredVCodecs << format.section(' ', 0, 0).toLower(); - } + } } requiredACodecs.removeDuplicates(); requiredVCodecs.removeDuplicates(); @@ -453,38 +453,38 @@ void Wizard::checkMissingCodecs() if (replaceLibfaacCodec) requiredACodecs.replaceInStrings("aac", "libfaac"); for (int i = 0; i < acodecsList.count(); ++i) - requiredACodecs.removeAll(acodecsList.at(i)); + requiredACodecs.removeAll(acodecsList.at(i)); for (int i = 0; i < vcodecsList.count(); ++i) - requiredVCodecs.removeAll(vcodecsList.at(i)); + requiredVCodecs.removeAll(vcodecsList.at(i)); if (!requiredACodecs.isEmpty() || !requiredVCodecs.isEmpty()) { - QString missing = requiredACodecs.join(","); - if (!missing.isEmpty() && !requiredVCodecs.isEmpty()) missing.append(','); - missing.append(requiredVCodecs.join(",")); - missing.prepend(i18n("The following codecs were not found on your system. Check our online manual if you need them: ")); - // Some codecs required for rendering are not present on this system, warn user - show(); + QString missing = requiredACodecs.join(","); + if (!missing.isEmpty() && !requiredVCodecs.isEmpty()) missing.append(','); + missing.append(requiredVCodecs.join(",")); + missing.prepend(i18n("The following codecs were not found on your system. Check our online manual if you need them: ")); + // Some codecs required for rendering are not present on this system, warn user + show(); #if KDE_IS_VERSION(4,7,0) KMessageWidget *infoMessage = new KMessageWidget(this); m_startLayout->insertWidget(1, infoMessage); infoMessage->setCloseButtonVisible(false); infoMessage->setWordWrap(true); - infoMessage->setMessageType(KMessageWidget::Warning); + infoMessage->setMessageType(KMessageWidget::Warning); #if KDE_IS_VERSION(4,10,0) - connect(infoMessage, SIGNAL(linkActivated(QString)), this, SLOT(slotOpenManual())); - infoMessage->setText(missing); + connect(infoMessage, SIGNAL(linkActivated(QString)), this, SLOT(slotOpenManual())); + infoMessage->setText(missing); #else - // clickable text in kmessagewidget only available since KDE 4.10 - // remove link from text - missing.remove(QRegExp("<[^>]*>")); + // clickable text in kmessagewidget only available since KDE 4.10 + // remove link from text + missing.remove(QRegExp("<[^>]*>")); infoMessage->setText(missing); - QAction *manualAction = new QAction(i18n("Check online manual"), this); - connect(manualAction, SIGNAL(triggered()), this, SLOT(slotOpenManual())); - infoMessage->addAction(manualAction); + QAction *manualAction = new QAction(i18n("Check online manual"), this); + connect(manualAction, SIGNAL(triggered()), this, SLOT(slotOpenManual())); + infoMessage->addAction(manualAction); #endif infoMessage->animatedShow(); #else - m_welcomeLabel->setText(m_welcomeLabel->text() + "

" + missing); - connect(m_welcomeLabel, SIGNAL(linkActivated(QString)), this, SLOT(slotOpenManual())); + m_welcomeLabel->setText(m_welcomeLabel->text() + "

" + missing); + connect(m_welcomeLabel, SIGNAL(linkActivated(QString)), this, SLOT(slotOpenManual())); #endif } @@ -503,14 +503,14 @@ void Wizard::slotCheckPrograms() QString playpath = KStandardDirs::findExe("ffplay"); item->setIcon(0, m_okIcon); if (exepath.isEmpty()) { - // Check for libav version - exepath = KStandardDirs::findExe("avconv"); - if (exepath.isEmpty()) item->setIcon(0, m_badIcon); + // Check for libav version + exepath = KStandardDirs::findExe("avconv"); + if (exepath.isEmpty()) item->setIcon(0, m_badIcon); } if (playpath.isEmpty()) { - // Check for libav version - playpath = KStandardDirs::findExe("avplay"); - if (playpath.isEmpty()) item->setIcon(0, m_badIcon); + // Check for libav version + playpath = KStandardDirs::findExe("avplay"); + if (playpath.isEmpty()) item->setIcon(0, m_badIcon); } if (!exepath.isEmpty()) KdenliveSettings::setFfmpegpath(exepath); if (!playpath.isEmpty()) KdenliveSettings::setFfplaypath(playpath); @@ -544,11 +544,11 @@ void Wizard::slotCheckPrograms() item->setData(1, Qt::UserRole, i18n("Required to preview your DVD")); item->setSizeHint(0, itemSize); if (KStandardDirs::findExe("xine").isEmpty()) { - if (!KStandardDirs::findExe("vlc").isEmpty()) { - item->setText(1, i18n("vlc")); - item->setIcon(0, m_okIcon); - } - else item->setIcon(0, m_badIcon); + if (!KStandardDirs::findExe("vlc").isEmpty()) { + item->setText(1, i18n("vlc")); + item->setIcon(0, m_okIcon); + } + else item->setIcon(0, m_badIcon); } else item->setIcon(0, m_okIcon); @@ -571,15 +571,15 @@ void Wizard::slotCheckPrograms() } } -void Wizard::installExtraMimes(QString baseName, QStringList globs) +void Wizard::installExtraMimes(const QString &baseName, const QStringList &globs) { QString mimefile = baseName; mimefile.replace('/', '-'); KMimeType::Ptr mime = KMimeType::mimeType(baseName); QStringList missingGlobs; foreach(const QString & glob, globs) { - KMimeType::Ptr type = KMimeType::findByPath(glob, 0, true); - QString mimeName = type->name(); + KMimeType::Ptr type = KMimeType::findByPath(glob, 0, true); + QString mimeName = type->name(); if (!mimeName.contains("audio") && !mimeName.contains("video")) missingGlobs << glob; } if (missingGlobs.isEmpty()) return; @@ -709,7 +709,7 @@ void Wizard::adjustSettings() { if (m_extra.installmimes->isChecked()) { QStringList globs; - + globs << "*.mts" << "*.m2t" << "*.mod" << "*.ts" << "*.m2ts" << "*.m2v"; installExtraMimes("video/mpeg", globs); globs.clear();