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
8a902fd4
Commit
8a902fd4
authored
Aug 24, 2022
by
Jean-Baptiste Mardelle
Browse files
Ensure queued tasks are not started on project or test close
parent
62004640
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/bin/projectitemmodel.cpp
View file @
8a902fd4
...
...
@@ -23,6 +23,7 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include
"projectclip.h"
#include
"projectfolder.h"
#include
"projectsubclip.h"
#include
"utils/thumbnailcache.hpp"
#include
"xml/xml.hpp"
#include
<KLocalizedString>
...
...
@@ -512,7 +513,7 @@ QStringList ProjectItemModel::getEnclosingFolderInfo(const QModelIndex &index) c
void
ProjectItemModel
::
clean
()
{
QWriteLocker
locker
(
&
m_lock
);
//
QWriteLocker locker(&m_lock);
std
::
vector
<
std
::
shared_ptr
<
AbstractProjectItem
>>
toDelete
;
toDelete
.
reserve
(
size_t
(
rootItem
->
childCount
()));
for
(
int
i
=
0
;
i
<
rootItem
->
childCount
();
++
i
)
{
...
...
@@ -527,6 +528,7 @@ void ProjectItemModel::clean()
m_nextId
=
1
;
m_uuid
=
QUuid
::
createUuid
();
m_fileWatcher
->
clear
();
ThumbnailCache
::
get
()
->
clearCache
();
}
std
::
shared_ptr
<
ProjectFolder
>
ProjectItemModel
::
getRootFolder
()
const
...
...
src/jobs/cliploadtask.cpp
View file @
8a902fd4
...
...
@@ -286,13 +286,18 @@ void ClipLoadTask::generateThumbnail(std::shared_ptr<ProjectClip> binClip, std::
p
.
drawText
(
0
,
0
,
fullWidth
,
imageHeight
,
Qt
::
AlignCenter
,
i18n
(
"Invalid"
));
QMetaObject
::
invokeMethod
(
binClip
.
get
(),
"setThumbnail"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QImage
,
result
),
Q_ARG
(
int
,
m_in
),
Q_ARG
(
int
,
m_out
),
Q_ARG
(
bool
,
false
));
}
else
if
(
binClip
.
get
())
{
}
else
if
(
binClip
.
get
()
&&
!
m_isCanceled
)
{
// We don't follow m_isCanceled there,
qDebug
()
<<
"=== GOT THUMB FOR: "
<<
m_in
<<
"x"
<<
m_out
;
QMetaObject
::
invokeMethod
(
binClip
.
get
(),
"setThumbnail"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QImage
,
result
),
Q_ARG
(
int
,
m_in
),
Q_ARG
(
int
,
m_out
),
Q_ARG
(
bool
,
false
));
ThumbnailCache
::
get
()
->
storeThumbnail
(
QString
::
number
(
m_owner
.
second
),
frameNumber
,
result
,
false
);
}
if
(
m_isCanceled
)
{
abort
();
}
else
{
pCore
->
taskManager
.
taskDone
(
m_owner
.
second
,
this
);
}
}
}
}
...
...
@@ -301,19 +306,20 @@ void ClipLoadTask::generateThumbnail(std::shared_ptr<ProjectClip> binClip, std::
void
ClipLoadTask
::
run
()
{
// 2 channels interleaved of uchar values
if
(
m_isCanceled
)
{
if
(
m_isCanceled
||
pCore
->
taskManager
.
isBlocked
())
{
abort
();
return
;
}
// QThread::currentThread()->setPriority(QThread::HighestPriority);
if
(
m_thumbOnly
)
{
auto
binClip
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
QString
::
number
(
m_owner
.
second
));
if
(
binClip
)
{
if
(
binClip
&&
binClip
->
statusReady
()
)
{
generateThumbnail
(
binClip
,
binClip
->
originalProducer
());
return
;
}
else
{
pCore
->
taskManager
.
taskDone
(
m_owner
.
second
,
this
);
return
;
}
pCore
->
taskManager
.
taskDone
(
m_owner
.
second
,
this
);
return
;
}
m_running
=
true
;
emit
pCore
->
projectItemModel
()
->
resetPlayOrLoopZone
(
QString
::
number
(
m_owner
.
second
));
...
...
src/jobs/taskmanager.cpp
View file @
8a902fd4
...
...
@@ -147,6 +147,7 @@ void TaskManager::slotCancelJobs(const QVector<AbstractTask::JOBTYPE> exceptions
m_taskPool
.
waitForDone
();
m_transcodePool
.
waitForDone
();
}
m_taskList
.
clear
();
m_blockUpdates
=
false
;
updateJobCount
();
}
...
...
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