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
fdaa4321
Commit
fdaa4321
authored
Jul 12, 2020
by
Jean-Baptiste Mardelle
Browse files
When dropping a folder from a file manager to bin, don't create folders that contain no valid clip
parent
304e5a09
Pipeline
#26839
passed with stage
in 10 minutes and 18 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/bin/clipcreator.cpp
View file @
fdaa4321
...
...
@@ -236,11 +236,6 @@ const QString ClipCreator::createClipsFromList(const QList<QUrl> &list, bool che
QString
folderId
;
Fun
local_undo
=
[]()
{
return
true
;
};
Fun
local_redo
=
[]()
{
return
true
;
};
bool
folderCreated
=
pCore
->
projectItemModel
()
->
requestAddFolder
(
folderId
,
dir
.
dirName
(),
parentFolder
,
local_undo
,
local_redo
);
if
(
!
folderCreated
)
{
continue
;
}
createdItem
=
folderId
;
QStringList
result
=
dir
.
entryList
(
QDir
::
Files
);
QStringList
subfolders
=
dir
.
entryList
(
QDir
::
Dirs
|
QDir
::
NoDotAndDotDot
);
QList
<
QUrl
>
folderFiles
;
...
...
@@ -272,6 +267,12 @@ const QString ClipCreator::createClipsFromList(const QList<QUrl> &list, bool che
}
}
if
(
!
sublist
.
isEmpty
())
{
// Create main folder
bool
folderCreated
=
pCore
->
projectItemModel
()
->
requestAddFolder
(
folderId
,
dir
.
dirName
(),
parentFolder
,
local_undo
,
local_redo
);
if
(
!
folderCreated
)
{
continue
;
}
createdItem
=
folderId
;
// load subfolders
const
QString
clipId
=
createClipsFromList
(
sublist
,
checkRemovable
,
folderId
,
model
,
undo
,
redo
,
false
);
if
(
createdItem
.
isEmpty
()
&&
clipId
!=
QLatin1String
(
"-1"
))
{
...
...
@@ -279,6 +280,12 @@ const QString ClipCreator::createClipsFromList(const QList<QUrl> &list, bool che
}
}
}
else
{
// Create main folder
bool
folderCreated
=
pCore
->
projectItemModel
()
->
requestAddFolder
(
folderId
,
dir
.
dirName
(),
parentFolder
,
local_undo
,
local_redo
);
if
(
!
folderCreated
)
{
continue
;
}
createdItem
=
folderId
;
const
QString
clipId
=
createClipsFromList
(
folderFiles
,
checkRemovable
,
folderId
,
model
,
local_undo
,
local_redo
,
false
);
if
(
clipId
.
isEmpty
()
||
clipId
==
QLatin1String
(
"-1"
))
{
local_undo
();
...
...
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