1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-16 20:32:23 +02:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Christophe Dumez
f3456284ed Tagged v1.4.1 and v1.5.0beta1 releases 2009-08-21 11:57:28 +00:00
129 changed files with 11918 additions and 18947 deletions

View File

@@ -1,74 +1,13 @@
* Tue Nov 17 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.6
- BUGFIX: RSS feed articles can now be displayed using keyboard arrows
- BUGFIX: RSS feed downloader can only process unread articles now
- BUGFIX: Fixed memory leak in RSS parser
- BUGFIX: Fixed possible crash in search autocompletion
- BUGFIX: Improved ETA calculation for big torrents
- BUGFIX: Fixed per-torrent speed limiting
* Wed Nov 4 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.5
- BUGFIX: Fixed man page
- BUGFIX: Fix crash on torrent addition (if libtorrent-rasterbar has debug enabled)
- BUGFIX: Fix trackers addition to torrents (bug introduced in v1.5.4)
- BUGFIX: Suppress compilation warning regarding sortNewsList() not being used
- BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion
- BUGFIX: Added safety mecanism which adds the torrents back to the list in case qbittorrent-resume.conf gets deleted or corrupted.
* Sun Oct 25 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.4
- BUGFIX: Updated man page
- BUGFIX: Fixed possible crash with torrents containing unicode characters
- BUGFIX: Fixed problem when disabling systray integration and starting minimized
- BUGFIX: Fixed PirateBay search plugin
- BUGFIX: Using Download button in search results list now downloads the right torrents
- BUGFIX: The search results list is no longer sorted automatically when a row color is updated
* Wed Sep 30 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.3
- BUGFIX: Fix a possible crash when pausing then deleting a torrent quickly
- BUGFIX: Fix a race condition in folder scanning and torrent downloader
- BUGFIX: Hide download url column in search results
- BUGFIX: Fix a crash when scanned directory does not exist
- BUGFIX: Fix compilation on Mac OS
- BUGFIX: Added a command line parameter to disable splash screen
- BUGFIX: Ignore permanent deletion button when no torrent is selected
- BUGFIX: When a selected torrent is deleted, select next suitable torrent
* Sun Sep 20 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.2
- BUGFIX: Some torrents were pausing for no reason
- I18N: Updated Korean translation
* Thu Sep 7 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.1
- BUGFIX: Fix crash in torrent addition dialog when save path does not exist (closes #425227)
- BUGFIX: Fix downloading from URL (broken in v1.5.0)
- BUGFIX: Pause torrents in error state
* Thu Sep 3 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
- FEATURE: Added Magnet URI support
- FEATURE: Search engine supports category-based requests
- FEATURE: Make use of torrent enclosure in RSS feeds for direct download
- FEATURE: Implemented a RSS feed downloader with filter support
- FEATURE: Save old RSS item to hard disk to remember them on start up
- FEATURE: Display free disk space in torrent addition dialog
- FEATURE: In torrent addition from URL, paste clipboard content if it contains an URL
- FEATURE: RSS feeds URLs can now be copied to clipboard
- FEATURE: RSS feeds can now be grouped into folders
- FEATURE: Added "Unread" item to RSS feed list to display all unread news
- FEATURE: RSS Feeds URLs can now be copied to clipboard
- FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
- FEATURE: A random listening port can be chosen automatically
- BUGFIX: torrent resume code rewrited
- BUGFIX: Fixed uTorrent spoofing code
- BUGFIX: Greatly improved column sorting code
- BUGFIX: Possibility to create trackerless torrents
- BUGFIX: Better item coloring in torrent content filtering dialog
- COSMETIC: Redesigned search tab to improve usability
- COSMETIC: Redesigned RSS tab to improve usability
- COSMETIC: Improved tracker errors readability
* Sun Aug 21 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.1
- BUGFIX: Fix problems when changing save path (if using temporary download folder)
- BUGFIX: Display real save path instead of the temporary one in torrent properties
- BUGFIX: Catching invalid_handle exception to avoid rare crashes
- BUGFIX: Fixed popup menu position in RSS feeds list
- BUGFIX: Don't save RSS feed state if it could not be updated
* Thu Aug 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.0
- FEATURE: Display swarm information in lists

View File

@@ -1,6 +1,12 @@
qBittorrent - A BitTorrent client in C++ / Qt4
------------------------------------------
*** Necessary if qt3 is default on your system ***
export QTDIR=/usr/include/qt4
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib
*** End ***
./configure
make && make install
qbittorrent
@@ -22,6 +28,9 @@ Dependencies:
- python >= 2.3 (needed by search engine)
- libmagick++ (advised, not required)
* Needed for favicons support (RSS / Search plugins)
- libzzip (advised, not required)
* Needed for zip support (Search plugins)

View File

@@ -1,19 +1,17 @@
.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>.
.TH "QBITTORRENT" "1" "September 30th 2009" "Bittorrent client written in C++ / Qt4" ""
.TH "QBITTORRENT" "1" "September 1st 2007" "Bittorrent client written in C++ / Qt4" ""
.SH "NAME"
.SH NAME
qBittorrent \- a Bittorrent client written in C++ / Qt4
.SH SYNOPSIS
.SH "SYNOPSIS"
\fBqbittorrent\fR [\-\-no-splash] [TORRENT_FILE | URL]...
\fBqbittorrent\fR [FILE | URL] [FILE | URL...]
\fBqbittorrent\fR \-\-help
\fBqbittorrent\fR \-\-version
.PP
.SH "DESCRIPTION"
@@ -21,21 +19,10 @@ qBittorrent \- a Bittorrent client written in C++ / Qt4
using the \fBrblibtorrent\fR library by Arvid Norberg. qBittorrent aims
to be a good alternative to all other bittorrent clients out there. qBittorrent
is fast, stable, light, it supports unicode and it provides a good integrated search engine.
It also comes with UPnP port forwarding / NAT-PMP, encryption (Azureus compatible),
FAST extension (mainline) and PeX support (utorrent compatible).
.SH "OPTIONS"
\fB--help\fR Prints the command line options.
\fB--version\fR Prints qbittorrent program version number.
\fB--no-splash\fR Disables splash screen on startup.
.SH "BUGS"
If you find a bug, please report it at http://bugs.qbittorrent.org
It also comes with UPnP port forwarding / NAT-PMP, encryption (Azureus compatible), FAST extension (mainline) and PeX support (utorrent compatible).
Please report any problem to http://bugs.qbittorrent.org
.PP
.SH "AUTHOR"
Christophe Dumez <chris@qbittorrent.org>

View File

@@ -83,7 +83,7 @@ public:
}
QString getMatchingTokens_str() const {
return this->value("matches", "").toString();
return this->value("matches", "*").toString();
}
void setMatchingTokens(QString tokens) {
@@ -353,7 +353,7 @@ protected slots:
if(!filters.hasFilter(new_name)) {
validated = true;
} else {
QMessageBox::warning(0, tr("Invalid filter name"), tr("This filter name is already in use."));
QMessageBox::critical(0, tr("Invalid filter name"), tr("This filter name is already in use."));
}
}while(!validated);
// Rename the filter
@@ -392,7 +392,7 @@ protected slots:
new_name = new_name.trimmed();
if(new_name.isEmpty()) {
// Cannot be left empty
QMessageBox::warning(0, tr("Invalid filter name"), tr("The filter name cannot be left empty."));
QMessageBox::critical(0, tr("Invalid filter name"), tr("The filter name cannot be left empty."));
} else {
validated = true;
}
@@ -408,7 +408,7 @@ protected slots:
if(filter_name.isNull()) return;
if(filters.hasFilter(filter_name)) {
// Filter alread exists
QMessageBox::warning(0, tr("Invalid filter name"), tr("This filter name is already in use."));
QMessageBox::critical(0, tr("Invalid filter name"), tr("This filter name is already in use."));
} else {
validated = true;
}
@@ -430,7 +430,7 @@ protected slots:
if(selected_filter.isEmpty()) return;
QString s = test_line->text().trimmed();
if(s.isEmpty()) {
QMessageBox::warning(0, tr("Filter testing error"), tr("Please specify a test torrent name."));
QMessageBox::critical(0, tr("Filter testing error"), tr("Please specify a test torrent name."));
return;
}
// Get current filter
@@ -455,7 +455,7 @@ protected slots:
filtersList->setCurrentItem(filtersList->item(0));
QMessageBox::information(0, tr("Import successful"), tr("Filters import was successful."));
} else {
QMessageBox::warning(0, tr("Import failure"), tr("Filters could not be imported due to an I/O error."));
QMessageBox::critical(0, tr("Import failure"), tr("Filters could not be imported due to an I/O error."));
}
}
@@ -466,13 +466,13 @@ protected slots:
if(!destination.endsWith(".filters"))
destination += ".filters";
if(QFile::exists(destination)) {
int ret = QMessageBox::question(0, tr("Overwriting confirmation"), tr("Are you sure you want to overwrite existing file?"), QMessageBox::Yes|QMessageBox::No);
int ret = QMessageBox::question(0, tr("Overwriting confirmation"), tr("Are you sure you want to overwrite existing file?"));
if(ret != QMessageBox::Yes) return;
}
if(filters.serialize(destination))
QMessageBox::information(0, tr("Export successful"), tr("Filters export was successful."));
else
QMessageBox::warning(0, tr("Export failure"), tr("Filters could not be exported due to an I/O error."));
QMessageBox::critical(0, tr("Export failure"), tr("Filters could not be exported due to an I/O error."));
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -35,7 +35,6 @@
#include "qtorrenthandle.h"
class QStandardItemModel;
class QSortFilterProxyModel;
class bittorrent;
class FinishedListDelegate;
@@ -48,7 +47,6 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
bittorrent *BTSession;
FinishedListDelegate *finishedListDelegate;
QStandardItemModel *finishedListModel;
QSortFilterProxyModel *proxyModel;
unsigned int nbFinished;
void hideOrShowColumn(int index);
bool loadHiddenColumns();
@@ -71,6 +69,10 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
void displayFinishedHoSMenu(const QPoint&);
void setRowColor(int row, QString color);
void saveColWidthFinishedList() const;
void toggleFinishedListSortOrder(int index);
void sortFinishedList(int index=-1, Qt::SortOrder sortOrder=Qt::AscendingOrder);
void sortFinishedListFloat(int index, Qt::SortOrder sortOrder);
void sortFinishedListString(int index, Qt::SortOrder sortOrder);
void updateFileSize(QString hash);
void on_actionSet_upload_limit_triggered();
void notifyTorrentDoubleClicked(const QModelIndex& index);
@@ -91,7 +93,6 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
void deleteTorrent(QString hash);
void showPropertiesFromHash(QString hash);
void loadLastSortedColumn();
void saveLastSortedColumn();
void updateMetadata(QTorrentHandle &h);
signals:

