Browse Source

- Fixed a bug in the number of finished torrents initial display

- Started to clean up rss.h
adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
381ae195b9
  1. 2
      TODO
  2. 1
      src/FinishedTorrents.cpp
  3. 6
      src/GUI.cpp
  4. 25
      src/properties_imp.cpp
  5. 1
      src/properties_imp.h
  6. 23
      src/rss.h
  7. 2
      src/src.pro

2
TODO

@ -42,4 +42,4 @@ @@ -42,4 +42,4 @@
- Display more info in log (UPnP)
- Update to libtorrent SVN (0.13)
- 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

1
src/FinishedTorrents.cpp

@ -28,7 +28,6 @@ @@ -28,7 +28,6 @@
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
setupUi(this);
nbFinished = 0;
((GUI*)parent)->setTabText(1, tr("Finished") +" (0)");
this->parent = parent;
this->BTSession = BTSession;
finishedListModel = new QStandardItemModel(0,9);

6
src/GUI.cpp

@ -66,6 +66,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ @@ -66,6 +66,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
tabs->addTab(rssWidget, tr("RSS"));
tabs->setTabIcon(3, QIcon(QString::fromUtf8(":/Icons/rss.png")));
readSettings();
// Tabs text
nbTorrents = 0;
tabs->setTabText(0, tr("Downloads") + " (0)");
tabs->setTabText(1, tr("Finished") + " (0)");
// Setting icons
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/qbittorrent32.png")));
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png")));
@ -116,8 +120,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ @@ -116,8 +120,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
if(!loadColWidthDLList()){
downloadList->header()->resizeSection(0, 200);
}
nbTorrents = 0;
tabs->setTabText(0, tr("Downloads") +" (0)");
#ifndef NO_UPNP
connect(&BTSession, SIGNAL(noWanServiceDetected()), this, SLOT(displayNoUPnPWanServiceDetected()));
connect(&BTSession, SIGNAL(wanServiceDetected()), this, SLOT(displayUPnPWanServiceDetected()));

25
src/properties_imp.cpp

@ -44,7 +44,6 @@ properties::properties(QWidget *parent, torrent_handle &h, QStringList trackerEr @@ -44,7 +44,6 @@ properties::properties(QWidget *parent, torrent_handle &h, QStringList trackerEr
filesList->setModel(PropListModel);
PropDelegate = new PropListDelegate();
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(addTracker_button, SIGNAL(clicked()), this, SLOT(askForTracker()));
connect(removeTracker_button, SIGNAL(clicked()), this, SLOT(deleteSelectedTrackers()));
@ -303,30 +302,6 @@ void properties::setAllPiecesState(bool selected){ @@ -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){
qDebug("Incremental download toggled");
torrent_info torrentInfo = h.get_torrent_info();

1
src/properties_imp.h

@ -48,7 +48,6 @@ class properties : public QDialog, private Ui::properties{ @@ -48,7 +48,6 @@ class properties : public QDialog, private Ui::properties{
void on_okButton_clicked();
void on_incrementalDownload_stateChanged(int);
void setRowColor(int row, QString color);
// void toggleSelectedState(const QModelIndex& index);
void saveFilteredFiles();
void updateProgress();
void loadFilteredFiles();

23
src/rss.h

@ -19,13 +19,13 @@ @@ -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 @@ @@ -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{ @@ -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{ @@ -182,7 +179,7 @@ class RssStream : public QObject{
i++;
}
}
QString getTitle() const{
return this->title;
}
@ -379,7 +376,7 @@ class RssManager{ @@ -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{ @@ -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{ @@ -469,7 +466,7 @@ class RssManager{
streamListAlias.replace(index, newAlias);
}
}
};
#endif

2
src/src.pro

@ -11,7 +11,7 @@ TARGET = qbittorrent @@ -11,7 +11,7 @@ TARGET = qbittorrent
CONFIG += qt thread x11 network
# Update this VERSION for each release
DEFINES += VERSION=\\\"v0.10.0alpha5\\\"
DEFINES += VERSION=\\\"v0.10.0alpha6\\\"
DEFINES += VERSION_MAJOR=0
DEFINES += VERSION_MINOR=10
DEFINES += VERSION_BUGFIX=0

Loading…
Cancel
Save