FeedReader:

- Fixed crash when removing a feed displayed in the main tab.
- Fixed reading author of ATOM feeds.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6057 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-01-02 21:02:39 +00:00
parent c44d10a6a1
commit e099389528
3 changed files with 20 additions and 4 deletions

View File

@ -668,6 +668,11 @@ void FeedReaderDialog::messageTabInfoChanged(QWidget *widget)
return;
}
if (messageWidget != mMessageWidget && messageWidget->feedId().empty()) {
messageWidget->deleteLater();
return;
}
ui->messageTabWidget->setTabText(index, messageWidget->feedName(true));
ui->messageTabWidget->setTabIcon(index, messageWidget->feedIcon());
}

View File

@ -214,12 +214,14 @@ void FeedReaderMessageWidget::setFeedId(const std::string &feedId)
} else {
mFeedId.clear();
}
} else {
mFeedName.clear();
}
emit feedMessageChanged(this);
updateMsgs();
updateCurrentMessage();
emit feedMessageChanged(this);
}
QString FeedReaderMessageWidget::feedName(bool withUnreadCount)
@ -405,7 +407,7 @@ void FeedReaderMessageWidget::feedChanged(const QString &feedId, int type)
}
if (type == NOTIFY_TYPE_DEL) {
deleteLater();
setFeedId("");
return;
}

View File

@ -276,6 +276,7 @@ RsFeedReaderErrorState p3FeedReaderThread::download(const RsFeedReaderFeed &feed
std::string contentType = CURL.contentType();
if (isContentType(contentType, "text/xml") ||
isContentType(contentType, "text/html") ||
isContentType(contentType, "application/rss+xml") ||
isContentType(contentType, "application/xml") ||
isContentType(contentType, "application/xhtml+xml") ||
@ -900,7 +901,15 @@ RsFeedReaderErrorState p3FeedReaderThread::process(const RsFeedReaderFeed &feed,
item->link.erase(sidStart, sidEnd - sidStart);
}
xml.getChildText(node, "author", item->author);
if (feedFormat == FORMAT_ATOM) {
/* <author><name>... */
xmlNodePtr author = xml.findNode(node->children, "author", false);
if (author) {
xml.getChildText(node, "name", item->author);
}
} else {
xml.getChildText(node, "author", item->author);
}
switch (feedFormat) {
case FORMAT_RSS: