From amarok-devel Mon Sep 14 18:51:31 2009 From: Martin Date: Mon, 14 Sep 2009 18:51:31 +0000 To: amarok-devel Subject: [PATCH] fix adding of HTML lyrics in TagDialog's lyrics tab Message-Id: <888a464d0909141151p715c5678m5897754da2022b7d () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=amarok-devel&m=125295511432722 Hi, while trying to understand why I could NOT supply HTML lyrics (in TagDialog's lyrics tab) I found that the solution is trivial. the problem was that the lyrics from within ui->kTextEdit_lyrics were ALWAYS HTML encoded (that means all HTML tags were escaped) you might guess it... instead of the HTML output the user got the plain HTML code presented here's the explanation for this: if the user typed "
" into the kTextEdit and clicked "Save..." the followinig happened: -the text from within the kTextEdit was read -toHtml() was called on it -> that's where the problem really is: toHtml would "convert" "
" into "<br>" so when the user looked at the lyrics in the LyricsApplet could see "
" - instead of a newline -lyrics were saved to the track here's my patch to fix this issue: diff --git a/src/dialogs/TagDialog.cpp b/src/dialogs/TagDialog.cpp index 290ded1..c193ed7 100644 --- a/src/dialogs/TagDialog.cpp +++ b/src/dialogs/TagDialog.cpp @@ -1316,7 +1316,11 @@ TagDialog::storeTags( const Meta::TrackPtr &track ) else { m_storedLyrics.remove( track ); - m_storedLyrics.insert( track, ui->kTextEdit_lyrics->toHtml() ); + + // don't call toHtml() here as it would break user-supplied HTML code + // (since the HTML code would be escaped the plain HTML code would + // be shown in the lyrics applet) + m_storedLyrics.insert( track, ui->kTextEdit_lyrics->toPlainText() ); } } } Regards, Martin _______________________________________________ Amarok-devel mailing list Amarok-devel@kde.org https://mail.kde.org/mailman/listinfo/amarok-devel