Commit 40ed4ba3 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Attempt to find Fedora's renamed melt

Fixes #106
BUG: 5192
parent c101f8ca
......@@ -64,21 +64,27 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
{
QString profilePath = mltPath;
// environment variables should override other settings
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_PROFILES_PATH")) profilePath = qgetenv("MLT_PROFILES_PATH");
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_DATA"))
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_PROFILES_PATH")) {
profilePath = qgetenv("MLT_PROFILES_PATH");
}
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_DATA")) {
profilePath = qgetenv("MLT_DATA") + QStringLiteral("/profiles");
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_PREFIX"))
}
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_PREFIX")) {
profilePath = qgetenv("MLT_PREFIX") + QStringLiteral("/share/mlt/profiles");
}
#ifndef Q_OS_WIN
// stored setting should not be considered on windows as MLT is distributed with each new Kdenlive version
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && !KdenliveSettings::mltpath().isEmpty()) profilePath = KdenliveSettings::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))
if (profilePath.isEmpty() || !QFile::exists(profilePath)) {
profilePath = QDir::cleanPath(qApp->applicationDirPath() + QStringLiteral("/../share/mlt/profiles"));
}
// fallback to build-time definition
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && !QStringLiteral(MLT_DATADIR).isEmpty())
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && !QStringLiteral(MLT_DATADIR).isEmpty()) {
profilePath = QStringLiteral(MLT_DATADIR) + QStringLiteral("/profiles");
}
KdenliveSettings::setMltpath(profilePath);
#ifdef Q_OS_WIN
......@@ -96,6 +102,9 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
meltPath = QDir::cleanPath(profilePath + QStringLiteral("/../../../bin/melt")) + exeSuffix;
if (!QFile::exists(meltPath)) {
meltPath = QStandardPaths::findExecutable("melt");
if (meltPath.isEmpty()) {
meltPath = QStandardPaths::findExecutable("mlt-melt");
}
}
}
KdenliveSettings::setRendererpath(meltPath);
......
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