Commit e484320e authored by Julius Künzel's avatar Julius Künzel
Browse files

mlt7: fix automated mlt detection

Related to #991
parent 55c39948
Pipeline #58813 failed with stage
in 1 minute and 28 seconds
......@@ -113,7 +113,7 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
profilePath = qgetenv("MLT_DATA") + QStringLiteral("/profiles");
}
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_PREFIX")) {
profilePath = qgetenv("MLT_PREFIX") + QStringLiteral("/share/mlt/profiles");
profilePath = qgetenv("MLT_PREFIX") + QStringLiteral("/share/mlt-7/profiles");
}
#ifndef Q_OS_WIN
// stored setting should not be considered on windows as MLT is distributed with each new Kdenlive version
......@@ -121,7 +121,7 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
#endif
// try to automatically guess MLT path if installed with the same prefix as kdenlive with default data path
if (profilePath.isEmpty() || !QFile::exists(profilePath)) {
profilePath = QDir::cleanPath(qApp->applicationDirPath() + QStringLiteral("/../share/mlt/profiles"));
profilePath = QDir::cleanPath(qApp->applicationDirPath() + QStringLiteral("/../share/mlt-7/profiles"));
}
// fallback to build-time definition
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && !QStringLiteral(MLT_DATADIR).isEmpty()) {
......@@ -136,14 +136,14 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
#endif
QString meltPath;
if (qEnvironmentVariableIsSet("MLT_PREFIX")) {
meltPath = qgetenv("MLT_PREFIX") + QStringLiteral("/bin/melt") + exeSuffix;
meltPath = qgetenv("MLT_PREFIX") + QStringLiteral("/bin/melt-7") + exeSuffix;
} else {
meltPath = KdenliveSettings::rendererpath();
}
if (!QFile::exists(meltPath)) {
meltPath = QDir::cleanPath(profilePath + QStringLiteral("/../../../bin/melt")) + exeSuffix;
meltPath = QDir::cleanPath(profilePath + QStringLiteral("/../../../bin/melt-7")) + exeSuffix;
if (!QFile::exists(meltPath)) {
meltPath = QStandardPaths::findExecutable("melt");
meltPath = QStandardPaths::findExecutable("melt-7");
if (meltPath.isEmpty()) {
meltPath = QStandardPaths::findExecutable("mlt-melt");
}
......@@ -167,7 +167,7 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
}
}
if (profilePath.isEmpty()) {
profilePath = QDir::cleanPath(meltPath + QStringLiteral("/../../share/mlt/profiles"));
profilePath = QDir::cleanPath(meltPath + QStringLiteral("/../../share/mlt-7/profiles"));
KdenliveSettings::setMltpath(profilePath);
}
QStringList profilesFilter;
......@@ -177,11 +177,11 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
// Cannot find MLT path, try finding melt
if (!meltPath.isEmpty()) {
if (meltPath.contains(QLatin1Char('/'))) {
profilePath = meltPath.section(QLatin1Char('/'), 0, -2) + QStringLiteral("/share/mlt/profiles");
profilePath = meltPath.section(QLatin1Char('/'), 0, -2) + QStringLiteral("/share/mlt-7/profiles");
} else {
profilePath = qApp->applicationDirPath() + QStringLiteral("/share/mlt/profiles");
profilePath = qApp->applicationDirPath() + QStringLiteral("/share/mlt-7/profiles");
}
profilePath = QStringLiteral("/usr/local/share/mlt/profiles");
profilePath = QStringLiteral("/usr/local/share/mlt-7/profiles");
KdenliveSettings::setMltpath(profilePath);
profilesList = QDir(profilePath).entryList(profilesFilter, QDir::Files);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment