1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 14:57:52 +00:00

Fix crash when pressing mouse button and selecting different rss items

This commit is contained in:
Christophe Dumez 2010-05-05 14:28:40 +00:00
parent a65f7bfa65
commit 73a9985599
2 changed files with 15 additions and 3 deletions

View File

@ -460,13 +460,13 @@ void RSSImp::refreshNewsList(QTreeWidgetItem* item) {
void RSSImp::refreshTextBrowser() {
QList<QTreeWidgetItem*> selection = listNews->selectedItems();
if(selection.empty()) return;
Q_ASSERT(selection.size() == 1);
QTreeWidgetItem *item = selection.first();
if(item == previous_news) return;
// Stop displaying previous news if necessary
if(listStreams->currentFeed() == listStreams->getUnreadItem()) {
if(previous_news) {
delete previous_news;
previous_news = 0;
delete listNews->takeTopLevelItem(listNews->indexOfTopLevelItem(previous_news));
}
previous_news = item;
}

View File

@ -125,7 +125,10 @@ p, li { white-space: pre-wrap; }
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectItems</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
@ -136,6 +139,15 @@ p, li { white-space: pre-wrap; }
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="expandsOnDoubleClick">
<bool>false</bool>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>