mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-14 16:57:55 +00:00
Fix possible crash when adding a new RSS stream
This commit is contained in:
parent
cc192d7d47
commit
c40801ce99
@ -184,7 +184,7 @@ void RSSImp::on_newFeedButton_clicked() {
|
|||||||
if (parent_item == m_feedList->stickyUnreadItem()) {
|
if (parent_item == m_feedList->stickyUnreadItem()) {
|
||||||
parent_item = 0;
|
parent_item = 0;
|
||||||
} else {
|
} else {
|
||||||
if (m_feedList->isFolder(parent_item))
|
if (!m_feedList->isFolder(parent_item))
|
||||||
parent_item = parent_item->parent();
|
parent_item = parent_item->parent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,15 +258,19 @@ bool RssFeed::parseRSS(QIODevice* device)
|
|||||||
parseRSSChannel(xml);
|
parseRSSChannel(xml);
|
||||||
found_channel = true;
|
found_channel = true;
|
||||||
break;
|
break;
|
||||||
} else
|
} else {
|
||||||
|
qDebug() << "Skip rss item: " << xml.name();
|
||||||
xml.skipCurrentElement();
|
xml.skipCurrentElement();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else
|
} else {
|
||||||
|
qDebug() << "Skip root item: " << xml.name();
|
||||||
xml.skipCurrentElement();
|
xml.skipCurrentElement();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xml.error()) {
|
if (xml.hasError()) {
|
||||||
qWarning() << "Error parsing RSS document: " << xml.errorString();
|
qWarning() << "Error parsing RSS document: " << xml.errorString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,10 @@ RssFolderPtr RssFolder::addFolder(const QString &name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RssFeedPtr RssFolder::addStream(RssManager* manager, const QString &url) {
|
RssFeedPtr RssFolder::addStream(RssManager* manager, const QString &url) {
|
||||||
|
qDebug() << Q_FUNC_INFO << manager << url;
|
||||||
RssFeedPtr stream(new RssFeed(manager, this, url));
|
RssFeedPtr stream(new RssFeed(manager, this, url));
|
||||||
|
Q_ASSERT(stream);
|
||||||
|
qDebug() << "Stream URL is " << stream->url();
|
||||||
Q_ASSERT(!m_children.contains(stream->url()));
|
Q_ASSERT(!m_children.contains(stream->url()));
|
||||||
m_children[stream->url()] = stream;
|
m_children[stream->url()] = stream;
|
||||||
stream->refresh();
|
stream->refresh();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user