From 1dc89d63c931d1e054acb0574dfd0c27fe31f9d5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Wed, 11 Feb 2009 12:25:11 +0000 Subject: [PATCH] Fix detection of MLT's version when pkgconfig info is not present svn path=/branches/KDE4/; revision=3045 --- src/wizard.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wizard.cpp b/src/wizard.cpp index 7cdefed7..fdd947f8 100644 --- a/src/wizard.cpp +++ b/src/wizard.cpp @@ -143,6 +143,7 @@ void Wizard::checkMltComponents() { avformatItem->setIcon(0, okIcon); // Make sure we have MLT > 0.3.4 bool recentMlt = false; + int version = 0; QString exepath = KStandardDirs::findExe("pkg-config"); if (!exepath.isEmpty()) { checkProcess.start(exepath, QStringList() << "--variable=version" << "mlt-framework"); @@ -151,11 +152,12 @@ void Wizard::checkMltComponents() { } else { checkProcess.waitForFinished(); QString mltVersion = checkProcess.readAllStandardOutput(); - int version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt(); + version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt(); kDebug() << "// FOUND MLT's pkgconfig version: " << version; if (version > 34) recentMlt = true; } - } else { + } + if (version == 0) { checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "--version"); if (!checkProcess.waitForStarted()) { kDebug() << "// Error querying MLT's version"; @@ -164,7 +166,7 @@ void Wizard::checkMltComponents() { QString mltVersion = checkProcess.readAllStandardError(); mltVersion = mltVersion.section("\n", 0, 0).simplified(); mltVersion = mltVersion.section(' ', -1).simplified(); - int version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt(); + version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt(); kDebug() << "// FOUND MLT version: " << version; if (version > 34) recentMlt = true; } -- 2.39.5