diff --git a/Changelog b/Changelog index e18b24211..bc981acc0 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ * Unknown - Christophe Dumez - v0.10.0 - - FEATURE: Added UPnP port forwarding support + - FEATURE: Added UPnP / NAT-PMP port forwarding support + - FEATURE: Added RSS support - FEATURE: Finished torrents are moved to another tab - FEATURE: Display more infos about the torrent in its properties - FEATURE: Allow the user to edit torrents' trackers diff --git a/src/rss.h b/src/rss.h index cec12ef5a..830e7a476 100644 --- a/src/rss.h +++ b/src/rss.h @@ -320,6 +320,8 @@ class RssManager{ settings.beginGroup("Rss"); streamListUrl = settings.value("streamList").toStringList(); streamListAlias = settings.value("streamAlias").toStringList(); + //XXX: Maybe check that both list have same size? + qDebug("NB RSS streams loaded: %d", streamListUrl.size()); settings.endGroup(); unsigned int streamListUrlSize = streamListUrl.size(); for(unsigned int i=0; igetUrl()); streamListAlias.append(stream->getUrl()); + }else{ + qDebug("Not adding the Rss stream because it is already in the list"); } } // add a stream to the manager void addStream(QString url){ // completion of the address - if(!url.endsWith(".xml")){ + if(!url.endsWith(".xml")) { if(url.endsWith("/")) { url.append("rss.xml"); } else { @@ -362,6 +366,8 @@ class RssManager{ streamList.append(new RssStream(url)); streamListUrl.append(url); streamListAlias.append(url); + }else { + qDebug("Not adding the Rss stream because it is already in the list"); } } @@ -419,11 +425,11 @@ class RssManager{ } // return the position index of a stream, if the manager owns it - short hasStream(RssStream* stream) const{ + int hasStream(RssStream* stream) const{ return hasStream(stream->getUrl()); } - bool hasStream(const QString& url) const{ + int hasStream(const QString& url) const{ return streamListUrl.indexOf(url); } diff --git a/src/rss_imp.cpp b/src/rss_imp.cpp index 4f93f5640..6ebbe0c1e 100644 --- a/src/rss_imp.cpp +++ b/src/rss_imp.cpp @@ -95,7 +95,7 @@ } } - //right-clik on stream : give him an alias + //right-clik on stream : give him an alias void RSSImp::renameStream() { if(rssmanager.getNbStream()==0) { qDebug("no stream selected"); @@ -144,7 +144,7 @@ refreshStreamList(); } } - + // fills the streamList void RSSImp::refreshStreamList() { int currentStream = listStreams->currentRow(); @@ -152,7 +152,7 @@ for(int i=0; igetAlias()+" ("+QString::number(rssmanager.getStream(i)->getListSize(),10).toUtf8()+")", listStreams); } - listStreams->setCurrentRow(currentStream); + listStreams->setCurrentRow(currentStream); } // fills the newsList @@ -160,7 +160,8 @@ if(rssmanager.getNbStream()>0) { RssStream* currentstream = rssmanager.getStream(listStreams->currentRow()); listNews->clear(); - for(int i=0; igetListSize(); i++) { + unsigned int currentStreamSize = currentstream->getListSize(); + for(unsigned int i=0; igetItem(i)->getTitle(), listNews); } } @@ -181,7 +182,7 @@ listStreams->item(i)->setText(rssmanager.getStream(i)->getAlias()+" ("+QString::number(rssmanager.getStream(i)->getListSize(),10).toUtf8()+")"); } } - + RSSImp::RSSImp() : QWidget(){ setupUi(this); addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/add.png"))); @@ -205,5 +206,5 @@ delete timer; } - +