Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
261
Issues
261
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
6e639f6a
Commit
6e639f6a
authored
Nov 20, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash on adding first subtitle from subtitle widget
parent
46dd76e4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
src/core.cpp
src/core.cpp
+7
-2
src/core.h
src/core.h
+1
-1
src/timeline2/view/timelinecontroller.cpp
src/timeline2/view/timelinecontroller.cpp
+1
-1
No files found.
src/core.cpp
View file @
6e639f6a
...
...
@@ -283,10 +283,15 @@ void Core::selectTimelineItem(int id)
}
}
std
::
shared_ptr
<
SubtitleModel
>
Core
::
getSubtitleModel
()
std
::
shared_ptr
<
SubtitleModel
>
Core
::
getSubtitleModel
(
bool
enforce
)
{
if
(
m_guiConstructed
&&
m_mainWindow
->
getCurrentTimeline
()
->
controller
()
->
getModel
())
{
return
m_mainWindow
->
getCurrentTimeline
()
->
controller
()
->
getModel
()
->
getSubtitleModel
();
auto
subModel
=
m_mainWindow
->
getCurrentTimeline
()
->
controller
()
->
getModel
()
->
getSubtitleModel
();
if
(
enforce
&&
subModel
==
nullptr
)
{
m_mainWindow
->
slotEditSubtitle
();
subModel
=
m_mainWindow
->
getCurrentTimeline
()
->
controller
()
->
getModel
()
->
getSubtitleModel
();
}
return
subModel
;
}
return
nullptr
;
}
...
...
src/core.h
View file @
6e639f6a
...
...
@@ -238,7 +238,7 @@ public:
/** @brief Temporarily un/plug a list of clips in timeline. */
void
temporaryUnplug
(
QList
<
int
>
clipIds
,
bool
hide
);
/** @brief Returns the current doc's subtitle model. */
std
::
shared_ptr
<
SubtitleModel
>
getSubtitleModel
();
std
::
shared_ptr
<
SubtitleModel
>
getSubtitleModel
(
bool
enforce
=
false
);
KSharedDataCache
audioThumbCache
;
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
6e639f6a
...
...
@@ -3794,8 +3794,8 @@ void TimelineController::addSubtitle(int startframe)
startframe
=
pCore
->
getTimelinePosition
();
}
int
endframe
=
startframe
+
pCore
->
getDurationFromString
(
KdenliveSettings
::
subtitle_duration
());
auto
subtitleModel
=
pCore
->
getSubtitleModel
(
true
);
int
id
=
TimelineModel
::
getNextId
();
auto
subtitleModel
=
pCore
->
getSubtitleModel
();
Fun
local_undo
=
[
subtitleModel
,
id
,
startframe
,
endframe
]()
{
subtitleModel
->
removeSubtitle
(
id
);
pCore
->
refreshProjectRange
({
startframe
,
endframe
});
...
...
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