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
27844e35
Commit
27844e35
authored
Nov 27, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix crash closing document with grouped subtitles
parent
3a77973e
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
27844e35
...
...
@@ -1670,7 +1670,7 @@ void Bin::setMonitor(Monitor *monitor)
});
}
void
Bin
::
set
Document
(
KdenliveDoc
*
project
)
void
Bin
::
clean
Document
()
{
blockSignals
(
true
);
if
(
m_proxyModel
)
{
...
...
@@ -1684,6 +1684,10 @@ void Bin::setDocument(KdenliveDoc *project)
m_itemModel
->
clean
();
delete
m_itemView
;
m_itemView
=
nullptr
;
}
void
Bin
::
setDocument
(
KdenliveDoc
*
project
)
{
m_doc
=
project
;
m_infoLabel
->
slotSetJobCount
(
0
);
int
iconHeight
=
QFontInfo
(
font
()).
pixelSize
()
*
3.5
;
...
...
@@ -4105,9 +4109,9 @@ void Bin::setCurrent(const std::shared_ptr<AbstractProjectItem> &item)
}
}
void
Bin
::
cleanup
()
void
Bin
::
cleanup
Unused
()
{
m_itemModel
->
requestCleanup
();
m_itemModel
->
requestCleanup
Unused
();
}
std
::
shared_ptr
<
EffectStackModel
>
Bin
::
getClipEffectStack
(
int
itemId
)
...
...
src/bin/bin.h
View file @
27844e35
...
...
@@ -178,6 +178,8 @@ public:
/** @brief Sets the document for the bin and initialize some stuff */
void
setDocument
(
KdenliveDoc
*
project
);
/** @brief Delete all project related data, to be called before setDocument */
void
cleanDocument
();
/** @brief Create a clip item from its xml description */
void
createClip
(
const
QDomElement
&
xml
);
...
...
@@ -298,7 +300,7 @@ public:
QList
<
int
>
getUsedClipIds
();
// TODO refac: remove this and call directly the function in ProjectItemModel
void
cleanup
();
void
cleanup
Unused
();
void
selectAll
();
private
slots
:
...
...
src/bin/projectitemmodel.cpp
View file @
27844e35
...
...
@@ -853,7 +853,7 @@ bool ProjectItemModel::requestRenameFolder(std::shared_ptr<AbstractProjectItem>
return
res
;
}
bool
ProjectItemModel
::
requestCleanup
()
bool
ProjectItemModel
::
requestCleanup
Unused
()
{
QWriteLocker
locker
(
&
m_lock
);
Fun
undo
=
[]()
{
return
true
;
};
...
...
src/bin/projectitemmodel.h
View file @
27844e35
...
...
@@ -185,7 +185,7 @@ public:
bool
requestRenameFolder
(
std
::
shared_ptr
<
AbstractProjectItem
>
folder
,
const
QString
&
name
);
/* @brief Request that the unused clips are deleted */
bool
requestCleanup
();
bool
requestCleanup
Unused
();
/* @brief Retrieves the next id available for attribution to a folder */
int
getFreeFolderId
();
...
...
src/mainwindow.cpp
View file @
27844e35
...
...
@@ -2149,7 +2149,7 @@ void MainWindow::slotCleanProject()
KMessageBox
::
Cancel
)
{
return
;
}
pCore
->
bin
()
->
cleanup
();
pCore
->
bin
()
->
cleanup
Unused
();
}
void
MainWindow
::
slotUpdateMousePosition
(
int
pos
)
...
...
src/project/projectmanager.cpp
View file @
27844e35
...
...
@@ -218,6 +218,7 @@ void ProjectManager::newFile(QString profileName, bool showProjectSettings)
}
bool
openBackup
;
m_notesPlugin
->
clear
();
pCore
->
bin
()
->
cleanDocument
();
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
QUrl
(),
projectFolder
,
pCore
->
window
()
->
m_commandStack
,
profileName
,
documentProperties
,
documentMetadata
,
projectTracks
,
audioChannels
,
&
openBackup
,
pCore
->
window
());
doc
->
m_autosave
=
new
KAutoSaveFile
(
startFile
,
doc
);
ThumbnailCache
::
get
()
->
clearCache
();
...
...
@@ -269,16 +270,21 @@ bool ProjectManager::closeCurrentDocument(bool saveChanges, bool quit)
pCore
->
jobManager
()
->
slotCancelJobs
();
disconnect
(
pCore
->
window
()
->
getMainTimeline
()
->
controller
(),
&
TimelineController
::
durationChanged
,
this
,
&
ProjectManager
::
adjustProjectDuration
);
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
clipActions
.
clear
();
if
(
!
quit
&&
!
qApp
->
isSavingSession
())
{
m_autoSaveTimer
.
stop
();
if
(
m_project
)
{
pCore
->
jobManager
()
->
slotCancelJobs
();
pCore
->
bin
()
->
abortOperations
();
}
}
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
prepareClose
();
pCore
->
bin
()
->
cleanDocument
();
pCore
->
window
()
->
resetSubtitles
();
if
(
m_mainTimelineModel
)
{
m_mainTimelineModel
->
prepareClose
();
}
if
(
!
quit
&&
!
qApp
->
isSavingSession
())
{
m_autoSaveTimer
.
stop
();
if
(
m_project
)
{
pCore
->
jobManager
()
->
slotCancelJobs
();
pCore
->
bin
()
->
abortOperations
();
pCore
->
monitorManager
()
->
clipMonitor
()
->
slotOpenClip
(
nullptr
);
emit
pCore
->
window
()
->
clearAssetPanel
();
delete
m_project
;
...
...
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