mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Fixed a bug in the number of finished torrents initial display
- Started to clean up rss.h
This commit is contained in:
parent
d323dcd4e0
commit
381ae195b9
7 changed files with 16 additions and 44 deletions
23
src/rss.h
23
src/rss.h
|
@ -19,13 +19,13 @@
|
|||
* Contact : chris@qbittorrent.org, arnaud@qbittorrent.org
|
||||
*/
|
||||
|
||||
#define STREAM_MAX_ITEM 15
|
||||
// TODO : not used yet
|
||||
#define GLOBAL_MAX_ITEM 150
|
||||
|
||||
#ifndef RSS_H
|
||||
#define RSS_H
|
||||
|
||||
#define STREAM_MAX_ITEM 15
|
||||
// FIXME: not used yet
|
||||
#define GLOBAL_MAX_ITEM 150
|
||||
|
||||
#include <QFile>
|
||||
#include <QList>
|
||||
#include <curl/curl.h>
|
||||
|
@ -36,9 +36,7 @@
|
|||
#include "misc.h"
|
||||
#include "downloadThread.h"
|
||||
|
||||
class RssItem;
|
||||
class RssStream;
|
||||
class RssManager;
|
||||
|
||||
// Item of a rss stream, single information
|
||||
class RssItem{
|
||||
|
@ -58,9 +56,8 @@ class RssItem{
|
|||
read = false;
|
||||
parent = _parent;
|
||||
downloadLink = "none";
|
||||
QDomElement property=properties.firstChild().toElement();
|
||||
while(!property.isNull())
|
||||
{
|
||||
QDomElement property = properties.firstChild().toElement();
|
||||
while(!property.isNull()) {
|
||||
// setters
|
||||
if (property.tagName() == "title")
|
||||
title = property.text();
|
||||
|
@ -182,7 +179,7 @@ class RssStream : public QObject{
|
|||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QString getTitle() const{
|
||||
return this->title;
|
||||
}
|
||||
|
@ -379,7 +376,7 @@ class RssManager{
|
|||
url.append("rss.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(hasStream(url)<0){
|
||||
RssStream* stream = new RssStream(url);
|
||||
this->streamList.append(stream);
|
||||
|
@ -437,7 +434,7 @@ class RssManager{
|
|||
this->streamList.replace(index, stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return the position index of a stream, if the manager owns it
|
||||
short hasStream(RssStream* stream) const{
|
||||
QString url = stream->getUrl();
|
||||
|
@ -469,7 +466,7 @@ class RssManager{
|
|||
streamListAlias.replace(index, newAlias);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue