Skip to content
GitLab
Menu
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
16b177c6
Commit
16b177c6
authored
May 30, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix file watcher broken, changed clips were not detected anymore
Fixes
#1444
parent
bfab72ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/filewatcher.cpp
View file @
16b177c6
...
...
@@ -71,7 +71,7 @@ void FileWatcher::removeFile(const QString &binId)
m_occurences
[
url
].
erase
(
binId
);
m_binClipPaths
.
erase
(
binId
);
if
(
m_occurences
[
url
].
empty
())
{
KDirWatch
::
self
()
->
removeFile
(
url
);
m_fileWatcher
->
removeFile
(
url
);
m_occurences
.
erase
(
url
);
}
}
...
...
@@ -106,7 +106,7 @@ void FileWatcher::slotProcessModifiedUrls()
{
auto
checkList
=
m_modifiedUrls
;
for
(
const
QString
&
path
:
checkList
)
{
if
(
KDirWatch
::
self
()
->
ctime
(
path
).
msecsTo
(
QDateTime
::
currentDateTime
())
>
2000
)
{
if
(
m_fileWatcher
->
ctime
(
path
).
msecsTo
(
QDateTime
::
currentDateTime
())
>
2000
)
{
for
(
const
QString
&
id
:
m_occurences
[
path
])
{
emit
binClipModified
(
id
);
}
...
...
@@ -120,17 +120,17 @@ void FileWatcher::slotProcessModifiedUrls()
void
FileWatcher
::
clear
()
{
KDirWatch
::
self
()
->
stopScan
();
m_fileWatcher
->
stopScan
();
for
(
const
auto
&
f
:
m_occurences
)
{
KDirWatch
::
self
()
->
removeFile
(
f
.
first
);
m_fileWatcher
->
removeFile
(
f
.
first
);
}
m_occurences
.
clear
();
m_modifiedUrls
.
clear
();
m_binClipPaths
.
clear
();
KDirWatch
::
self
()
->
startScan
();
m_fileWatcher
->
startScan
();
}
bool
FileWatcher
::
contains
(
const
QString
&
path
)
const
{
return
KDirWatch
::
self
()
->
contains
(
path
);
return
m_fileWatcher
->
contains
(
path
);
}
Write
Preview
Supports
Markdown
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