Compare commits
88 Commits
release-1.
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6db048122a | ||
|
|
194eb3ba6e | ||
|
|
8792637634 | ||
|
|
63ad2def91 | ||
|
|
f790b80aa3 | ||
|
|
ab78e5b438 | ||
|
|
05948e2edf | ||
|
|
c9c4f7001a | ||
|
|
6cd185d0d5 | ||
|
|
063219cbe7 | ||
|
|
e324f3792b | ||
|
|
0267ecc342 | ||
|
|
e53c7aaea6 | ||
|
|
3e90e56266 | ||
|
|
1c1b8acd67 | ||
|
|
811846e5fa | ||
|
|
3ba28885b9 | ||
|
|
8ed1c57c29 | ||
|
|
af5d24c5bc | ||
|
|
9dcd572d60 | ||
|
|
e024a3ff35 | ||
|
|
37342e0f0c | ||
|
|
bfbbc1f497 | ||
|
|
5d31dcdb15 | ||
|
|
6f89b1f131 | ||
|
|
9d35bda43c | ||
|
|
e780d83fd0 | ||
|
|
7a59d5e47c | ||
|
|
f2ea524be9 | ||
|
|
a33094519c | ||
|
|
e313ae808f | ||
|
|
dc9802fe1e | ||
|
|
64f1d306f4 | ||
|
|
f3af4867fd | ||
|
|
4fe22dbc57 | ||
|
|
1d9b524b77 | ||
|
|
63761afd0a | ||
|
|
8da148ffa1 | ||
|
|
e2dc2207d8 | ||
|
|
6e87d6655a | ||
|
|
d72485a955 | ||
|
|
04c6760892 | ||
|
|
382f3e3c86 | ||
|
|
c1378450fc | ||
|
|
4e10a8dbf7 | ||
|
|
4f7b4c2a55 | ||
|
|
f98f076335 | ||
|
|
b148a93a8f | ||
|
|
37cf23fe33 | ||
|
|
87f43123c6 | ||
|
|
11dd2d81b8 | ||
|
|
d18d07efed | ||
|
|
518a120c07 | ||
|
|
290bc8b7a6 | ||
|
|
0ede09efb5 | ||
|
|
15de12f6dd | ||
|
|
ef95d6df81 | ||
|
|
f382ba4fd0 | ||
|
|
01d504d992 | ||
|
|
cdd894a6a1 | ||
|
|
d7b2d3497f | ||
|
|
5dbd5c4326 | ||
|
|
9a14c4c599 | ||
|
|
3fa14cd47f | ||
|
|
941d9b9bd9 | ||
|
|
3d88b7b05c | ||
|
|
8d39e2a776 | ||
|
|
4a1c8a7279 | ||
|
|
b8d8862562 | ||
|
|
40e9105ee5 | ||
|
|
0984b8b8e1 | ||
|
|
3dd7dcc58f | ||
|
|
6ba5df3ec8 | ||
|
|
1560b4ca3b | ||
|
|
68d8a9ed47 | ||
|
|
ca00f3084d | ||
|
|
39c16b20ae | ||
|
|
666d4622b9 | ||
|
|
27388643b1 | ||
|
|
90d17d16a4 | ||
|
|
df0f01cd71 | ||
|
|
480d00d747 | ||
|
|
a0923741a4 | ||
|
|
8e2efc2950 | ||
|
|
91dee6058e | ||
|
|
f5c1343722 | ||
|
|
d4d0a08390 | ||
|
|
d02aca7323 |
11
Changelog
@@ -1,5 +1,6 @@
|
|||||||
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
|
* Thu Sep 3 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
|
||||||
- FEATURE: Added Magnet URI support
|
- 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: Make use of torrent enclosure in RSS feeds for direct download
|
||||||
- FEATURE: Implemented a RSS feed downloader with filter support
|
- FEATURE: Implemented a RSS feed downloader with filter support
|
||||||
- FEATURE: Save old RSS item to hard disk to remember them on start up
|
- FEATURE: Save old RSS item to hard disk to remember them on start up
|
||||||
@@ -7,9 +8,17 @@
|
|||||||
- FEATURE: In torrent addition from URL, paste clipboard content if it contains an URL
|
- 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 URLs can now be copied to clipboard
|
||||||
- FEATURE: RSS feeds can now be grouped into folders
|
- FEATURE: RSS feeds can now be grouped into folders
|
||||||
|
- FEATURE: Added "Unread" item to RSS feed list to display all unread news
|
||||||
- FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
|
- 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: 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: Redesigned RSS tab to improve usability
|
||||||
|
- COSMETIC: Improved tracker errors readability
|
||||||
|
|
||||||
* Sun Aug 21 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.1
|
* 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: Fix problems when changing save path (if using temporary download folder)
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
#include <QSortFilterProxyModel>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -54,9 +55,16 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
|||||||
finishedListModel->setHeaderData(F_PEERS, Qt::Horizontal, tr("Connected peers"));
|
finishedListModel->setHeaderData(F_PEERS, Qt::Horizontal, tr("Connected peers"));
|
||||||
finishedListModel->setHeaderData(F_UPLOAD, Qt::Horizontal, tr("Total uploaded", "i.e: Total amount of uploaded data"));
|
finishedListModel->setHeaderData(F_UPLOAD, Qt::Horizontal, tr("Total uploaded", "i.e: Total amount of uploaded data"));
|
||||||
finishedListModel->setHeaderData(F_RATIO, Qt::Horizontal, tr("Ratio"));
|
finishedListModel->setHeaderData(F_RATIO, Qt::Horizontal, tr("Ratio"));
|
||||||
finishedList->setModel(finishedListModel);
|
|
||||||
|
proxyModel = new QSortFilterProxyModel();
|
||||||
|
proxyModel->setDynamicSortFilter(true);
|
||||||
|
proxyModel->setSourceModel(finishedListModel);
|
||||||
|
finishedList->setModel(proxyModel);
|
||||||
|
|
||||||
finishedList->setRootIsDecorated(false);
|
finishedList->setRootIsDecorated(false);
|
||||||
finishedList->setAllColumnsShowFocus(true);
|
finishedList->setAllColumnsShowFocus(true);
|
||||||
|
finishedList->setSortingEnabled(true);
|
||||||
|
|
||||||
loadHiddenColumns();
|
loadHiddenColumns();
|
||||||
// Hide hash column
|
// Hide hash column
|
||||||
finishedList->hideColumn(F_HASH);
|
finishedList->hideColumn(F_HASH);
|
||||||
@@ -69,7 +77,6 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
|||||||
// Make download list header clickable for sorting
|
// Make download list header clickable for sorting
|
||||||
finishedList->header()->setClickable(true);
|
finishedList->header()->setClickable(true);
|
||||||
finishedList->header()->setSortIndicatorShown(true);
|
finishedList->header()->setSortIndicatorShown(true);
|
||||||
connect(finishedList->header(), SIGNAL(sectionPressed(int)), this, SLOT(toggleFinishedListSortOrder(int)));
|
|
||||||
finishedListDelegate = new FinishedListDelegate(finishedList);
|
finishedListDelegate = new FinishedListDelegate(finishedList);
|
||||||
finishedList->setItemDelegate(finishedListDelegate);
|
finishedList->setItemDelegate(finishedListDelegate);
|
||||||
connect(finishedList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFinishedListMenu(const QPoint&)));
|
connect(finishedList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFinishedListMenu(const QPoint&)));
|
||||||
@@ -104,9 +111,11 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
|||||||
}
|
}
|
||||||
|
|
||||||
FinishedTorrents::~FinishedTorrents(){
|
FinishedTorrents::~FinishedTorrents(){
|
||||||
|
saveLastSortedColumn();
|
||||||
saveColWidthFinishedList();
|
saveColWidthFinishedList();
|
||||||
saveHiddenColumns();
|
saveHiddenColumns();
|
||||||
delete finishedListDelegate;
|
delete finishedListDelegate;
|
||||||
|
delete proxyModel;
|
||||||
delete finishedListModel;
|
delete finishedListModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,8 +150,8 @@ void FinishedTorrents::addTorrent(QString hash){
|
|||||||
// Update the number of finished torrents
|
// Update the number of finished torrents
|
||||||
++nbFinished;
|
++nbFinished;
|
||||||
emit finishedTorrentsNumberChanged(nbFinished);
|
emit finishedTorrentsNumberChanged(nbFinished);
|
||||||
// Sort List
|
|
||||||
sortFinishedList();
|
loadLastSortedColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the color of a row in data model
|
// Set the color of a row in data model
|
||||||
@@ -159,7 +168,7 @@ QStringList FinishedTorrents::getSelectedTorrents(bool only_one) const{
|
|||||||
foreach(const QModelIndex &index, selectedIndexes) {
|
foreach(const QModelIndex &index, selectedIndexes) {
|
||||||
if(index.column() == F_NAME) {
|
if(index.column() == F_NAME) {
|
||||||
// Get the file hash
|
// Get the file hash
|
||||||
QString hash = finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString();
|
QString hash = getHashFromRow(index.row());
|
||||||
res << hash;
|
res << hash;
|
||||||
if(only_one) break;
|
if(only_one) break;
|
||||||
}
|
}
|
||||||
@@ -208,6 +217,18 @@ bool FinishedTorrents::loadColWidthFinishedList(){
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FinishedTorrents::saveLastSortedColumn() {
|
||||||
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
|
Qt::SortOrder sortOrder = finishedList->header()->sortIndicatorOrder();
|
||||||
|
QString sortOrderLetter;
|
||||||
|
if(sortOrder == Qt::AscendingOrder)
|
||||||
|
sortOrderLetter = QString::fromUtf8("a");
|
||||||
|
else
|
||||||
|
sortOrderLetter = QString::fromUtf8("d");
|
||||||
|
int index = finishedList->header()->sortIndicatorSection();
|
||||||
|
settings.setValue(QString::fromUtf8("FinishedListSortedCol"), misc::toQString(index)+sortOrderLetter);
|
||||||
|
}
|
||||||
|
|
||||||
void FinishedTorrents::loadLastSortedColumn() {
|
void FinishedTorrents::loadLastSortedColumn() {
|
||||||
// Loading last sorted column
|
// Loading last sorted column
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
@@ -220,7 +241,7 @@ void FinishedTorrents::loadLastSortedColumn() {
|
|||||||
sortOrder = Qt::AscendingOrder;
|
sortOrder = Qt::AscendingOrder;
|
||||||
sortedCol = sortedCol.left(sortedCol.size()-1);
|
sortedCol = sortedCol.left(sortedCol.size()-1);
|
||||||
int index = sortedCol.toInt();
|
int index = sortedCol.toInt();
|
||||||
sortFinishedList(index, sortOrder);
|
finishedList->sortByColumn(index, sortOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +286,7 @@ void FinishedTorrents::on_actionSet_upload_limit_triggered(){
|
|||||||
foreach(const QModelIndex &index, selectedIndexes){
|
foreach(const QModelIndex &index, selectedIndexes){
|
||||||
if(index.column() == F_NAME){
|
if(index.column() == F_NAME){
|
||||||
// Get the file hash
|
// Get the file hash
|
||||||
hashes << finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString();
|
hashes << getHashFromRow(index.row());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new BandwidthAllocationDialog(this, true, BTSession, hashes);
|
new BandwidthAllocationDialog(this, true, BTSession, hashes);
|
||||||
@@ -351,8 +372,8 @@ void FinishedTorrents::pauseTorrent(QString hash) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString FinishedTorrents::getHashFromRow(unsigned int row) const {
|
QString FinishedTorrents::getHashFromRow(unsigned int row) const {
|
||||||
Q_ASSERT(row < (unsigned int)finishedListModel->rowCount());
|
Q_ASSERT(row < (unsigned int)proxyModel->rowCount());
|
||||||
return finishedListModel->data(finishedListModel->index(row, F_HASH)).toString();
|
return proxyModel->data(proxyModel->index(row, F_HASH)).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Will move it to download tab
|
// Will move it to download tab
|
||||||
@@ -369,7 +390,7 @@ void FinishedTorrents::deleteTorrent(QString hash){
|
|||||||
|
|
||||||
// Show torrent properties dialog
|
// Show torrent properties dialog
|
||||||
void FinishedTorrents::showProperties(const QModelIndex &index){
|
void FinishedTorrents::showProperties(const QModelIndex &index){
|
||||||
showPropertiesFromHash(finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString());
|
showPropertiesFromHash(getHashFromRow(index.row()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FinishedTorrents::showPropertiesFromHash(QString hash){
|
void FinishedTorrents::showPropertiesFromHash(QString hash){
|
||||||
@@ -400,7 +421,7 @@ void FinishedTorrents::forceRecheck(){
|
|||||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
||||||
foreach(const QModelIndex &index, selectedIndexes){
|
foreach(const QModelIndex &index, selectedIndexes){
|
||||||
if(index.column() == F_NAME){
|
if(index.column() == F_NAME){
|
||||||
QString hash = finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString();
|
QString hash = getHashFromRow(index.row());
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||||
qDebug("Forcing recheck for torrent %s", hash.toLocal8Bit().data());
|
qDebug("Forcing recheck for torrent %s", hash.toLocal8Bit().data());
|
||||||
h.force_recheck();
|
h.force_recheck();
|
||||||
@@ -416,7 +437,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint&){
|
|||||||
foreach(const QModelIndex &index, selectedIndexes) {
|
foreach(const QModelIndex &index, selectedIndexes) {
|
||||||
if(index.column() == F_NAME) {
|
if(index.column() == F_NAME) {
|
||||||
// Get the file name
|
// Get the file name
|
||||||
QString hash = finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString();
|
QString hash = getHashFromRow(index.row());
|
||||||
// Get handle and pause the torrent
|
// Get handle and pause the torrent
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||||
if(!h.is_valid()) continue;
|
if(!h.is_valid()) continue;
|
||||||
@@ -462,7 +483,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint&){
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// hide/show columns menu
|
// hide/show columns menu
|
||||||
void FinishedTorrents::displayFinishedHoSMenu(const QPoint& pos){
|
void FinishedTorrents::displayFinishedHoSMenu(const QPoint&){
|
||||||
QMenu hideshowColumn(this);
|
QMenu hideshowColumn(this);
|
||||||
hideshowColumn.setTitle(tr("Hide or Show Column"));
|
hideshowColumn.setTitle(tr("Hide or Show Column"));
|
||||||
int lastCol = F_RATIO;
|
int lastCol = F_RATIO;
|
||||||
@@ -470,7 +491,7 @@ void FinishedTorrents::displayFinishedHoSMenu(const QPoint& pos){
|
|||||||
hideshowColumn.addAction(getActionHoSCol(i));
|
hideshowColumn.addAction(getActionHoSCol(i));
|
||||||
}
|
}
|
||||||
// Call menu
|
// Call menu
|
||||||
hideshowColumn.exec(mapToGlobal(pos)+QPoint(10,34));
|
hideshowColumn.exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
// toggle hide/show a column
|
// toggle hide/show a column
|
||||||
@@ -603,97 +624,3 @@ QAction* FinishedTorrents::getActionHoSCol(int index) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sorting functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
void FinishedTorrents::toggleFinishedListSortOrder(int index) {
|
|
||||||
Qt::SortOrder sortOrder = Qt::AscendingOrder;
|
|
||||||
if(finishedList->header()->sortIndicatorSection() == index){
|
|
||||||
sortOrder = (Qt::SortOrder)!(bool)finishedList->header()->sortIndicatorOrder();
|
|
||||||
}
|
|
||||||
switch(index) {
|
|
||||||
case F_SIZE:
|
|
||||||
case F_UPSPEED:
|
|
||||||
case F_RATIO:
|
|
||||||
case F_UPLOAD:
|
|
||||||
sortFinishedListFloat(index, sortOrder);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sortFinishedListString(index, sortOrder);
|
|
||||||
}
|
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
QString sortOrderLetter;
|
|
||||||
if(sortOrder == Qt::AscendingOrder)
|
|
||||||
sortOrderLetter = QString::fromUtf8("a");
|
|
||||||
else
|
|
||||||
sortOrderLetter = QString::fromUtf8("d");
|
|
||||||
settings.setValue(QString::fromUtf8("FinishedListSortedCol"), misc::toQString(index)+sortOrderLetter);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::sortFinishedList(int index, Qt::SortOrder sortOrder){
|
|
||||||
if(index == -1) {
|
|
||||||
index = finishedList->header()->sortIndicatorSection();
|
|
||||||
sortOrder = finishedList->header()->sortIndicatorOrder();
|
|
||||||
} else {
|
|
||||||
finishedList->header()->setSortIndicator(index, sortOrder);
|
|
||||||
}
|
|
||||||
switch(index) {
|
|
||||||
case F_SIZE:
|
|
||||||
case F_UPSPEED:
|
|
||||||
case F_UPLOAD:
|
|
||||||
case F_RATIO:
|
|
||||||
sortFinishedListFloat(index, sortOrder);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sortFinishedListString(index, sortOrder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::sortFinishedListFloat(int index, Qt::SortOrder sortOrder){
|
|
||||||
QList<QPair<int, double> > lines;
|
|
||||||
// insertion sorting
|
|
||||||
unsigned int nbRows = finishedListModel->rowCount();
|
|
||||||
for(unsigned int i=0; i<nbRows; ++i){
|
|
||||||
misc::insertSort(lines, QPair<int,double>(i, finishedListModel->data(finishedListModel->index(i, index)).toDouble()), sortOrder);
|
|
||||||
}
|
|
||||||
// Insert items in new model, in correct order
|
|
||||||
unsigned int nbRows_old = lines.size();
|
|
||||||
for(unsigned int row=0; row<nbRows_old; ++row){
|
|
||||||
finishedListModel->insertRow(finishedListModel->rowCount());
|
|
||||||
unsigned int sourceRow = lines[row].first;
|
|
||||||
unsigned int nbColumns = finishedListModel->columnCount();
|
|
||||||
for(unsigned int col=0; col<nbColumns; ++col){
|
|
||||||
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col)));
|
|
||||||
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col), Qt::DecorationRole), Qt::DecorationRole);
|
|
||||||
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Remove old rows
|
|
||||||
finishedListModel->removeRows(0, nbRows_old);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::sortFinishedListString(int index, Qt::SortOrder sortOrder){
|
|
||||||
QList<QPair<int, QString> > lines;
|
|
||||||
// Insertion sorting
|
|
||||||
unsigned int nbRows = finishedListModel->rowCount();
|
|
||||||
for(unsigned int i=0; i<nbRows; ++i){
|
|
||||||
misc::insertSortString(lines, QPair<int, QString>(i, finishedListModel->data(finishedListModel->index(i, index)).toString()), sortOrder);
|
|
||||||
}
|
|
||||||
// Insert items in new model, in correct order
|
|
||||||
unsigned int nbRows_old = lines.size();
|
|
||||||
for(unsigned int row=0; row<nbRows_old; ++row){
|
|
||||||
finishedListModel->insertRow(finishedListModel->rowCount());
|
|
||||||
unsigned int sourceRow = lines[row].first;
|
|
||||||
unsigned int nbColumns = finishedListModel->columnCount();
|
|
||||||
for(unsigned int col=0; col<nbColumns; ++col){
|
|
||||||
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col)));
|
|
||||||
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col), Qt::DecorationRole), Qt::DecorationRole);
|
|
||||||
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Remove old rows
|
|
||||||
finishedListModel->removeRows(0, nbRows_old);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "qtorrenthandle.h"
|
#include "qtorrenthandle.h"
|
||||||
|
|
||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
|
class QSortFilterProxyModel;
|
||||||
class bittorrent;
|
class bittorrent;
|
||||||
class FinishedListDelegate;
|
class FinishedListDelegate;
|
||||||
|
|
||||||
@@ -47,6 +48,7 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
|
|||||||
bittorrent *BTSession;
|
bittorrent *BTSession;
|
||||||
FinishedListDelegate *finishedListDelegate;
|
FinishedListDelegate *finishedListDelegate;
|
||||||
QStandardItemModel *finishedListModel;
|
QStandardItemModel *finishedListModel;
|
||||||
|
QSortFilterProxyModel *proxyModel;
|
||||||
unsigned int nbFinished;
|
unsigned int nbFinished;
|
||||||
void hideOrShowColumn(int index);
|
void hideOrShowColumn(int index);
|
||||||
bool loadHiddenColumns();
|
bool loadHiddenColumns();
|
||||||
@@ -69,10 +71,6 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
|
|||||||
void displayFinishedHoSMenu(const QPoint&);
|
void displayFinishedHoSMenu(const QPoint&);
|
||||||
void setRowColor(int row, QString color);
|
void setRowColor(int row, QString color);
|
||||||
void saveColWidthFinishedList() const;
|
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 updateFileSize(QString hash);
|
||||||
void on_actionSet_upload_limit_triggered();
|
void on_actionSet_upload_limit_triggered();
|
||||||
void notifyTorrentDoubleClicked(const QModelIndex& index);
|
void notifyTorrentDoubleClicked(const QModelIndex& index);
|
||||||
@@ -93,6 +91,7 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
|
|||||||
void deleteTorrent(QString hash);
|
void deleteTorrent(QString hash);
|
||||||
void showPropertiesFromHash(QString hash);
|
void showPropertiesFromHash(QString hash);
|
||||||
void loadLastSortedColumn();
|
void loadLastSortedColumn();
|
||||||
|
void saveLastSortedColumn();
|
||||||
void updateMetadata(QTorrentHandle &h);
|
void updateMetadata(QTorrentHandle &h);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
// Search engine tab
|
// Search engine tab
|
||||||
searchEngine = new SearchEngine(BTSession, myTrayIcon, systrayIntegration);
|
searchEngine = new SearchEngine(BTSession, myTrayIcon, systrayIntegration);
|
||||||
tabs->addTab(searchEngine, tr("Search"));
|
tabs->addTab(searchEngine, tr("Search"));
|
||||||
tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/skin/search.png")));
|
tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")));
|
||||||
readSettings();
|
readSettings();
|
||||||
// RSS Tab
|
// RSS Tab
|
||||||
rssWidget = 0;
|
rssWidget = 0;
|
||||||
@@ -1027,7 +1027,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
// Connection
|
// Connection
|
||||||
// * Ports binding
|
// * Ports binding
|
||||||
unsigned short old_listenPort = BTSession->getListenPort();
|
unsigned short old_listenPort = BTSession->getListenPort();
|
||||||
BTSession->setListeningPortsRange(options->getPorts());
|
BTSession->setListeningPort(options->getPort());
|
||||||
unsigned short new_listenPort = BTSession->getListenPort();
|
unsigned short new_listenPort = BTSession->getListenPort();
|
||||||
if(new_listenPort != old_listenPort) {
|
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)));
|
BTSession->addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg( misc::toQString(new_listenPort)));
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 813 B |
BIN
src/Icons/oxygen/application-x-kgetlist-no.png
Normal file
|
After Width: | Height: | Size: 743 B |
BIN
src/Icons/oxygen/application-x-kgetlist.png
Normal file
|
After Width: | Height: | Size: 659 B |
|
Before Width: | Height: | Size: 2.1 KiB |
BIN
src/Icons/oxygen/edit-find.png
Normal file
|
After Width: | Height: | Size: 627 B |
BIN
src/Icons/oxygen/mail-folder-inbox.png
Normal file
|
After Width: | Height: | Size: 739 B |
BIN
src/Icons/oxygen/preferences-desktop.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/Icons/oxygen/tab-close.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/Icons/oxygen/wallet.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
@@ -1,19 +1,26 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=Qt;Network;P2P
|
Categories=Qt;Network;P2P;
|
||||||
Comment=V1.5.0
|
Comment=V1.5.0
|
||||||
Exec=qbittorrent %f
|
Exec=qbittorrent %f
|
||||||
GenericName=Bittorrent client
|
GenericName=Bittorrent client
|
||||||
GenericName[bg]=Торент клиент
|
GenericName[bg]=Торент клиент
|
||||||
|
GenericName[cs]=Bittorrent klient
|
||||||
GenericName[de]=Bittorren Client
|
GenericName[de]=Bittorren Client
|
||||||
GenericName[el]=Τορεντ πελάτης
|
GenericName[el]=Bittorrent πελάτης
|
||||||
GenericName[es]=Cliente Bittorrent
|
GenericName[es]=Cliente Bittorrent
|
||||||
|
GenericName[fi]=Bittorrent-ohjelma
|
||||||
GenericName[fr]=Client Bittorrent
|
GenericName[fr]=Client Bittorrent
|
||||||
|
GenericName[hu]=Bittorrent kliens
|
||||||
GenericName[it]=Client Bittorrent
|
GenericName[it]=Client Bittorrent
|
||||||
GenericName[ja]=Bittorrent クライアント
|
GenericName[ja]=Bittorrent クライアント
|
||||||
GenericName[ko]=비토렌트 클라이언트
|
GenericName[ko]=비토렌트 클라이언트
|
||||||
GenericName[nl]=Bittorrent client
|
GenericName[nl]=Bittorrent-cliënt
|
||||||
GenericName[pl]=Klient Bittorrent
|
GenericName[pl]=Klient Bittorrent
|
||||||
|
GenericName[pt]=Cliente Bittorrent
|
||||||
|
GenericName[pt_BR]=Cliente Bittorrent
|
||||||
|
GenericName[ro]=Client Bittorrent
|
||||||
GenericName[ru]=клиент Bittorrent
|
GenericName[ru]=клиент Bittorrent
|
||||||
|
GenericName[sk]=Klient siete Bittorrent
|
||||||
GenericName[sv]=Bittorrent-klient
|
GenericName[sv]=Bittorrent-klient
|
||||||
GenericName[tr]=Bittorrent istemcisi
|
GenericName[tr]=Bittorrent istemcisi
|
||||||
GenericName[uk]=Bittorrent-клієнт
|
GenericName[uk]=Bittorrent-клієнт
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -33,6 +33,7 @@
|
|||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
#include "SearchTab.h"
|
#include "SearchTab.h"
|
||||||
#include "SearchListDelegate.h"
|
#include "SearchListDelegate.h"
|
||||||
@@ -45,45 +46,63 @@
|
|||||||
#define SEARCH_LEECHERS 3
|
#define SEARCH_LEECHERS 3
|
||||||
#define SEARCH_ENGINE 4
|
#define SEARCH_ENGINE 4
|
||||||
|
|
||||||
SearchTab::SearchTab(SearchEngine *parent) : QWidget()
|
SearchTab::SearchTab(SearchEngine *parent) : QWidget(), parent(parent)
|
||||||
{
|
{
|
||||||
box=new QVBoxLayout();
|
box=new QVBoxLayout();
|
||||||
results_lbl=new QLabel();
|
results_lbl=new QLabel();
|
||||||
resultsBrowser = new QTreeView();
|
resultsBrowser = new QTreeView();
|
||||||
resultsBrowser->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
resultsBrowser->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
box->addWidget(results_lbl);
|
box->addWidget(results_lbl);
|
||||||
box->addWidget(resultsBrowser);
|
box->addWidget(resultsBrowser);
|
||||||
|
|
||||||
setLayout(box);
|
setLayout(box);
|
||||||
// Set Search results list model
|
// Set Search results list model
|
||||||
SearchListModel = new QStandardItemModel(0,6);
|
SearchListModel = new QStandardItemModel(0,6);
|
||||||
SearchListModel->setHeaderData(SEARCH_NAME, Qt::Horizontal, tr("Name", "i.e: file name"));
|
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_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_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_LEECHERS, Qt::Horizontal, tr("Leechers", "i.e: Number of partial sources"));
|
||||||
SearchListModel->setHeaderData(SEARCH_ENGINE, Qt::Horizontal, tr("Search engine"));
|
SearchListModel->setHeaderData(SEARCH_ENGINE, Qt::Horizontal, tr("Search engine"));
|
||||||
resultsBrowser->setModel(SearchListModel);
|
resultsBrowser->hideColumn(URL_COLUMN); // Hide url column
|
||||||
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)
|
proxyModel = new QSortFilterProxyModel();
|
||||||
connect(resultsBrowser, SIGNAL(doubleClicked(const QModelIndex&)), parent, SLOT(downloadSelectedItem(const QModelIndex&)));
|
proxyModel->setDynamicSortFilter(true);
|
||||||
connect(resultsBrowser->header(), SIGNAL(sectionPressed(int)), this, SLOT(sortSearchList(int)));
|
proxyModel->setSourceModel(SearchListModel);
|
||||||
|
resultsBrowser->setModel(proxyModel);
|
||||||
|
|
||||||
// Load last columns width for search results list
|
SearchDelegate = new SearchListDelegate();
|
||||||
if(!loadColWidthResultsList()){
|
resultsBrowser->setItemDelegate(SearchDelegate);
|
||||||
resultsBrowser->header()->resizeSection(0, 275);
|
|
||||||
}
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchTab::~SearchTab() {
|
SearchTab::~SearchTab() {
|
||||||
delete resultsBrowser;
|
delete box;
|
||||||
delete SearchListModel;
|
delete results_lbl;
|
||||||
delete SearchDelegate;
|
delete resultsBrowser;
|
||||||
|
delete SearchListModel;
|
||||||
|
delete proxyModel;
|
||||||
|
delete SearchDelegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
QHeaderView* SearchTab::header() const {
|
QHeaderView* SearchTab::header() const {
|
||||||
@@ -100,87 +119,31 @@ bool SearchTab::loadColWidthResultsList() {
|
|||||||
return false;
|
return false;
|
||||||
unsigned int listSize = width_list.size();
|
unsigned int listSize = width_list.size();
|
||||||
for(unsigned int i=0; i<listSize; ++i){
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QLabel* SearchTab::getCurrentLabel()
|
QLabel* SearchTab::getCurrentLabel()
|
||||||
{
|
{
|
||||||
return results_lbl;
|
return results_lbl;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTreeView* SearchTab::getCurrentTreeView()
|
QTreeView* SearchTab::getCurrentTreeView()
|
||||||
{
|
{
|
||||||
return resultsBrowser;
|
return resultsBrowser;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStandardItemModel* SearchTab::getCurrentSearchListModel()
|
QStandardItemModel* SearchTab::getCurrentSearchListModel()
|
||||||
{
|
{
|
||||||
return SearchListModel;
|
return SearchListModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the color of a row in data model
|
// Set the color of a row in data model
|
||||||
void SearchTab::setRowColor(int row, QString color){
|
void SearchTab::setRowColor(int row, QString color){
|
||||||
for(int i=0; i<SearchListModel->columnCount(); ++i){
|
for(int i=0; i<proxyModel->columnCount(); ++i){
|
||||||
SearchListModel->setData(SearchListModel->index(row, i), QVariant(QColor(color)), Qt::ForegroundRole);
|
proxyModel->setData(proxyModel->index(row, i), QVariant(QColor(color)), Qt::ForegroundRole);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,31 +41,33 @@ class SearchEngine;
|
|||||||
class QTreeView;
|
class QTreeView;
|
||||||
class QHeaderView;
|
class QHeaderView;
|
||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
|
class QSortFilterProxyModel;
|
||||||
|
|
||||||
class SearchTab : public QWidget, public Ui::search_engine
|
class SearchTab: public QWidget, public Ui::search_engine {
|
||||||
{
|
Q_OBJECT
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVBoxLayout *box;
|
QVBoxLayout *box;
|
||||||
QLabel *results_lbl;
|
QLabel *results_lbl;
|
||||||
QTreeView *resultsBrowser;
|
QTreeView *resultsBrowser;
|
||||||
QStandardItemModel *SearchListModel;
|
QStandardItemModel *SearchListModel;
|
||||||
SearchListDelegate *SearchDelegate;
|
QSortFilterProxyModel *proxyModel;
|
||||||
public:
|
SearchListDelegate *SearchDelegate;
|
||||||
SearchTab(SearchEngine *parent);
|
SearchEngine *parent;
|
||||||
~SearchTab();
|
|
||||||
bool loadColWidthResultsList();
|
protected slots:
|
||||||
QLabel * getCurrentLabel();
|
void downloadSelectedItem(const QModelIndex& index);
|
||||||
QStandardItemModel * getCurrentSearchListModel();
|
|
||||||
QTreeView * getCurrentTreeView();
|
public:
|
||||||
void setRowColor(int row, QString color);
|
SearchTab(SearchEngine *parent);
|
||||||
QHeaderView* header() const;
|
~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);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ class bittorrent : public QObject {
|
|||||||
public slots:
|
public slots:
|
||||||
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
||||||
QTorrentHandle addMagnetUri(QString magnet_uri, 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 loadSessionState();
|
||||||
void saveSessionState();
|
void saveSessionState();
|
||||||
void downloadFromUrl(QString url);
|
void downloadFromUrl(QString url);
|
||||||
@@ -133,7 +136,6 @@ class bittorrent : public QObject {
|
|||||||
void enableIPFilter(QString filter);
|
void enableIPFilter(QString filter);
|
||||||
void disableIPFilter();
|
void disableIPFilter();
|
||||||
void setQueueingEnabled(bool enable);
|
void setQueueingEnabled(bool enable);
|
||||||
void saveTorrentSpeedLimits(QString hash);
|
|
||||||
void loadTorrentSpeedLimits(QString hash);
|
void loadTorrentSpeedLimits(QString hash);
|
||||||
void handleDownloadFailure(QString url, QString reason);
|
void handleDownloadFailure(QString url, QString reason);
|
||||||
void loadWebSeeds(QString fileHash);
|
void loadWebSeeds(QString fileHash);
|
||||||
@@ -141,7 +143,7 @@ class bittorrent : public QObject {
|
|||||||
void decreaseDlTorrentPriority(QString hash);
|
void decreaseDlTorrentPriority(QString hash);
|
||||||
void downloadUrlAndSkipDialog(QString url, QString save_path=QString::null);
|
void downloadUrlAndSkipDialog(QString url, QString save_path=QString::null);
|
||||||
// Session configuration - Setters
|
// Session configuration - Setters
|
||||||
void setListeningPortsRange(std::pair<unsigned short, unsigned short> ports);
|
void setListeningPort(int port);
|
||||||
void setMaxConnections(int maxConnec);
|
void setMaxConnections(int maxConnec);
|
||||||
void setMaxConnectionsPerTorrent(int max);
|
void setMaxConnectionsPerTorrent(int max);
|
||||||
void setMaxUploadsPerTorrent(int max);
|
void setMaxUploadsPerTorrent(int max);
|
||||||
|
|||||||
@@ -166,10 +166,10 @@ void createtorrent::on_createButton_clicked(){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QStringList trackers = allItems(trackers_list);
|
QStringList trackers = allItems(trackers_list);
|
||||||
if(!trackers.size()){
|
/*if(!trackers.size()){
|
||||||
QMessageBox::critical(0, tr("No tracker path set"), tr("Please set at least one tracker"));
|
QMessageBox::critical(0, tr("No tracker path set"), tr("Please set at least one tracker"));
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), QDir::homePath(), tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), QDir::homePath(), tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||||
if(!destination.isEmpty()) {
|
if(!destination.isEmpty()) {
|
||||||
if(!destination.endsWith(QString::fromUtf8(".torrent")))
|
if(!destination.endsWith(QString::fromUtf8(".torrent")))
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
<action name="actionBuy_it">
|
<action name="actionBuy_it">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="icons.qrc">
|
<iconset resource="icons.qrc">
|
||||||
<normaloff>:/Icons/money.png</normaloff>:/Icons/money.png</iconset>
|
<normaloff>:/Icons/oxygen/wallet.png</normaloff>:/Icons/oxygen/wallet.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Buy it</string>
|
<string>Buy it</string>
|
||||||
|
|||||||
@@ -77,13 +77,20 @@ subDownloadThread::~subDownloadThread(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void subDownloadThread::run(){
|
void subDownloadThread::run(){
|
||||||
// XXX: Trick to get a unique filename
|
// Get a unique filename
|
||||||
QString filePath;
|
QString filePath;
|
||||||
QTemporaryFile *tmpfile = new QTemporaryFile();
|
QTemporaryFile tmpfile;
|
||||||
if (tmpfile->open()) {
|
tmpfile.setAutoRemove(false);
|
||||||
filePath = tmpfile->fileName();
|
if (tmpfile.open()) {
|
||||||
|
filePath = tmpfile.fileName();
|
||||||
|
qDebug("Temporary filename is: %s", filePath.toLocal8Bit().data());
|
||||||
|
} else {
|
||||||
|
emit downloadFailureST(this, url, tr("I/O Error"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
delete tmpfile;
|
tmpfile.close();
|
||||||
|
// Now temporary file is created but closed so that
|
||||||
|
// curl can use it
|
||||||
FILE *f = fopen(filePath.toLocal8Bit().data(), "wb");
|
FILE *f = fopen(filePath.toLocal8Bit().data(), "wb");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
std::cerr << "couldn't open destination file" << "\n";
|
std::cerr << "couldn't open destination file" << "\n";
|
||||||
@@ -134,6 +141,7 @@ void subDownloadThread::run(){
|
|||||||
qDebug("Downloading %s", url.toLocal8Bit().data());
|
qDebug("Downloading %s", url.toLocal8Bit().data());
|
||||||
if(!abort)
|
if(!abort)
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
qDebug("done downloading %s", url.toLocal8Bit().data());
|
||||||
/* always cleanup */
|
/* always cleanup */
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
@@ -144,6 +152,7 @@ void subDownloadThread::run(){
|
|||||||
} else {
|
} else {
|
||||||
emit downloadFinishedST(this, url, filePath);
|
emit downloadFinishedST(this, url, filePath);
|
||||||
}
|
}
|
||||||
|
qDebug("%s Raised the signal", url.toLocal8Bit().data());
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Could not initialize CURL" << "\n";
|
std::cerr << "Could not initialize CURL" << "\n";
|
||||||
}
|
}
|
||||||
@@ -206,6 +215,7 @@ void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url,
|
|||||||
Q_ASSERT(index != -1);
|
Q_ASSERT(index != -1);
|
||||||
subThreads.removeAt(index);
|
subThreads.removeAt(index);
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
|
qDebug("Deleting subthread");
|
||||||
delete st;
|
delete st;
|
||||||
emit downloadFinished(url, path);
|
emit downloadFinished(url, path);
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
@@ -213,6 +223,7 @@ void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url,
|
|||||||
condition.wakeOne();
|
condition.wakeOne();
|
||||||
}
|
}
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
|
qDebug("Out of propagateDownloadedFile");
|
||||||
}
|
}
|
||||||
|
|
||||||
void downloadThread::propagateDownloadFailure(subDownloadThread* st, QString url, QString reason){
|
void downloadThread::propagateDownloadFailure(subDownloadThread* st, QString url, QString reason){
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
class bittorrent;
|
class bittorrent;
|
||||||
class DLListDelegate;
|
class DLListDelegate;
|
||||||
|
class QSortFilterProxyModel;
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
@@ -47,6 +48,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
|||||||
bittorrent *BTSession;
|
bittorrent *BTSession;
|
||||||
DLListDelegate *DLDelegate;
|
DLListDelegate *DLDelegate;
|
||||||
QStandardItemModel *DLListModel;
|
QStandardItemModel *DLListModel;
|
||||||
|
QSortFilterProxyModel *proxyModel;
|
||||||
unsigned int nbTorrents;
|
unsigned int nbTorrents;
|
||||||
void hideOrShowColumn(int index);
|
void hideOrShowColumn(int index);
|
||||||
bool loadHiddenColumns();
|
bool loadHiddenColumns();
|
||||||
@@ -74,10 +76,6 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
|||||||
void on_actionSet_upload_limit_triggered();
|
void on_actionSet_upload_limit_triggered();
|
||||||
void displayDLListMenu(const QPoint& pos);
|
void displayDLListMenu(const QPoint& pos);
|
||||||
void displayDLHoSMenu(const QPoint&);
|
void displayDLHoSMenu(const QPoint&);
|
||||||
void sortDownloadList(int index=-1, Qt::SortOrder startSortOrder=Qt::AscendingOrder);
|
|
||||||
void toggleDownloadListSortOrder(int index);
|
|
||||||
void sortDownloadListFloat(int index, Qt::SortOrder sortOrder);
|
|
||||||
void sortDownloadListString(int index, Qt::SortOrder sortOrder);
|
|
||||||
void saveColWidthDLList() const;
|
void saveColWidthDLList() const;
|
||||||
void setRowColor(int row, QColor color);
|
void setRowColor(int row, QColor color);
|
||||||
void showProperties(const QModelIndex &index);
|
void showProperties(const QModelIndex &index);
|
||||||
@@ -100,7 +98,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
|||||||
void updateFileSizeAndProgress(QString hash);
|
void updateFileSizeAndProgress(QString hash);
|
||||||
void showPropertiesFromHash(QString hash);
|
void showPropertiesFromHash(QString hash);
|
||||||
void hidePriorityColumn(bool hide);
|
void hidePriorityColumn(bool hide);
|
||||||
void sortProgressColumn(QTorrentHandle& h);
|
void saveLastSortedColumn();
|
||||||
void loadLastSortedColumn();
|
void loadLastSortedColumn();
|
||||||
void addTorrent(QString hash);
|
void addTorrent(QString hash);
|
||||||
void updateMetadata(QTorrentHandle &h);
|
void updateMetadata(QTorrentHandle &h);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#define ENGINE_SELECT_DLG_H
|
#define ENGINE_SELECT_DLG_H
|
||||||
|
|
||||||
#include "ui_engineSelect.h"
|
#include "ui_engineSelect.h"
|
||||||
|
#include "supportedEngines.h"
|
||||||
|
|
||||||
class downloadThread;
|
class downloadThread;
|
||||||
class QDropEvent;
|
class QDropEvent;
|
||||||
@@ -40,12 +41,11 @@ class engineSelectDlg : public QDialog, public Ui::engineSelect{
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Search related
|
|
||||||
QHash<QString, bool> installed_engines;
|
|
||||||
downloadThread *downloader;
|
downloadThread *downloader;
|
||||||
|
SupportedEngines *supported_engines;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
engineSelectDlg(QWidget *parent);
|
engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines);
|
||||||
~engineSelectDlg();
|
~engineSelectDlg();
|
||||||
QList<QTreeWidgetItem*> findItemsWithUrl(QString url);
|
QList<QTreeWidgetItem*> findItemsWithUrl(QString url);
|
||||||
QTreeWidgetItem* findItemWithID(QString id);
|
QTreeWidgetItem* findItemWithID(QString id);
|
||||||
@@ -53,15 +53,14 @@ class engineSelectDlg : public QDialog, public Ui::engineSelect{
|
|||||||
protected:
|
protected:
|
||||||
bool parseVersionsFile(QString versions_file, QString updateServer);
|
bool parseVersionsFile(QString versions_file, QString updateServer);
|
||||||
bool isUpdateNeeded(QString plugin_name, float new_version) const;
|
bool isUpdateNeeded(QString plugin_name, float new_version) const;
|
||||||
bool checkInstalled(QString plugin_name) const;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void enginesChanged();
|
void enginesChanged();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void saveSettings();
|
|
||||||
void on_closeButton_clicked();
|
void on_closeButton_clicked();
|
||||||
void loadSupportedSearchEngines(bool first=false);
|
void loadSupportedSearchEngines();
|
||||||
|
void addNewEngine(QString engine_name);
|
||||||
void toggleEngineState(QTreeWidgetItem*, int);
|
void toggleEngineState(QTreeWidgetItem*, int);
|
||||||
void setRowColor(int row, QString color);
|
void setRowColor(int row, QString color);
|
||||||
void processDownloadedFile(QString url, QString filePath);
|
void processDownloadedFile(QString url, QString filePath);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ private:
|
|||||||
QHash<QTreeWidgetItem*, RssFile*> mapping;
|
QHash<QTreeWidgetItem*, RssFile*> mapping;
|
||||||
QHash<QString, QTreeWidgetItem*> feeds_items;
|
QHash<QString, QTreeWidgetItem*> feeds_items;
|
||||||
QTreeWidgetItem* current_feed;
|
QTreeWidgetItem* current_feed;
|
||||||
|
QTreeWidgetItem *unread_item;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FeedList(QWidget *parent, RssManager *rssmanager): QTreeWidget(parent), rssmanager(rssmanager) {
|
FeedList(QWidget *parent, RssManager *rssmanager): QTreeWidget(parent), rssmanager(rssmanager) {
|
||||||
@@ -28,14 +29,17 @@ public:
|
|||||||
QTreeWidgetItem *___qtreewidgetitem = headerItem();
|
QTreeWidgetItem *___qtreewidgetitem = headerItem();
|
||||||
___qtreewidgetitem->setText(0, QApplication::translate("RSS", "RSS feeds", 0, QApplication::UnicodeUTF8));
|
___qtreewidgetitem->setText(0, QApplication::translate("RSS", "RSS feeds", 0, QApplication::UnicodeUTF8));
|
||||||
connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateCurrentFeed(QTreeWidgetItem*)));
|
connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateCurrentFeed(QTreeWidgetItem*)));
|
||||||
|
unread_item = new QTreeWidgetItem(this);
|
||||||
|
unread_item->setText(0, tr("Unread") + QString::fromUtf8(" (") + QString::number(rssmanager->getNbUnRead(), 10)+ QString(")"));
|
||||||
|
unread_item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/oxygen/mail-folder-inbox.png")));
|
||||||
|
itemAdded(unread_item, rssmanager);
|
||||||
|
setCurrentItem(unread_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void itemAdded(QTreeWidgetItem *item, RssFile* file) {
|
void itemAdded(QTreeWidgetItem *item, RssFile* file) {
|
||||||
mapping[item] = file;
|
mapping[item] = file;
|
||||||
if(file->getType() == RssFile::STREAM) {
|
if(file->getType() == RssFile::STREAM) {
|
||||||
feeds_items[file->getID()] = item;
|
feeds_items[file->getID()] = item;
|
||||||
if(topLevelItemCount() == 1)
|
|
||||||
setCurrentItem(item);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,15 +49,19 @@ public:
|
|||||||
feeds_items.remove(file->getID());
|
feeds_items.remove(file->getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasFeed(QString url) {
|
bool hasFeed(QString url) const {
|
||||||
return feeds_items.contains(QUrl(url).toString());
|
return feeds_items.contains(QUrl(url).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QTreeWidgetItem*> getAllFeedItems() {
|
QList<QTreeWidgetItem*> getAllFeedItems() const {
|
||||||
return feeds_items.values();
|
return feeds_items.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList getItemPath(QTreeWidgetItem* item) {
|
QTreeWidgetItem* getUnreadItem() const {
|
||||||
|
return unread_item;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList getItemPath(QTreeWidgetItem* item) const {
|
||||||
QStringList path;
|
QStringList path;
|
||||||
if(item) {
|
if(item) {
|
||||||
if(item->parent())
|
if(item->parent())
|
||||||
@@ -63,7 +71,7 @@ public:
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QTreeWidgetItem*> getAllOpenFolders(QTreeWidgetItem *parent=0) {
|
QList<QTreeWidgetItem*> getAllOpenFolders(QTreeWidgetItem *parent=0) const {
|
||||||
QList<QTreeWidgetItem*> open_folders;
|
QList<QTreeWidgetItem*> open_folders;
|
||||||
int nbChildren;
|
int nbChildren;
|
||||||
if(parent)
|
if(parent)
|
||||||
@@ -102,19 +110,15 @@ public:
|
|||||||
return feeds;
|
return feeds;
|
||||||
}
|
}
|
||||||
|
|
||||||
RssFile* getRSSItem(QTreeWidgetItem *item) {
|
RssFile* getRSSItem(QTreeWidgetItem *item) const {
|
||||||
return mapping[item];
|
return mapping[item];
|
||||||
}
|
}
|
||||||
|
|
||||||
RssFile* getCurrentRSSItem() {
|
RssFile::FileType getItemType(QTreeWidgetItem *item) const {
|
||||||
return mapping[current_feed];
|
|
||||||
}
|
|
||||||
|
|
||||||
RssFile::FileType getItemType(QTreeWidgetItem *item) {
|
|
||||||
return mapping[item]->getType();
|
return mapping[item]->getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getItemID(QTreeWidgetItem *item) {
|
QString getItemID(QTreeWidgetItem *item) const {
|
||||||
return mapping[item]->getID();
|
return mapping[item]->getID();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +126,10 @@ public:
|
|||||||
return feeds_items[url];
|
return feeds_items[url];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RssStream* getRSSItemFromUrl(QString url) const {
|
||||||
|
return (RssStream*)getRSSItem(getTreeItemFromUrl(url));
|
||||||
|
}
|
||||||
|
|
||||||
QTreeWidgetItem* currentItem() const {
|
QTreeWidgetItem* currentItem() const {
|
||||||
return current_feed;
|
return current_feed;
|
||||||
}
|
}
|
||||||
@@ -132,20 +140,29 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void foldersAltered(QList<QTreeWidgetItem*> folders);
|
void foldersAltered(QList<QTreeWidgetItem*> folders);
|
||||||
|
void overwriteAttempt(QString filename);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void updateCurrentFeed(QTreeWidgetItem* new_item) {
|
void updateCurrentFeed(QTreeWidgetItem* new_item) {
|
||||||
if(getItemType(new_item) == RssFile::STREAM)
|
if((new_item && getItemType(new_item) == RssFile::STREAM) || new_item == unread_item)
|
||||||
current_feed = new_item;
|
current_feed = new_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void dragMoveEvent(QDragMoveEvent * event) {
|
void dragMoveEvent(QDragMoveEvent * event) {
|
||||||
QTreeWidgetItem *item = itemAt(event->pos());
|
QTreeWidgetItem *item = itemAt(event->pos());
|
||||||
if(item && getItemType(item) != RssFile::FOLDER)
|
if(item == unread_item) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
else {
|
} else {
|
||||||
QTreeWidget::dragMoveEvent(event);
|
if(item && getItemType(item) != RssFile::FOLDER)
|
||||||
|
event->ignore();
|
||||||
|
else {
|
||||||
|
if(selectedItems().contains(unread_item)) {
|
||||||
|
event->ignore();
|
||||||
|
} else {
|
||||||
|
QTreeWidget::dragMoveEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +178,15 @@ protected:
|
|||||||
dest_folder = rssmanager;
|
dest_folder = rssmanager;
|
||||||
}
|
}
|
||||||
QList<QTreeWidgetItem *> src_items = selectedItems();
|
QList<QTreeWidgetItem *> src_items = selectedItems();
|
||||||
|
// Check if there is not going to overwrite another file
|
||||||
|
foreach(QTreeWidgetItem *src_item, src_items) {
|
||||||
|
RssFile *file = getRSSItem(src_item);
|
||||||
|
if(dest_folder->hasChild(file->getID())) {
|
||||||
|
emit overwriteAttempt(file->getID());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Proceed with the move
|
||||||
foreach(QTreeWidgetItem *src_item, src_items) {
|
foreach(QTreeWidgetItem *src_item, src_items) {
|
||||||
QTreeWidgetItem *parent_folder = src_item->parent();
|
QTreeWidgetItem *parent_folder = src_item->parent();
|
||||||
if(parent_folder && !folders_altered.contains(parent_folder))
|
if(parent_folder && !folders_altered.contains(parent_folder))
|
||||||
|
|||||||
@@ -200,14 +200,19 @@ void HttpConnection::respondCommand(QString command)
|
|||||||
if(command == "upload")
|
if(command == "upload")
|
||||||
{
|
{
|
||||||
QByteArray torrentfile = parser.torrent();
|
QByteArray torrentfile = parser.torrent();
|
||||||
// XXX: Trick to get a unique filename
|
// Get a unique filename
|
||||||
QString filePath;
|
QString filePath;
|
||||||
QTemporaryFile *tmpfile = new QTemporaryFile();
|
QTemporaryFile tmpfile;
|
||||||
if (tmpfile->open()) {
|
tmpfile.setAutoRemove(false);
|
||||||
filePath = tmpfile->fileName();
|
if (tmpfile.open()) {
|
||||||
|
filePath = tmpfile.fileName();
|
||||||
|
} else {
|
||||||
|
std::cerr << "I/O Error: Could not create temporary file" << std::endl;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
delete tmpfile;
|
tmpfile.close();
|
||||||
// write it to HD
|
// Now temporary file is created but closed so that it can be used.
|
||||||
|
// write torrent to temporary file
|
||||||
QFile torrent(filePath);
|
QFile torrent(filePath);
|
||||||
if(torrent.open(QIODevice::WriteOnly)) {
|
if(torrent.open(QIODevice::WriteOnly)) {
|
||||||
torrent.write(torrentfile);
|
torrent.write(torrentfile);
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
<!DOCTYPE RCC><RCC version="1.0">
|
<!DOCTYPE RCC><RCC version="1.0">
|
||||||
<qresource>
|
<qresource>
|
||||||
<file>Icons/gnome-shutdown.png</file>
|
|
||||||
<file>Icons/rss32.png</file>
|
<file>Icons/rss32.png</file>
|
||||||
<file>Icons/money.png</file>
|
|
||||||
<file>Icons/sphere2.png</file>
|
<file>Icons/sphere2.png</file>
|
||||||
<file>Icons/downarrow.png</file>
|
<file>Icons/downarrow.png</file>
|
||||||
<file>Icons/url.png</file>
|
<file>Icons/url.png</file>
|
||||||
@@ -29,7 +27,6 @@
|
|||||||
<file>Icons/skin/open.png</file>
|
<file>Icons/skin/open.png</file>
|
||||||
<file>Icons/skin/qbittorrent16.png</file>
|
<file>Icons/skin/qbittorrent16.png</file>
|
||||||
<file>Icons/skin/downloading.png</file>
|
<file>Icons/skin/downloading.png</file>
|
||||||
<file>Icons/skin/search.png</file>
|
|
||||||
<file>Icons/skin/pause_all.png</file>
|
<file>Icons/skin/pause_all.png</file>
|
||||||
<file>Icons/skin/play_all.png</file>
|
<file>Icons/skin/play_all.png</file>
|
||||||
<file>Icons/skin/pause.png</file>
|
<file>Icons/skin/pause.png</file>
|
||||||
@@ -73,7 +70,9 @@
|
|||||||
<file>Icons/flags/japan.png</file>
|
<file>Icons/flags/japan.png</file>
|
||||||
<file>Icons/oxygen/view-refresh.png</file>
|
<file>Icons/oxygen/view-refresh.png</file>
|
||||||
<file>Icons/oxygen/file.png</file>
|
<file>Icons/oxygen/file.png</file>
|
||||||
|
<file>Icons/oxygen/mail-folder-inbox.png</file>
|
||||||
<file>Icons/oxygen/time.png</file>
|
<file>Icons/oxygen/time.png</file>
|
||||||
|
<file>Icons/oxygen/edit-find.png</file>
|
||||||
<file>Icons/oxygen/folder-new.png</file>
|
<file>Icons/oxygen/folder-new.png</file>
|
||||||
<file>Icons/oxygen/edit-paste.png</file>
|
<file>Icons/oxygen/edit-paste.png</file>
|
||||||
<file>Icons/oxygen/proxy.png</file>
|
<file>Icons/oxygen/proxy.png</file>
|
||||||
@@ -86,6 +85,7 @@
|
|||||||
<file>Icons/oxygen/encrypted.png</file>
|
<file>Icons/oxygen/encrypted.png</file>
|
||||||
<file>Icons/oxygen/edit_clear.png</file>
|
<file>Icons/oxygen/edit_clear.png</file>
|
||||||
<file>Icons/oxygen/download.png</file>
|
<file>Icons/oxygen/download.png</file>
|
||||||
|
<file>Icons/oxygen/application-x-kgetlist-no.png</file>
|
||||||
<file>Icons/oxygen/gear.png</file>
|
<file>Icons/oxygen/gear.png</file>
|
||||||
<file>Icons/oxygen/remove.png</file>
|
<file>Icons/oxygen/remove.png</file>
|
||||||
<file>Icons/oxygen/browse.png</file>
|
<file>Icons/oxygen/browse.png</file>
|
||||||
@@ -94,13 +94,16 @@
|
|||||||
<file>Icons/oxygen/edit-copy.png</file>
|
<file>Icons/oxygen/edit-copy.png</file>
|
||||||
<file>Icons/oxygen/bt_settings.png</file>
|
<file>Icons/oxygen/bt_settings.png</file>
|
||||||
<file>Icons/oxygen/document-new.png</file>
|
<file>Icons/oxygen/document-new.png</file>
|
||||||
|
<file>Icons/oxygen/preferences-desktop.png</file>
|
||||||
|
<file>Icons/oxygen/tab-close.png</file>
|
||||||
|
<file>Icons/oxygen/wallet.png</file>
|
||||||
<file>Icons/oxygen/webui.png</file>
|
<file>Icons/oxygen/webui.png</file>
|
||||||
<file>Icons/oxygen/list-remove.png</file>
|
<file>Icons/oxygen/list-remove.png</file>
|
||||||
<file>Icons/oxygen/connection.png</file>
|
<file>Icons/oxygen/connection.png</file>
|
||||||
<file>Icons/oxygen/bug.png</file>
|
<file>Icons/oxygen/bug.png</file>
|
||||||
<file>Icons/oxygen/list-add.png</file>
|
<file>Icons/oxygen/list-add.png</file>
|
||||||
|
<file>Icons/oxygen/application-x-kgetlist.png</file>
|
||||||
<file>Icons/oxygen/folder.png</file>
|
<file>Icons/oxygen/folder.png</file>
|
||||||
<file>Icons/oxygen/configure.png</file>
|
|
||||||
<file>Icons/oxygen/edit-cut.png</file>
|
<file>Icons/oxygen/edit-cut.png</file>
|
||||||
<file>Icons/oxygen/unsubscribe.png</file>
|
<file>Icons/oxygen/unsubscribe.png</file>
|
||||||
<file>Icons/oxygen/subscribe16.png</file>
|
<file>Icons/oxygen/subscribe16.png</file>
|
||||||
|
|||||||