mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -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
2
TODO
2
TODO
|
@ -42,4 +42,4 @@
|
||||||
- Display more info in log (UPnP)
|
- Display more info in log (UPnP)
|
||||||
- Update to libtorrent SVN (0.13)
|
- Update to libtorrent SVN (0.13)
|
||||||
- Use its UPnP/NAT-PMP built-in support instead of ours
|
- Use its UPnP/NAT-PMP built-in support instead of ours
|
||||||
- Use its piece prioritization support (Add comboboxes in properties)
|
- Use its piece prioritization support
|
|
@ -28,7 +28,6 @@
|
||||||
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
|
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
nbFinished = 0;
|
nbFinished = 0;
|
||||||
((GUI*)parent)->setTabText(1, tr("Finished") +" (0)");
|
|
||||||
this->parent = parent;
|
this->parent = parent;
|
||||||
this->BTSession = BTSession;
|
this->BTSession = BTSession;
|
||||||
finishedListModel = new QStandardItemModel(0,9);
|
finishedListModel = new QStandardItemModel(0,9);
|
||||||
|
|
|
@ -66,6 +66,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
|
||||||
tabs->addTab(rssWidget, tr("RSS"));
|
tabs->addTab(rssWidget, tr("RSS"));
|
||||||
tabs->setTabIcon(3, QIcon(QString::fromUtf8(":/Icons/rss.png")));
|
tabs->setTabIcon(3, QIcon(QString::fromUtf8(":/Icons/rss.png")));
|
||||||
readSettings();
|
readSettings();
|
||||||
|
// Tabs text
|
||||||
|
nbTorrents = 0;
|
||||||
|
tabs->setTabText(0, tr("Downloads") + " (0)");
|
||||||
|
tabs->setTabText(1, tr("Finished") + " (0)");
|
||||||
// Setting icons
|
// Setting icons
|
||||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/qbittorrent32.png")));
|
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/qbittorrent32.png")));
|
||||||
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png")));
|
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png")));
|
||||||
|
@ -116,8 +120,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
|
||||||
if(!loadColWidthDLList()){
|
if(!loadColWidthDLList()){
|
||||||
downloadList->header()->resizeSection(0, 200);
|
downloadList->header()->resizeSection(0, 200);
|
||||||
}
|
}
|
||||||
nbTorrents = 0;
|
|
||||||
tabs->setTabText(0, tr("Downloads") +" (0)");
|
|
||||||
#ifndef NO_UPNP
|
#ifndef NO_UPNP
|
||||||
connect(&BTSession, SIGNAL(noWanServiceDetected()), this, SLOT(displayNoUPnPWanServiceDetected()));
|
connect(&BTSession, SIGNAL(noWanServiceDetected()), this, SLOT(displayNoUPnPWanServiceDetected()));
|
||||||
connect(&BTSession, SIGNAL(wanServiceDetected()), this, SLOT(displayUPnPWanServiceDetected()));
|
connect(&BTSession, SIGNAL(wanServiceDetected()), this, SLOT(displayUPnPWanServiceDetected()));
|
||||||
|
|
|
@ -44,7 +44,6 @@ properties::properties(QWidget *parent, torrent_handle &h, QStringList trackerEr
|
||||||
filesList->setModel(PropListModel);
|
filesList->setModel(PropListModel);
|
||||||
PropDelegate = new PropListDelegate();
|
PropDelegate = new PropListDelegate();
|
||||||
filesList->setItemDelegate(PropDelegate);
|
filesList->setItemDelegate(PropDelegate);
|
||||||
// connect(filesList, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(toggleSelectedState(const QModelIndex&)));
|
|
||||||
connect(filesList, SIGNAL(clicked(const QModelIndex&)), filesList, SLOT(edit(const QModelIndex&)));
|
connect(filesList, SIGNAL(clicked(const QModelIndex&)), filesList, SLOT(edit(const QModelIndex&)));
|
||||||
connect(addTracker_button, SIGNAL(clicked()), this, SLOT(askForTracker()));
|
connect(addTracker_button, SIGNAL(clicked()), this, SLOT(askForTracker()));
|
||||||
connect(removeTracker_button, SIGNAL(clicked()), this, SLOT(deleteSelectedTrackers()));
|
connect(removeTracker_button, SIGNAL(clicked()), this, SLOT(deleteSelectedTrackers()));
|
||||||
|
@ -303,30 +302,6 @@ void properties::setAllPiecesState(bool selected){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle the selected state of a file within the torrent when we
|
|
||||||
// double click on it.
|
|
||||||
// void properties::toggleSelectedState(const QModelIndex& index){
|
|
||||||
// int row = index.row();
|
|
||||||
// if(selectionBitmask.at(row)){
|
|
||||||
// // File is selected
|
|
||||||
// selectionBitmask.erase(selectionBitmask.begin()+row);
|
|
||||||
// selectionBitmask.insert(selectionBitmask.begin()+row, 0);
|
|
||||||
// // Update list infos
|
|
||||||
// setRowColor(row, "green");
|
|
||||||
// PropListModel->setData(PropListModel->index(row, SELECTED), QVariant(true));
|
|
||||||
// }else{
|
|
||||||
// // File is not selected
|
|
||||||
// selectionBitmask.erase(selectionBitmask.begin()+row);
|
|
||||||
// selectionBitmask.insert(selectionBitmask.begin()+row, 1);
|
|
||||||
// // Update list infos
|
|
||||||
// setRowColor(row, "red");
|
|
||||||
// PropListModel->setData(PropListModel->index(row, SELECTED), QVariant(false));
|
|
||||||
// }
|
|
||||||
// h.filter_files(selectionBitmask);
|
|
||||||
// // Save filtered pieces to a file to remember them
|
|
||||||
// saveFilteredFiles();
|
|
||||||
// }
|
|
||||||
|
|
||||||
void properties::on_incrementalDownload_stateChanged(int){
|
void properties::on_incrementalDownload_stateChanged(int){
|
||||||
qDebug("Incremental download toggled");
|
qDebug("Incremental download toggled");
|
||||||
torrent_info torrentInfo = h.get_torrent_info();
|
torrent_info torrentInfo = h.get_torrent_info();
|
||||||
|
|
|
@ -48,7 +48,6 @@ class properties : public QDialog, private Ui::properties{
|
||||||
void on_okButton_clicked();
|
void on_okButton_clicked();
|
||||||
void on_incrementalDownload_stateChanged(int);
|
void on_incrementalDownload_stateChanged(int);
|
||||||
void setRowColor(int row, QString color);
|
void setRowColor(int row, QString color);
|
||||||
// void toggleSelectedState(const QModelIndex& index);
|
|
||||||
void saveFilteredFiles();
|
void saveFilteredFiles();
|
||||||
void updateProgress();
|
void updateProgress();
|
||||||
void loadFilteredFiles();
|
void loadFilteredFiles();
|
||||||
|
|
23
src/rss.h
23
src/rss.h
|
@ -19,13 +19,13 @@
|
||||||
* Contact : chris@qbittorrent.org, arnaud@qbittorrent.org
|
* Contact : chris@qbittorrent.org, arnaud@qbittorrent.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define STREAM_MAX_ITEM 15
|
|
||||||
// TODO : not used yet
|
|
||||||
#define GLOBAL_MAX_ITEM 150
|
|
||||||
|
|
||||||
#ifndef RSS_H
|
#ifndef RSS_H
|
||||||
#define RSS_H
|
#define RSS_H
|
||||||
|
|
||||||
|
#define STREAM_MAX_ITEM 15
|
||||||
|
// FIXME: not used yet
|
||||||
|
#define GLOBAL_MAX_ITEM 150
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
@ -36,9 +36,7 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "downloadThread.h"
|
#include "downloadThread.h"
|
||||||
|
|
||||||
class RssItem;
|
|
||||||
class RssStream;
|
class RssStream;
|
||||||
class RssManager;
|
|
||||||
|
|
||||||
// Item of a rss stream, single information
|
// Item of a rss stream, single information
|
||||||
class RssItem{
|
class RssItem{
|
||||||
|
@ -58,9 +56,8 @@ class RssItem{
|
||||||
read = false;
|
read = false;
|
||||||
parent = _parent;
|
parent = _parent;
|
||||||
downloadLink = "none";
|
downloadLink = "none";
|
||||||
QDomElement property=properties.firstChild().toElement();
|
QDomElement property = properties.firstChild().toElement();
|
||||||
while(!property.isNull())
|
while(!property.isNull()) {
|
||||||
{
|
|
||||||
// setters
|
// setters
|
||||||
if (property.tagName() == "title")
|
if (property.tagName() == "title")
|
||||||
title = property.text();
|
title = property.text();
|
||||||
|
@ -182,7 +179,7 @@ class RssStream : public QObject{
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getTitle() const{
|
QString getTitle() const{
|
||||||
return this->title;
|
return this->title;
|
||||||
}
|
}
|
||||||
|
@ -379,7 +376,7 @@ class RssManager{
|
||||||
url.append("rss.xml");
|
url.append("rss.xml");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasStream(url)<0){
|
if(hasStream(url)<0){
|
||||||
RssStream* stream = new RssStream(url);
|
RssStream* stream = new RssStream(url);
|
||||||
this->streamList.append(stream);
|
this->streamList.append(stream);
|
||||||
|
@ -437,7 +434,7 @@ class RssManager{
|
||||||
this->streamList.replace(index, stream);
|
this->streamList.replace(index, stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the position index of a stream, if the manager owns it
|
// return the position index of a stream, if the manager owns it
|
||||||
short hasStream(RssStream* stream) const{
|
short hasStream(RssStream* stream) const{
|
||||||
QString url = stream->getUrl();
|
QString url = stream->getUrl();
|
||||||
|
@ -469,7 +466,7 @@ class RssManager{
|
||||||
streamListAlias.replace(index, newAlias);
|
streamListAlias.replace(index, newAlias);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,7 +11,7 @@ TARGET = qbittorrent
|
||||||
CONFIG += qt thread x11 network
|
CONFIG += qt thread x11 network
|
||||||
|
|
||||||
# Update this VERSION for each release
|
# Update this VERSION for each release
|
||||||
DEFINES += VERSION=\\\"v0.10.0alpha5\\\"
|
DEFINES += VERSION=\\\"v0.10.0alpha6\\\"
|
||||||
DEFINES += VERSION_MAJOR=0
|
DEFINES += VERSION_MAJOR=0
|
||||||
DEFINES += VERSION_MINOR=10
|
DEFINES += VERSION_MINOR=10
|
||||||
DEFINES += VERSION_BUGFIX=0
|
DEFINES += VERSION_BUGFIX=0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue