- FEATURE: Display RSS article date and author if available

This commit is contained in:
Christophe Dumez 2007-09-09 19:19:33 +00:00
parent b99b838827
commit 1f8b9378a3
3 changed files with 188 additions and 8 deletions

View file

@ -221,7 +221,18 @@
// display a news
void RSSImp::refreshTextBrowser(QListWidgetItem *item) {
RssItem* article = rssmanager->getFeed(selectedFeedUrl)->getItem(listNews->row(item));
textBrowser->setHtml(article->getTitle()+":<br/>"+article->getDescription());
QString html;
html += "<div style='border: 2px solid red; margin-left: 5px; margin-right: 5px; margin-bottom: 5px;'>";
html += "<div style='background-color: #678db2; font-weight: bold; color: #fff;'>"+article->getTitle() + "</div>";
if(article->getDate().isValid()) {
html += "<div style='background-color: #efefef;'><b>"+tr("Date: ")+"</b>"+article->getDate().toString()+"</div>";
}
if(!article->getAuthor().isEmpty()) {
html += "<div style='background-color: #efefef;'><b>"+tr("Author: ")+"</b>"+article->getAuthor()+"</div>";
}
html += "</div>";
html += "<divstyle='margin-left: 5px; margin-right: 5px;'>"+article->getDescription()+"</div>";
textBrowser->setHtml(html);
article->setRead();
item->setData(Qt::ForegroundRole, QVariant(QColor("grey")));
item->setData(Qt::DecorationRole, QVariant(QIcon(":/Icons/sphere.png")));