]> git.sesse.net Git - kdenlive/commitdiff
Fix detection of MLT's version when pkgconfig info is not present
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 11 Feb 2009 12:25:11 +0000 (12:25 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 11 Feb 2009 12:25:11 +0000 (12:25 +0000)
svn path=/branches/KDE4/; revision=3045

src/wizard.cpp

index 7cdefed7438259649974c23ec6dfb13fd1ff92ea..fdd947f8a0d0cb73f1495de38c4c381b2895e998 100644 (file)
@@ -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;
                 }