View File

@@ -163,7 +163,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
// Search engine tab
searchEngine = new SearchEngine(BTSession, myTrayIcon, systrayIntegration);
tabs->addTab(searchEngine, tr("Search"));
tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")));
tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/skin/search.png")));
readSettings();
// RSS Tab
rssWidget = 0;
@@ -249,9 +249,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
QMainWindow::statusBar()->addPermanentWidget(upSpeedLbl);
QMainWindow::statusBar()->addPermanentWidget(statusSep4);
QMainWindow::statusBar()->addPermanentWidget(ratioLbl);
show();
if(settings.value(QString::fromUtf8("Preferences/General/StartMinimized"), false).toBool()) {
this->setWindowState(Qt::WindowMinimized);
if(!settings.value(QString::fromUtf8("Preferences/General/StartMinimized"), false).toBool()) {
show();
}
scrapeTimer = new QTimer(this);
connect(scrapeTimer, SIGNAL(timeout()), this, SLOT(scrapeTrackers()));
@@ -451,10 +450,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
}
void GUI::setPaused(QTorrentHandle &h) const {
if(!h.is_paused()) {
// FIXME in v1.6.0: Add Error state and stop using pause for this
h.pause();
}
if(!h.is_paused()) return;
qDebug("Marking torrent %s as paused", h.hash().toLocal8Bit().data());
if(h.is_seed()) {
// In finished list
@@ -869,7 +865,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
default:
return;
}
if(hashes.empty()) return;
int ret;
if(inDownloadList) {
ret = QMessageBox::question(
@@ -916,12 +911,12 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
inDownloadList = false;
break;
case 3: //RSSImp
rssWidget->deleteSelectedItems();
rssWidget->on_delStream_button_clicked();
return;
default:
return;
}
if(hashes.empty()) return;
if(!hashes.size()) return;
int ret;
if(inDownloadList) {
ret = QMessageBox::question(
@@ -958,7 +953,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
foreach(QString param, params) {
param = param.trimmed();
if(param.startsWith("--")) continue;
if(param.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) {
BTSession->downloadFromUrl(param);
}else{
@@ -1033,7 +1027,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
// Connection
// * Ports binding
unsigned short old_listenPort = BTSession->getListenPort();
BTSession->setListeningPort(options->getPort());
BTSession->setListeningPortsRange(options->getPorts());
unsigned short new_listenPort = BTSession->getListenPort();
if(new_listenPort != old_listenPort) {
BTSession->addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg( misc::toQString(new_listenPort)));

BIN
src/Icons/add_file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

BIN
src/Icons/add_folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/Icons/money.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,31 +1,23 @@
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V1.5.6
Categories=Qt;Network;P2P
Comment=V1.5.0
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[bg]=Торент клиент
GenericName[cs]=Bittorrent klient
GenericName[de]=Bittorren Client
GenericName[el]=Bittorrent πελάτης
GenericName[el]=Τορεντ πελάτης
GenericName[es]=Cliente Bittorrent
GenericName[fi]=Bittorrent-ohjelma
GenericName[fr]=Client Bittorrent
GenericName[hu]=Bittorrent kliens
GenericName[it]=Client Bittorrent
GenericName[ja]=Bittorrent クライアント
GenericName[ko]=비토렌트 클라이언트
GenericName[nl]=Bittorrent-cliënt
GenericName[nl]=Bittorrent client
GenericName[pl]=Klient Bittorrent
GenericName[pt]=Cliente Bittorrent
GenericName[pt_BR]=Cliente Bittorrent
GenericName[ro]=Client Bittorrent
GenericName[ru]=клиент Bittorrent
GenericName[sk]=Klient siete Bittorrent
GenericName[sv]=Bittorrent-klient
GenericName[tr]=Bittorrent istemcisi
GenericName[uk]=Bittorrent-клієнт
GenericName[zh]=Bittorrent之用户
GenericName[zh_TW]=Bittorrent客戶端
Icon=qbittorrent
MimeType=application/x-bittorrent;
Name=qBittorrent

BIN
src/Icons/refresh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

BIN
src/Icons/skin/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -33,7 +33,6 @@
#include <QStandardItemModel>
#include <QHeaderView>
#include <QSettings>
#include <QSortFilterProxyModel>
#include "SearchTab.h"
#include "SearchListDelegate.h"
@@ -46,64 +45,45 @@
#define SEARCH_LEECHERS 3
#define SEARCH_ENGINE 4
SearchTab::SearchTab(SearchEngine *parent) : QWidget(), parent(parent)
SearchTab::SearchTab(SearchEngine *parent) : QWidget()
{
box=new QVBoxLayout();
results_lbl=new QLabel();
resultsBrowser = new QTreeView();
resultsBrowser->setSelectionMode(QAbstractItemView::ExtendedSelection);
box->addWidget(results_lbl);
box->addWidget(resultsBrowser);
setLayout(box);
// Set Search results list model
SearchListModel = new QStandardItemModel(0,6);
SearchListModel->setHeaderData(SEARCH_NAME, Qt::Horizontal, tr("Name", "i.e: file name"));
SearchListModel->setHeaderData(SEARCH_SIZE, Qt::Horizontal, tr("Size", "i.e: file size"));
SearchListModel->setHeaderData(SEARCH_SEEDERS, Qt::Horizontal, tr("Seeders", "i.e: Number of full sources"));
SearchListModel->setHeaderData(SEARCH_LEECHERS, Qt::Horizontal, tr("Leechers", "i.e: Number of partial sources"));
SearchListModel->setHeaderData(SEARCH_ENGINE, Qt::Horizontal, tr("Search engine"));
proxyModel = new QSortFilterProxyModel();
proxyModel->setDynamicSortFilter(true);
proxyModel->setSourceModel(SearchListModel);
resultsBrowser->setModel(proxyModel);
SearchDelegate = new SearchListDelegate();
resultsBrowser->setItemDelegate(SearchDelegate);
resultsBrowser->hideColumn(URL_COLUMN); // Hide url column
resultsBrowser->setRootIsDecorated(false);
resultsBrowser->setAllColumnsShowFocus(true);
resultsBrowser->setSortingEnabled(true);
// Connect signals to slots (search part)
connect(resultsBrowser, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(downloadSelectedItem(const QModelIndex&)));
// Load last columns width for search results list
if(!loadColWidthResultsList()){
resultsBrowser->header()->resizeSection(0, 275);
}
// Sort by Seeds
resultsBrowser->sortByColumn(SEEDERS, Qt::DescendingOrder);
}
void SearchTab::downloadSelectedItem(const QModelIndex& index) {
QString engine_url = proxyModel->data(proxyModel->index(index.row(), ENGINE_URL_COLUMN)).toString();
QString torrent_url = proxyModel->data(proxyModel->index(index.row(), URL_COLUMN)).toString();
setRowColor(index.row(), "red");
parent->downloadTorrent(engine_url, torrent_url);
box=new QVBoxLayout();
results_lbl=new QLabel();
resultsBrowser = new QTreeView();
resultsBrowser->setSelectionMode(QAbstractItemView::ExtendedSelection);
box->addWidget(results_lbl);
box->addWidget(resultsBrowser);
setLayout(box);
// Set Search results list model
SearchListModel = new QStandardItemModel(0,6);
SearchListModel->setHeaderData(SEARCH_NAME, Qt::Horizontal, tr("Name", "i.e: file name"));
SearchListModel->setHeaderData(SEARCH_SIZE, Qt::Horizontal, tr("Size", "i.e: file size"));
SearchListModel->setHeaderData(SEARCH_SEEDERS, Qt::Horizontal, tr("Seeders", "i.e: Number of full sources"));
SearchListModel->setHeaderData(SEARCH_LEECHERS, Qt::Horizontal, tr("Leechers", "i.e: Number of partial sources"));
SearchListModel->setHeaderData(SEARCH_ENGINE, Qt::Horizontal, tr("Search engine"));
resultsBrowser->setModel(SearchListModel);
resultsBrowser->hideColumn(URL_COLUMN); // Hide url column
SearchDelegate = new SearchListDelegate();
resultsBrowser->setItemDelegate(SearchDelegate);
// Make search list header clickable for sorting
resultsBrowser->header()->setClickable(true);
resultsBrowser->header()->setSortIndicatorShown(true);
// Connect signals to slots (search part)
connect(resultsBrowser, SIGNAL(doubleClicked(const QModelIndex&)), parent, SLOT(downloadSelectedItem(const QModelIndex&)));
connect(resultsBrowser->header(), SIGNAL(sectionPressed(int)), this, SLOT(sortSearchList(int)));
// Load last columns width for search results list
if(!loadColWidthResultsList()){
resultsBrowser->header()->resizeSection(0, 275);
}
}
SearchTab::~SearchTab() {
delete box;
delete results_lbl;
delete resultsBrowser;
delete SearchListModel;
delete proxyModel;
delete SearchDelegate;
delete resultsBrowser;
delete SearchListModel;
delete SearchDelegate;
}
QHeaderView* SearchTab::header() const {
@@ -120,38 +100,87 @@ bool SearchTab::loadColWidthResultsList() {
return false;
unsigned int listSize = width_list.size();
for(unsigned int i=0; i<listSize; ++i){
resultsBrowser->header()->resizeSection(i, width_list.at(i).toInt());
resultsBrowser->header()->resizeSection(i, width_list.at(i).toInt());
}
return true;
}
QLabel* SearchTab::getCurrentLabel()
{
return results_lbl;
return results_lbl;
}
QTreeView* SearchTab::getCurrentTreeView()
{
return resultsBrowser;
return resultsBrowser;
}
QSortFilterProxyModel* SearchTab::getCurrentSearchListProxy() const
QStandardItemModel* SearchTab::getCurrentSearchListModel()
{
return proxyModel;
}
QStandardItemModel* SearchTab::getCurrentSearchListModel() const
{
return SearchListModel;
return SearchListModel;
}
// Set the color of a row in data model
void SearchTab::setRowColor(int row, QString color){
proxyModel->setDynamicSortFilter(false);
for(int i=0; i<proxyModel->columnCount(); ++i){
proxyModel->setData(proxyModel->index(row, i), QVariant(QColor(color)), Qt::ForegroundRole);
for(int i=0; i<SearchListModel->columnCount(); ++i){
SearchListModel->setData(SearchListModel->index(row, i), QVariant(QColor(color)), Qt::ForegroundRole);
}
proxyModel->setDynamicSortFilter(true);
}
void SearchTab::sortSearchList(int index){
static Qt::SortOrder sortOrder = Qt::AscendingOrder;
if(resultsBrowser->header()->sortIndicatorSection() == index){
sortOrder = (sortOrder == Qt::DescendingOrder) ? Qt::AscendingOrder : Qt::DescendingOrder; ;
}
resultsBrowser->header()->setSortIndicator(index, sortOrder);
switch(index){
case SEEDERS:
case LEECHERS:
case SIZE:
sortSearchListInt(index, sortOrder);
break;
default:
sortSearchListString(index, sortOrder);
}
}
void SearchTab::sortSearchListInt(int index, Qt::SortOrder sortOrder){
QList<QPair<int, qlonglong> > lines;
// Insertion sorting
for(int i=0; i<SearchListModel->rowCount(); ++i){
misc::insertSort(lines, QPair<int,qlonglong>(i, SearchListModel->data(SearchListModel->index(i, index)).toLongLong()), sortOrder);
}
// Insert items in new model, in correct order
int nbRows_old = lines.size();
for(int row=0; row<lines.size(); ++row){
SearchListModel->insertRow(SearchListModel->rowCount());
int sourceRow = lines[row].first;
for(int col=0; col<6; ++col){
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col)));
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole);
}
}
// Remove old rows
SearchListModel->removeRows(0, nbRows_old);
}
void SearchTab::sortSearchListString(int index, Qt::SortOrder sortOrder){
QList<QPair<int, QString> > lines;
// Insetion sorting
for(int i=0; i<SearchListModel->rowCount(); ++i){
misc::insertSortString(lines, QPair<int, QString>(i, SearchListModel->data(SearchListModel->index(i, index)).toString()), sortOrder);
}
// Insert items in new model, in correct order
int nbRows_old = lines.size();
for(int row=0; row<nbRows_old; ++row){
SearchListModel->insertRow(SearchListModel->rowCount());
int sourceRow = lines[row].first;
for(int col=0; col<6; ++col){
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col)));
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole);
}
}
// Remove old rows
SearchListModel->removeRows(0, nbRows_old);
}

