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
154812c8
Commit
154812c8
authored
Mar 26, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix line feed lost on project notes paste.
Fixes
#1382
parent
1e891803
Pipeline
#155191
passed with stage
in 7 minutes and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/project/dialogs/noteswidget.cpp
View file @
154812c8
...
...
@@ -214,6 +214,7 @@ void NotesWidget::addTextNote(const QString &text)
void
NotesWidget
::
insertFromMimeData
(
const
QMimeData
*
source
)
{
QString
pastedText
=
source
->
text
();
bool
enforceHtml
=
false
;
// Check for timecodes
QStringList
words
=
pastedText
.
split
(
QLatin1Char
(
' '
));
for
(
const
QString
&
w
:
qAsConst
(
words
))
{
...
...
@@ -222,8 +223,13 @@ void NotesWidget::insertFromMimeData(const QMimeData *source)
int
frames
=
pCore
->
timecode
().
getFrameCount
(
w
);
if
(
frames
>
0
)
{
pastedText
.
replace
(
w
,
QStringLiteral
(
"<a href=
\"
"
)
+
QString
::
number
(
frames
)
+
QStringLiteral
(
"
\"
>"
)
+
w
+
QStringLiteral
(
"</a> "
));
enforceHtml
=
true
;
}
}
}
insertHtml
(
pastedText
);
if
(
enforceHtml
||
Qt
::
mightBeRichText
(
pastedText
))
{
insertHtml
(
pastedText
);
}
else
{
insertPlainText
(
pastedText
);
}
}
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