Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
01f6e42d
Commit
01f6e42d
authored
Dec 02, 2020
by
Jean-Baptiste Mardelle
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix several slideshows incorrectly share same thumbnail if in same folder
parent
bfff60a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
src/bin/projectclip.cpp
src/bin/projectclip.cpp
+4
-3
src/bin/projectclip.h
src/bin/projectclip.h
+1
-1
src/doc/documentchecker.cpp
src/doc/documentchecker.cpp
+5
-3
No files found.
src/bin/projectclip.cpp
View file @
01f6e42d
...
...
@@ -986,9 +986,10 @@ const QString ProjectClip::hash()
return
getFileHash
();
}
const
QByteArray
ProjectClip
::
getFolderHash
(
QDir
dir
)
const
QByteArray
ProjectClip
::
getFolderHash
(
QDir
dir
,
QString
fileName
)
{
QByteArray
fileData
=
dir
.
entryList
(
QDir
::
Files
).
join
(
QLatin1Char
(
','
)).
toUtf8
();
fileName
.
append
(
dir
.
entryList
(
QDir
::
Files
).
join
(
QLatin1Char
(
','
)));
QByteArray
fileData
=
fileName
.
toUtf8
();
return
QCryptographicHash
::
hash
(
fileData
,
QCryptographicHash
::
Md5
);
}
...
...
@@ -998,7 +999,7 @@ const QString ProjectClip::getFileHash()
QByteArray
fileHash
;
switch
(
m_clipType
)
{
case
ClipType
::
SlideShow
:
fileHash
=
getFolderHash
(
QFileInfo
(
clipUrl
()).
absoluteDir
());
fileHash
=
getFolderHash
(
QFileInfo
(
clipUrl
()).
absoluteDir
()
,
QFileInfo
(
clipUrl
()).
fileName
()
);
break
;
case
ClipType
::
Text
:
fileData
=
getProducerProperty
(
QStringLiteral
(
"xmldata"
)).
toUtf8
();
...
...
src/bin/projectclip.h
View file @
01f6e42d
...
...
@@ -244,7 +244,7 @@ public:
/** @brief Get the list of audio stream effects for a defined stream. */
QStringList
getAudioStreamEffect
(
int
streamIndex
)
const
override
;
/** @brief Calculate the folder's hash (based on the files it contains). */
static
const
QByteArray
getFolderHash
(
QDir
dir
);
static
const
QByteArray
getFolderHash
(
QDir
dir
,
QString
fileName
);
/** @brief Check if the clip is included in timeline and reset its occurences on producer reload. */
void
updateTimelineOnReload
();
...
...
src/doc/documentchecker.cpp
View file @
01f6e42d
...
...
@@ -294,9 +294,11 @@ bool DocumentChecker::hasErrorInClips()
continue
;
}
// Check for slideshows
QString
slidePattern
;
bool
slideshow
=
resource
.
contains
(
QStringLiteral
(
"/.all."
))
||
resource
.
contains
(
QLatin1Char
(
'?'
))
||
resource
.
contains
(
QLatin1Char
(
'%'
));
if
(
slideshow
)
{
if
(
service
==
QLatin1String
(
"qimage"
)
||
service
==
QLatin1String
(
"pixbuf"
))
{
slidePattern
=
QFileInfo
(
resource
).
fileName
();
resource
=
QFileInfo
(
resource
).
absolutePath
();
}
else
if
(
service
.
startsWith
(
QLatin1String
(
"avformat"
))
&&
Xml
::
hasXmlProperty
(
e
,
QStringLiteral
(
"ttl"
)))
{
// Fix MLT 6.20 avformat slideshows
...
...
@@ -332,7 +334,7 @@ bool DocumentChecker::hasErrorInClips()
// Check if file changed
const
QByteArray
hash
=
Xml
::
getXmlProperty
(
e
,
"kdenlive:file_hash"
).
toLatin1
();
if
(
!
hash
.
isEmpty
())
{
const
QByteArray
fileData
=
slideshow
?
ProjectClip
::
getFolderHash
(
QDir
(
resource
)).
toHex
()
:
ProjectClip
::
calculateHash
(
resource
).
first
.
toHex
();
const
QByteArray
fileData
=
slideshow
?
ProjectClip
::
getFolderHash
(
QDir
(
resource
)
,
slidePattern
).
toHex
()
:
ProjectClip
::
calculateHash
(
resource
).
first
.
toHex
();
if
(
hash
!=
fileData
)
{
// For slideshow clips, silently upgrade hash
if
(
slideshow
)
{
...
...
@@ -1019,7 +1021,7 @@ QString DocumentChecker::searchDirRecursively(const QDir &dir, const QString &ma
QStringList
filesAndDirs
;
QString
fileName
=
QFileInfo
(
fullName
).
fileName
();
// Check main dir
QString
fileHash
=
ProjectClip
::
getFolderHash
(
dir
).
toHex
();
QString
fileHash
=
ProjectClip
::
getFolderHash
(
dir
,
fileName
).
toHex
();
if
(
fileHash
==
matchHash
)
{
return
dir
.
absoluteFilePath
(
fileName
);
}
...
...
@@ -1027,7 +1029,7 @@ QString DocumentChecker::searchDirRecursively(const QDir &dir, const QString &ma
const
QStringList
subDirs
=
dir
.
entryList
(
QDir
::
AllDirs
|
QDir
::
NoDot
|
QDir
::
NoDotDot
);
for
(
const
QString
&
sub
:
subDirs
)
{
QDir
subFolder
(
dir
.
absoluteFilePath
(
sub
));
fileHash
=
ProjectClip
::
getFolderHash
(
subFolder
).
toHex
();
fileHash
=
ProjectClip
::
getFolderHash
(
subFolder
,
fileName
).
toHex
();
if
(
fileHash
==
matchHash
)
{
return
subFolder
.
absoluteFilePath
(
fileName
);
}
...
...
Eugen Mohr
@emohr
mentioned in issue
#779 (closed)
·
Dec 03, 2020
mentioned in issue
#779 (closed)
mentioned in issue #779
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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