View File

@@ -41,35 +41,32 @@ class SearchEngine;
class QTreeView;
class QHeaderView;
class QStandardItemModel;
class QSortFilterProxyModel;
class SearchTab: public QWidget, public Ui::search_engine {
Q_OBJECT
private:
QVBoxLayout *box;
QLabel *results_lbl;
QTreeView *resultsBrowser;
QStandardItemModel *SearchListModel;
QSortFilterProxyModel *proxyModel;
SearchListDelegate *SearchDelegate;
SearchEngine *parent;
protected slots:
void downloadSelectedItem(const QModelIndex& index);
public:
SearchTab(SearchEngine *parent);
~SearchTab();
bool loadColWidthResultsList();
QLabel * getCurrentLabel();
QStandardItemModel* getCurrentSearchListModel() const;
QSortFilterProxyModel* getCurrentSearchListProxy() const;
QTreeView * getCurrentTreeView();
void setRowColor(int row, QString color);
QHeaderView* header() const;
class SearchTab : public QWidget, public Ui::search_engine
{
Q_OBJECT
private:
QVBoxLayout *box;
QLabel *results_lbl;
QTreeView *resultsBrowser;
QStandardItemModel *SearchListModel;
SearchListDelegate *SearchDelegate;
public:
SearchTab(SearchEngine *parent);
~SearchTab();
bool loadColWidthResultsList();
QLabel * getCurrentLabel();
QStandardItemModel * getCurrentSearchListModel();
QTreeView * getCurrentTreeView();
void setRowColor(int row, QString color);
QHeaderView* header() const;
protected slots:
void sortSearchList(int index);
void sortSearchListInt(int index, Qt::SortOrder sortOrder);
void sortSearchListString(int index, Qt::SortOrder sortOrder);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -42,8 +42,6 @@
using namespace libtorrent;
#define MAX_SAMPLES 20
class downloadThread;
class QTimer;
class QFileSystemWatcher;
@@ -79,8 +77,6 @@ class bittorrent : public QObject {
bool queueingEnabled;
QStringList url_skippingDlg;
QHash<QString, QString> savepath_fromurl;
QPointer<QTimer> timerETA;
QHash<QString, QList<int> > ETA_samples;
protected:
QString getSavePath(QString hash);
@@ -111,16 +107,13 @@ class bittorrent : public QObject {
int loadTorrentPriority(QString hash);
QStringList getConsoleMessages() const;
QStringList getPeerBanMessages() const;
qlonglong getETA(QString hash);
qlonglong getETA(QString hash) const;
bool useTemporaryFolder() const;
QString getDefaultSavePath() const;
public slots:
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false);
void importOldTorrents();
void applyFormerAttributeFiles(QTorrentHandle h);
void importOldTempData(QString torrent_path);
void loadSessionState();
void saveSessionState();
void downloadFromUrl(QString url);
@@ -140,6 +133,7 @@ class bittorrent : public QObject {
void enableIPFilter(QString filter);
void disableIPFilter();
void setQueueingEnabled(bool enable);
void saveTorrentSpeedLimits(QString hash);
void loadTorrentSpeedLimits(QString hash);
void handleDownloadFailure(QString url, QString reason);
void loadWebSeeds(QString fileHash);
@@ -147,7 +141,7 @@ class bittorrent : public QObject {
void decreaseDlTorrentPriority(QString hash);
void downloadUrlAndSkipDialog(QString url, QString save_path=QString::null);
// Session configuration - Setters
void setListeningPort(int port);
void setListeningPortsRange(std::pair<unsigned short, unsigned short> ports);
void setMaxConnections(int maxConnec);
void setMaxConnectionsPerTorrent(int max);
void setMaxUploadsPerTorrent(int max);
@@ -173,15 +167,12 @@ class bittorrent : public QObject {
void addPeerBanMessage(QString msg, bool from_ipfilter);
void processDownloadedFile(QString, QString);
void saveTrackerFile(QString hash);
void addMagnetSkipAddDlg(QString uri);
void downloadFromURLList(const QStringList& urls);
protected slots:
void scanDirectory(QString);
void readAlerts();
void loadTrackerFile(QString hash);
void deleteBigRatios();
void takeETASamples();
signals:
void addedTorrent(QTorrentHandle& h);

View File

@@ -62,22 +62,22 @@
<item>
<widget class="QPushButton" name="addFile_button">
<property name="text">
<string>Add file</string>
<string>Add a file</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/Icons/oxygen/document-new.png</normaloff>:/Icons/oxygen/document-new.png</iconset>
<normaloff>:/Icons/add_file.png</normaloff>:/Icons/add_file.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addFolder_button">
<property name="text">
<string>Add folder</string>
<string>Add a folder</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/Icons/oxygen/folder-new.png</normaloff>:/Icons/oxygen/folder-new.png</iconset>
<normaloff>:/Icons/add_folder.png</normaloff>:/Icons/add_folder.png</iconset>
</property>
</widget>
</item>

Some files were not shown because too many files have changed in this diff Show More