Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
c3f44abd
Commit
c3f44abd
authored
Aug 02, 2021
by
Jean-Baptiste Mardelle
Browse files
Merge branch 'release/21.08' of invent.kde.org:multimedia/kdenlive into 2108
parents
f1ebdba6
e84437b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/mltconnection.cpp
View file @
c3f44abd
...
...
@@ -106,6 +106,15 @@ std::unique_ptr<MltConnection> &MltConnection::self()
void
MltConnection
::
locateMeltAndProfilesPath
(
const
QString
&
mltPath
)
{
QString
profilePath
=
mltPath
;
QString
appName
;
QString
libName
;
#ifdef Q_OS_WIN
appName
=
QStringLiteral
(
"melt"
);
libName
=
QStringLiteral
(
"mlt"
);
#else
appName
=
QStringLiteral
(
"melt-7"
);
libName
=
QStringLiteral
(
"mlt-7"
);
#endif
// environment variables should override other settings
if
((
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
&&
qEnvironmentVariableIsSet
(
"MLT_PROFILES_PATH"
))
{
profilePath
=
qgetenv
(
"MLT_PROFILES_PATH"
);
...
...
@@ -114,7 +123,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-7
/profiles"
);
profilePath
=
qgetenv
(
"MLT_PREFIX"
)
+
QStringLiteral
(
"/share/
%1
/profiles"
)
.
arg
(
libName
)
;
}
#ifndef Q_OS_WIN
// stored setting should not be considered on windows as MLT is distributed with each new Kdenlive version
...
...
@@ -122,7 +131,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-7
/profiles"
));
profilePath
=
QDir
::
cleanPath
(
qApp
->
applicationDirPath
()
+
QStringLiteral
(
"/../share/
%1
/profiles"
)
.
arg
(
libName
)
);
}
// fallback to build-time definition
if
((
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
&&
!
QStringLiteral
(
MLT_DATADIR
).
isEmpty
())
{
...
...
@@ -137,14 +146,14 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
#endif
QString
meltPath
;
if
(
qEnvironmentVariableIsSet
(
"MLT_PREFIX"
))
{
meltPath
=
qgetenv
(
"MLT_PREFIX"
)
+
QStringLiteral
(
"/bin/
melt-7"
)
+
exeSuffix
;
meltPath
=
qgetenv
(
"MLT_PREFIX"
)
+
QStringLiteral
(
"/bin/
%1"
).
arg
(
appName
)
+
exeSuffix
;
}
else
{
meltPath
=
KdenliveSettings
::
rendererpath
();
}
if
(
!
QFile
::
exists
(
meltPath
))
{
meltPath
=
QDir
::
cleanPath
(
profilePath
+
QStringLiteral
(
"/../../../bin/
melt-7"
))
+
exeSuffix
;
meltPath
=
QDir
::
cleanPath
(
profilePath
+
QStringLiteral
(
"/../../../bin/
%1"
).
arg
(
appName
))
+
exeSuffix
;
if
(
!
QFile
::
exists
(
meltPath
))
{
meltPath
=
QStandardPaths
::
findExecutable
(
"melt-7"
);
meltPath
=
QStandardPaths
::
findExecutable
(
appName
);
if
(
meltPath
.
isEmpty
())
{
meltPath
=
QStandardPaths
::
findExecutable
(
"mlt-melt"
);
}
...
...
@@ -168,7 +177,7 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
}
}
if
(
profilePath
.
isEmpty
())
{
profilePath
=
QDir
::
cleanPath
(
meltPath
+
QStringLiteral
(
"/../../share/
mlt-7
/profiles"
));
profilePath
=
QDir
::
cleanPath
(
meltPath
+
QStringLiteral
(
"/../../share/
%1
/profiles"
)
.
arg
(
libName
)
);
KdenliveSettings
::
setMltpath
(
profilePath
);
}
QStringList
profilesFilter
;
...
...
@@ -178,11 +187,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-7
/profiles"
);
profilePath
=
meltPath
.
section
(
QLatin1Char
(
'/'
),
0
,
-
2
)
+
QStringLiteral
(
"/share/
%1
/profiles"
)
.
arg
(
libName
)
;
}
else
{
profilePath
=
qApp
->
applicationDirPath
()
+
QStringLiteral
(
"/share/
mlt-7
/profiles"
);
profilePath
=
qApp
->
applicationDirPath
()
+
QStringLiteral
(
"/share/
%1
/profiles"
)
.
arg
(
libName
)
;
}
profilePath
=
QStringLiteral
(
"/usr/local/share/
mlt-7
/profiles"
);
profilePath
=
QStringLiteral
(
"/usr/local/share/
%1
/profiles"
)
.
arg
(
libName
)
;
KdenliveSettings
::
setMltpath
(
profilePath
);
profilesList
=
QDir
(
profilePath
).
entryList
(
profilesFilter
,
QDir
::
Files
);
}
...
...
src/project/projectmanager.cpp
View file @
c3f44abd
...
...
@@ -982,6 +982,9 @@ bool ProjectManager::updateTimeline(int pos, int scrollPos)
int
activeTrackPosition
=
m_project
->
getDocumentProperty
(
QStringLiteral
(
"activeTrack"
),
QString
::
number
(
-
1
)).
toInt
();
if
(
activeTrackPosition
>
-
1
&&
activeTrackPosition
<
m_mainTimelineModel
->
getTracksCount
())
{
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
setActiveTrack
(
m_mainTimelineModel
->
getTrackIndexFromPosition
(
activeTrackPosition
));
}
else
{
// Subtitle model track was active
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
setActiveTrack
(
activeTrackPosition
);
}
m_mainTimelineModel
->
setUndoStack
(
m_project
->
commandStack
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment