Browse Source

Fix possible crash with Qt 4.4

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
c287879e55
  1. 11
      src/feedList.h
  2. 1
      src/rss_imp.cpp

11
src/feedList.h

@ -28,15 +28,16 @@ public: @@ -28,15 +28,16 @@ public:
setColumnCount(1);
QTreeWidgetItem *___qtreewidgetitem = headerItem();
___qtreewidgetitem->setText(0, QApplication::translate("RSS", "RSS feeds", 0, QApplication::UnicodeUTF8));
connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateCurrentFeed(QTreeWidgetItem*)));
unread_item = new QTreeWidgetItem(this);
unread_item->setText(0, tr("Unread") + QString::fromUtf8(" (") + QString::number(rssmanager->getNbUnRead(), 10)+ QString(")"));
unread_item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/oxygen/mail-folder-inbox.png")));
itemAdded(unread_item, rssmanager);
connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateCurrentFeed(QTreeWidgetItem*)));
setCurrentItem(unread_item);
}
~FeedList() {
disconnect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateCurrentFeed(QTreeWidgetItem*)));
delete unread_item;
}
@ -121,19 +122,19 @@ public: @@ -121,19 +122,19 @@ public:
}
RssFile* getRSSItem(QTreeWidgetItem *item) const {
return mapping[item];
return mapping.value(item, 0);
}
RssFile::FileType getItemType(QTreeWidgetItem *item) const {
return mapping[item]->getType();
return mapping.value(item)->getType();
}
QString getItemID(QTreeWidgetItem *item) const {
return mapping[item]->getID();
return mapping.value(item)->getID();
}
QTreeWidgetItem* getTreeItemFromUrl(QString url) const{
return feeds_items[url];
return feeds_items.value(url, 0);
}
RssStream* getRSSItemFromUrl(QString url) const {

1
src/rss_imp.cpp

@ -427,6 +427,7 @@ void RSSImp::refreshNewsList(QTreeWidgetItem* item) { @@ -427,6 +427,7 @@ void RSSImp::refreshNewsList(QTreeWidgetItem* item) {
}
RssFile *rss_item = listStreams->getRSSItem(item);
if(!rss_item) return;
qDebug("Getting the list of news");
QList<RssItem*> news;

Loading…
Cancel
Save