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
daac6b50
Commit
daac6b50
authored
Feb 24, 2022
by
Jean-Baptiste Mardelle
Browse files
On project close, ensure non loaded clips don't leak to the new project (part 2)
parent
646a4d1f
Pipeline
#141938
passed with stage
in 14 minutes and 52 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/clipcreator.cpp
View file @
daac6b50
...
...
@@ -215,6 +215,7 @@ const QString ClipCreator::createClipsFromList(const QList<QUrl> &list, bool che
QList
<
QUrl
>
cleanList
;
QStringList
duplicates
;
bool
firstClip
=
topLevel
;
const
QUuid
uuid
=
model
->
uuid
();
pCore
->
bin
()
->
shouldCheckProfile
=
(
KdenliveSettings
::
default_profile
().
isEmpty
()
||
KdenliveSettings
::
checkfirstprojectclip
())
&&
pCore
->
bin
()
->
isEmpty
();
for
(
const
QUrl
&
url
:
list
)
{
if
(
!
pCore
->
projectItemModel
()
->
urlExists
(
url
.
toLocalFile
())
||
QFileInfo
(
url
.
toLocalFile
()).
isDir
())
{
...
...
@@ -238,6 +239,11 @@ const QString ClipCreator::createClipsFromList(const QList<QUrl> &list, bool che
int
current
=
0
;
for
(
const
QUrl
&
file
:
qAsConst
(
cleanList
))
{
current
++
;
if
(
model
->
uuid
()
!=
uuid
)
{
// Project was closed, abort
pCore
->
displayMessage
(
QString
(),
OperationCompletedMessage
,
100
);
return
QString
();
}
if
(
!
QFile
::
exists
(
file
.
toLocalFile
()))
{
continue
;
}
...
...
@@ -358,6 +364,11 @@ const QString ClipCreator::createClipsFromList(const QList<QUrl> &list, bool che
};
firstClip
=
false
;
}
if
(
model
->
uuid
()
!=
uuid
)
{
// Project was closed, abort
pCore
->
displayMessage
(
QString
(),
OperationCompletedMessage
,
100
);
return
QString
();
}
const
QString
clipId
=
ClipCreator
::
createClipFromFile
(
file
.
toLocalFile
(),
parentFolder
,
model
,
undo
,
redo
,
callBack
);
if
(
createdItem
.
isEmpty
()
&&
clipId
!=
QLatin1String
(
"-1"
))
{
createdItem
=
clipId
;
...
...
src/bin/projectitemmodel.cpp
View file @
daac6b50
...
...
@@ -42,6 +42,7 @@ ProjectItemModel::ProjectItemModel(QObject *parent)
,
m_nextId
(
1
)
,
m_blankThumb
()
,
m_dragType
(
PlaylistState
::
Disabled
)
,
m_uuid
(
QUuid
::
createUuid
())
{
QPixmap
pix
(
QSize
(
160
,
90
));
pix
.
fill
(
Qt
::
lightGray
);
...
...
@@ -514,6 +515,7 @@ void ProjectItemModel::clean()
}
Q_ASSERT
(
rootItem
->
childCount
()
==
0
);
m_nextId
=
1
;
m_uuid
=
QUuid
::
createUuid
();
m_fileWatcher
->
clear
();
}
...
...
src/bin/projectitemmodel.h
View file @
daac6b50
...
...
@@ -18,6 +18,7 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include <QIcon>
#include <QReadWriteLock>
#include <QSize>
#include <QUuid>
class
AbstractProjectItem
;
class
BinPlaylist
;
...
...
@@ -206,6 +207,8 @@ public:
int
clipsCount
()
const
;
/** @brief Check if a file is already in Bin */
bool
urlExists
(
const
QString
&
path
)
const
;
/** @brief Check if a file is already in Bin */
Julius Künzel
@jlskuz
·
Feb 25, 2022
Developer
This description seems to be wrong
This description seems to be wrong
Please
register
or
sign in
to reply
QUuid
uuid
()
const
{
return
m_uuid
;
};
protected:
/** @brief Register the existence of a new element
...
...
@@ -247,6 +250,8 @@ private:
int
m_nextId
;
QIcon
m_blankThumb
;
PlaylistState
::
ClipState
m_dragType
;
QUuid
m_uuid
;
signals:
/** @brief thumbs of the given clip were modified, request update of the monitor if need be */
void
refreshAudioThumbs
(
const
QString
&
id
);
...
...
src/jobs/taskmanager.cpp
View file @
daac6b50
...
...
@@ -139,7 +139,6 @@ void TaskManager::slotCancelJobs()
void
TaskManager
::
startTask
(
int
ownerId
,
AbstractTask
*
task
)
{
m_tasksListLock
.
lockForWrite
();
qDebug
()
<<
"========== STARTING TASK FOR: "
<<
ownerId
;
if
(
m_taskList
.
find
(
ownerId
)
==
m_taskList
.
end
())
{
// First task for this clip
m_taskList
[
ownerId
]
=
{
task
};
...
...
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