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
d765c0b9
Commit
d765c0b9
authored
Apr 09, 2021
by
Jean-Baptiste Mardelle
Browse files
Fix bug in subtitle deletion undo
Fixes
#1035
parent
49db3a2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/model/subtitlemodel.cpp
View file @
d765c0b9
...
...
@@ -357,10 +357,10 @@ bool SubtitleModel::addSubtitle(int id, GenTime start, GenTime end, const QStrin
qDebug
()
<<
"already present in model"
<<
"string :"
<<
m_subtitleList
[
start
].
first
<<
" start time "
<<
start
.
frames
(
pCore
->
getCurrentFps
())
<<
"end time : "
<<
m_subtitleList
[
start
].
second
.
frames
(
pCore
->
getCurrentFps
());
return
false
;
}
int
row
=
m_timeline
->
m_allSubtitles
.
size
();
m_timeline
->
registerSubtitle
(
id
,
start
,
temporary
);
int
row
=
m_timeline
->
getSubtitleIndex
(
id
);
beginInsertRows
(
QModelIndex
(),
row
,
row
);
m_subtitleList
[
start
]
=
{
str
,
end
};
m_timeline
->
registerSubtitle
(
id
,
start
,
temporary
);
endInsertRows
();
addSnapPoint
(
start
);
addSnapPoint
(
end
);
...
...
@@ -1003,7 +1003,7 @@ void SubtitleModel::jsontoSubtitle(const QString &data)
minutes
%=
60
;
int
milli_2
=
millisec
/
10
;
QString
startTimeString
=
QString
(
"%1:%2:%3.%4"
)
.
arg
(
hours
,
1
,
10
,
QChar
(
'0'
))
.
arg
(
hours
,
2
,
10
,
QChar
(
'0'
))
.
arg
(
minutes
,
2
,
10
,
QChar
(
'0'
))
.
arg
(
seconds
,
2
,
10
,
QChar
(
'0'
))
.
arg
(
milli_2
,
2
,
10
,
QChar
(
'0'
));
...
...
@@ -1024,7 +1024,7 @@ void SubtitleModel::jsontoSubtitle(const QString &data)
milli_2
=
millisec
/
10
;
// to limit ms to 2 digits (for .ass)
QString
endTimeString
=
QString
(
"%1:%2:%3.%4"
)
.
arg
(
hours
,
1
,
10
,
QChar
(
'0'
))
.
arg
(
hours
,
2
,
10
,
QChar
(
'0'
))
.
arg
(
minutes
,
2
,
10
,
QChar
(
'0'
))
.
arg
(
seconds
,
2
,
10
,
QChar
(
'0'
))
.
arg
(
milli_2
,
2
,
10
,
QChar
(
'0'
));
...
...
src/timeline2/model/timelinemodel.cpp
View file @
d765c0b9
...
...
@@ -1816,7 +1816,7 @@ bool TimelineModel::requestItemDeletion(int itemId, bool logUndo)
actionLabel
=
i18n
(
"Delete Clip"
);
}
else
if
(
isComposition
(
itemId
))
{
actionLabel
=
i18n
(
"Delete Composition"
);
}
else
if
(
is
Composition
(
itemId
))
{
}
else
if
(
is
SubTitle
(
itemId
))
{
actionLabel
=
i18n
(
"Delete Subtitle"
);
}
}
...
...
Write
Preview
Supports
Markdown
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