1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 03:45:56 +01:00

Add explanatory comments.

This commit is contained in:
John Maguire 2012-05-29 18:56:34 -07:00
parent 1b5352367a
commit 6bc4951236

View File

@ -168,9 +168,13 @@ QString GenerateHtmlForTweetStream(const QVariantList& tweets) {
int offset = 0;
foreach (const Entity& e, entities) {
// Write all the plain text up to this entity.
writer.writeCharacters(text.mid(offset, e.start_index - offset));
// Set the next starting position for reading more plain text.
offset = e.end_index;
// Write the entity (eg. a URL, a link to a hashtag search or a link to a
// user's stream from a @mention.
writer.writeStartElement("a");
writer.writeAttribute("href", e.url.toEncoded());
writer.writeCharacters(e.text);