You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-09 18:32:15 +02:00
Compare commits
88 Commits
release-5.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cd29de365a | ||
![]() |
de78fc495b | ||
![]() |
0b89d9b1e9 | ||
![]() |
93731f1b3f | ||
![]() |
2e9e10299c | ||
![]() |
9f627b5ec9 | ||
![]() |
ad252f432a | ||
![]() |
eb1feddea6 | ||
![]() |
1634014dde | ||
![]() |
e863772159 | ||
![]() |
7c34f4e93c | ||
![]() |
91032056e1 | ||
![]() |
f427d267b6 | ||
![]() |
a7a8265053 | ||
![]() |
827fceca83 | ||
![]() |
7aaa3e8f51 | ||
![]() |
1fe49198d1 | ||
![]() |
c582aff563 | ||
![]() |
5272f1cba3 | ||
![]() |
b72d356083 | ||
![]() |
fbd6533eee | ||
![]() |
2998dbd0a1 | ||
![]() |
cb8da634f4 | ||
![]() |
e8f229816e | ||
![]() |
fe0fc952e8 | ||
![]() |
29a76ae600 | ||
![]() |
5471600dfb | ||
![]() |
df42c4d59f | ||
![]() |
8047495b2e | ||
![]() |
de04b47c29 | ||
![]() |
b709bec24d | ||
![]() |
35f93e8e16 | ||
![]() |
554a84f8b0 | ||
![]() |
f26fcabde1 | ||
![]() |
75b91c204d | ||
![]() |
0837c25602 | ||
![]() |
34f8937b8d | ||
![]() |
4a7f3ee415 | ||
![]() |
b218531ff7 | ||
![]() |
e96dee2038 | ||
![]() |
080105c088 | ||
![]() |
5d2535c1c1 | ||
![]() |
49b21059fa | ||
![]() |
c1af948649 | ||
![]() |
36ad3df9e7 | ||
![]() |
e607d721a2 | ||
![]() |
5bfbfeb665 | ||
![]() |
1f1eabb1e9 | ||
![]() |
762050f8fc | ||
![]() |
e3c1270205 | ||
![]() |
414685910b | ||
![]() |
d61b9c5d4d | ||
![]() |
cf86a1cecd | ||
![]() |
a3f3287e24 | ||
![]() |
6e18d780ba | ||
![]() |
7dde763fc6 | ||
![]() |
8c85ffca5f | ||
![]() |
321e568d86 | ||
![]() |
e0649a7e78 | ||
![]() |
4cd3233cd0 | ||
![]() |
c554528afe | ||
![]() |
7ab7f4b0fc | ||
![]() |
58c0ac7638 | ||
![]() |
2514224a3a | ||
![]() |
247f6b4a8e | ||
![]() |
3d89864b75 | ||
![]() |
7ac75ad772 | ||
![]() |
caa628371f | ||
![]() |
fd31f632d9 | ||
![]() |
a25b6e087b | ||
![]() |
1626d938d1 | ||
![]() |
a4c7640499 | ||
![]() |
2c1b93a12b | ||
![]() |
8f19025c2a | ||
![]() |
20d41bcff2 | ||
![]() |
1ad77e00ff | ||
![]() |
0b65c02666 | ||
![]() |
294095367a | ||
![]() |
05a6ffd554 | ||
![]() |
e0a30dc40c | ||
![]() |
1940bc4e73 | ||
![]() |
a7e4e0273a | ||
![]() |
29a9d57cdc | ||
![]() |
9c7a4e4983 | ||
![]() |
35ead5bcf2 | ||
![]() |
645bd58d79 | ||
![]() |
6c47a552ab | ||
![]() |
f54bc8bea4 |
66
Changelog
66
Changelog
@@ -1,4 +1,68 @@
|
||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
|
||||
* Sun Oct 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.8
|
||||
- BUGFIX: Fix possible crash on manual peer ban
|
||||
- BUGFIX: Improved hostname resolution code
|
||||
- BUGFIX: Several search plugins fixed
|
||||
- BUGFIX: Auto-disable the shutdown feature
|
||||
- BUGFIX: Remember the current property tab on startup
|
||||
- BUGFIX: Fix status list widget height issue on style change
|
||||
- BUGFIX: Fix rounding issue in torrent progress display
|
||||
- BUGFIX: Fix issue when altering files priorities of a seeding torrent
|
||||
- BUGFIX: Better fix for save path editing issues in torrent addition dialog
|
||||
- BUGFIX: Peers can now be sorted by country
|
||||
|
||||
* Tue Oct 19 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.7
|
||||
- BUGFIX: Display the priority column when the queueing system gets enabled
|
||||
- BUGFIX: Fix encoding problem in file renaming
|
||||
- BUGFIX: Delete uneeded files on torrent "soft" deletion
|
||||
- BUGFIX: Fix issues when marking a file as 'not downloaded' causes the torrent to complete
|
||||
- BUGFIX: Improved "Set Location" and "Change save path" dialogs
|
||||
- BUGFIX: Fix display of queued seeding torrents
|
||||
|
||||
* Sun Oct 17 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.6
|
||||
- BUGFIX: Fix "torrent seeding after creation" feature
|
||||
- BUGFIX: The properties panel data would sometimes not match the selected torrent
|
||||
- BUGFIX: Fix detection of files at final destination when temp dir is used
|
||||
- BUGFIX: Fix moving of a torrent to an unexisting directory
|
||||
|
||||
* Tue Oct 12 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.5
|
||||
- BUGFIX: Remember torrent completion date correctly
|
||||
- BUGFIX: Fix feature to keep incomplete torrents in a separate folder
|
||||
- BUGFIX: Fix display of URL seeds in the UI
|
||||
- BUGFIX: Improved peer hostname resolution with caching
|
||||
- BUGFIX: Piece availability/downloaded widgets performance improvement
|
||||
|
||||
* Fri Oct 1 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.4
|
||||
- BUGFIX: Clean program exit on system shutdown/logout
|
||||
- BUGFIX: Fix possible search engine plugin update
|
||||
|
||||
* Tue Sep 28 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.3
|
||||
- BUGFIX: Fix encoding issue in command line parameters processing
|
||||
- BUGFIX: Fix possible crash when changing the save path in addition dialog
|
||||
- BUGFIX: Fix wrong mapping to source model
|
||||
|
||||
* Sun Sep 26 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.2
|
||||
- BUGFIX: Fix display of torrent content in addition dialog
|
||||
- BUGFIX: Really fix manual editing of save path in torrent addition dialog
|
||||
|
||||
* Sun Sep 26 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.1
|
||||
- I18N: Updated Arabic translation
|
||||
- I18N: Fixes to German translation
|
||||
- BUGFIX: Save path can now be edited in torrent addition dialog
|
||||
- BUGFIX: Fix save path encoding on non-utf8 systems
|
||||
- BUGFIX: Fix saving to drive root on Windows
|
||||
- BUGFIX: OGV can now be previewed
|
||||
- BUGFIX: Maximum download limit is now 10MB/s
|
||||
- BUGFIX: Fix 'download in scan dir' persistence
|
||||
- BUGFIX: Add .torrent extension only when missing (torrent creator)
|
||||
- BUGFIX: Fix possible issue with temporary download path persistence
|
||||
- BUGFIX: Added support for | (OR) operator in RSS feed downloader
|
||||
- BUGFIX: Fix Web UI for spanish users
|
||||
- BUGFIX: Fix locale switching from Web UI
|
||||
- BUGFIX: Use AND operator for torrentdownloads.net searches
|
||||
- BUGFIX: Limit torrent addition dialog width to fit the screen
|
||||
- COSMETIC: Fix progress bars style on Windows
|
||||
|
||||
* Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
|
||||
- FEATURE: Added actions to "Move to top/bottom" of priority queue
|
||||
- FEATURE: Auto-Shutdown on downloads completion
|
||||
- FEATURE: Email notification on download completion
|
||||
|
26
qcm/qtsingleapplication.qcm
Normal file
26
qcm/qtsingleapplication.qcm
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: libboost
|
||||
arg: with-qtsingleapplication=[system|shipped], Use the shipped qtsingleapplication library or the system one
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_qtsingleapplication : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_qtsingleapplication(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "qtsingleapplication library"; }
|
||||
QString shortname() const { return "qtsingleapplication"; }
|
||||
|
||||
bool exec(){
|
||||
QString s;
|
||||
s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION");
|
||||
if(s.compare("system", Qt::CaseInsensitive) == 0) {
|
||||
// System
|
||||
conf->addDefine("USE_SYSTEM_QTSINGLEAPPLICATION");
|
||||
printf(" [system] ");
|
||||
} else {
|
||||
printf(" [shipped] ");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
35
src/GUI.cpp
35
src/GUI.cpp
@@ -42,6 +42,7 @@
|
||||
#include <QClipboard>
|
||||
#include <QCloseEvent>
|
||||
#include <QShortcut>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "GUI.h"
|
||||
#include "transferlistwidget.h"
|
||||
@@ -71,6 +72,7 @@
|
||||
void qt_mac_set_dock_menu(QMenu *menu);
|
||||
#endif
|
||||
#include "lineedit.h"
|
||||
#include "sessionapplication.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
@@ -88,6 +90,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
ui_locked = Preferences::isUILocked();
|
||||
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
||||
displaySpeedInTitle = Preferences::speedInTitleBar();
|
||||
// Clean exit on log out
|
||||
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
|
||||
// Setting icons
|
||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
||||
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png")));
|
||||
@@ -110,7 +114,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
actionSet_global_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png")));
|
||||
actionDocumentation->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/qb_question.png")));
|
||||
actionLock_qBittorrent->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/encrypted32.png")));
|
||||
QMenu *lockMenu = new QMenu();
|
||||
lockMenu = new QMenu();
|
||||
QAction *defineUiLockPasswdAct = lockMenu->addAction(tr("Set the password..."));
|
||||
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
|
||||
actionLock_qBittorrent->setMenu(lockMenu);
|
||||
@@ -206,13 +210,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
properties->readSettings();
|
||||
|
||||
// Limit status filters list height
|
||||
int cur_height = 80;
|
||||
do {
|
||||
transferListFilters->getStatusFilters()->setFixedHeight(cur_height);
|
||||
cur_height += 10;
|
||||
transferListFilters->getStatusFilters()->scrollToBottom();
|
||||
}while(transferListFilters->getStatusFilters()->verticalScrollBar()->sliderPosition() > 0);
|
||||
transferListFilters->getStatusFilters()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
transferListFilters->getStatusFilters()->updateHeight();
|
||||
|
||||
if(ui_locked) {
|
||||
hide();
|
||||
@@ -248,6 +246,16 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
#endif
|
||||
}
|
||||
|
||||
void GUI::deleteBTSession() {
|
||||
guiUpdater->stop();
|
||||
status_bar->stopTimer();
|
||||
if(BTSession) {
|
||||
delete BTSession;
|
||||
BTSession = 0;
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(close()));
|
||||
}
|
||||
|
||||
// Destructor
|
||||
GUI::~GUI() {
|
||||
qDebug("GUI destruction");
|
||||
@@ -258,7 +266,9 @@ GUI::~GUI() {
|
||||
#endif
|
||||
// Async deletion of Bittorrent session as early as possible
|
||||
// in order to speed up exit
|
||||
session_proxy sp = BTSession->asyncDeletion();
|
||||
session_proxy sp;
|
||||
if(BTSession)
|
||||
sp = BTSession->asyncDeletion();
|
||||
// Some saving
|
||||
properties->saveSettings();
|
||||
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int)));
|
||||
@@ -269,6 +279,7 @@ GUI::~GUI() {
|
||||
delete search_filter;
|
||||
delete transferList;
|
||||
delete guiUpdater;
|
||||
delete lockMenu;
|
||||
if(createTorrentDlg)
|
||||
delete createTorrentDlg;
|
||||
if(console)
|
||||
@@ -662,7 +673,7 @@ void GUI::closeEvent(QCloseEvent *e) {
|
||||
e->accept();
|
||||
return;
|
||||
}
|
||||
if(settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool() && BTSession->hasActiveTorrents()) {
|
||||
if(settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool() && BTSession && BTSession->hasActiveTorrents()) {
|
||||
if(e->spontaneous() || force_exit) {
|
||||
if(!isVisible())
|
||||
show();
|
||||
@@ -947,7 +958,7 @@ void GUI::loadPreferences(bool configure_session) {
|
||||
properties->getPeerList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
|
||||
// Queueing System
|
||||
if(Preferences::isQueueingSystemEnabled()) {
|
||||
if(!configure_session || !BTSession->isQueueingEnabled()) {
|
||||
if(!actionDecreasePriority->isVisible()) {
|
||||
transferList->hidePriorityColumn(false);
|
||||
actionDecreasePriority->setVisible(true);
|
||||
actionIncreasePriority->setVisible(true);
|
||||
@@ -956,7 +967,7 @@ void GUI::loadPreferences(bool configure_session) {
|
||||
toolBar->layout()->setSpacing(7);
|
||||
}
|
||||
} else {
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
if(actionDecreasePriority->isVisible()) {
|
||||
transferList->hidePriorityColumn(true);
|
||||
actionDecreasePriority->setVisible(false);
|
||||
actionIncreasePriority->setVisible(false);
|
||||
|
@@ -80,6 +80,7 @@ public slots:
|
||||
void downloadFromURLList(const QStringList& urls);
|
||||
void updateAltSpeedsBtn(bool alternative);
|
||||
void updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused);
|
||||
void deleteBTSession();
|
||||
|
||||
protected slots:
|
||||
// GUI related slots
|
||||
@@ -170,6 +171,7 @@ private:
|
||||
QAction *prioSeparator2;
|
||||
QSplitter *hSplitter;
|
||||
QSplitter *vSplitter;
|
||||
QMenu *lockMenu;
|
||||
// Search
|
||||
QPointer<SearchEngine> searchEngine;
|
||||
// RSS
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Network;P2P;
|
||||
Comment=V2.4.0
|
||||
Comment=V2.4.8
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[ar]=العميل Bittorrent
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 71 KiB |
@@ -47,7 +47,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.4.0</string>
|
||||
<string>2.4.8</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
|
6
src/about.qrc
Normal file
6
src/about.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>gpl.html</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
438
src/about_imp.h
438
src/about_imp.h
File diff suppressed because it is too large
Load Diff
@@ -165,6 +165,7 @@ Bittorrent::~Bittorrent() {
|
||||
#endif
|
||||
saveSessionState();
|
||||
saveFastResumeData();
|
||||
qDebug("Deleting the session");
|
||||
// Delete session
|
||||
session_proxy sp = s->abort();
|
||||
delete s;
|
||||
@@ -399,7 +400,7 @@ void Bittorrent::configureSession() {
|
||||
std::cout << "HTTP user agent is " << sessionSettings.user_agent << std::endl;
|
||||
addConsoleMessage(tr("HTTP user agent is %1").arg(misc::toQString(sessionSettings.user_agent)));
|
||||
|
||||
sessionSettings.upnp_ignore_nonrouters = true;
|
||||
sessionSettings.upnp_ignore_nonrouters = false;
|
||||
sessionSettings.use_dht_as_fallback = false;
|
||||
// To prevent ISPs from blocking seeding
|
||||
sessionSettings.lazy_bitfields = true;
|
||||
@@ -755,7 +756,13 @@ void Bittorrent::deleteTorrent(QString hash, bool delete_local_files) {
|
||||
savePathsToRemove[hash] = save_dir.absolutePath();
|
||||
s->remove_torrent(h.get_torrent_handle(), session::delete_files);
|
||||
} else {
|
||||
QStringList uneeded_files = h.uneeded_files_path();
|
||||
s->remove_torrent(h.get_torrent_handle());
|
||||
// Remove unneeded files
|
||||
foreach(const QString &uneeded_file, uneeded_files) {
|
||||
qDebug("Removing uneeded file: %s", qPrintable(uneeded_file));
|
||||
misc::safeRemove(uneeded_file);
|
||||
}
|
||||
}
|
||||
// Remove it from torrent backup directory
|
||||
QDir torrentBackup(misc::BTBackupLocation());
|
||||
@@ -863,17 +870,17 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
||||
}
|
||||
QString torrent_name = misc::magnetUriToName(magnet_uri);
|
||||
const QString savePath(getSavePath(hash, false, QString::null, torrent_name));
|
||||
if(!defaultTempPath.isEmpty() && resumed && !TorrentPersistentData::isSeed(hash)) {
|
||||
if(!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) && resumed) {
|
||||
qDebug("addMagnetURI: Temp folder is enabled.");
|
||||
qDebug("addTorrent::Temp folder is enabled.");
|
||||
QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
|
||||
p.save_path = torrent_tmp_path.toLocal8Bit().constData();
|
||||
p.save_path = torrent_tmp_path.toUtf8().constData();
|
||||
// Check if save path exists, creating it otherwise
|
||||
if(!QDir(torrent_tmp_path).exists())
|
||||
QDir().mkpath(torrent_tmp_path);
|
||||
qDebug("addMagnetURI: using save_path: %s", qPrintable(torrent_tmp_path));
|
||||
} else {
|
||||
p.save_path = savePath.toLocal8Bit().constData();
|
||||
p.save_path = savePath.toUtf8().constData();
|
||||
// Check if save path exists, creating it otherwise
|
||||
if(!QDir(savePath).exists())
|
||||
QDir().mkpath(savePath);
|
||||
@@ -912,10 +919,10 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
||||
Q_ASSERT(h.hash() == hash);
|
||||
|
||||
// If temp path is enabled, move torrent
|
||||
/*if(!defaultTempPath.isEmpty() && !resumed) {
|
||||
if(!defaultTempPath.isEmpty() && !resumed) {
|
||||
qDebug("Temp folder is enabled, moving new torrent to temp folder");
|
||||
h.move_storage(defaultTempPath);
|
||||
}*/
|
||||
}
|
||||
|
||||
// Connections limit per torrent
|
||||
h.set_max_connections(Preferences::getMaxConnecsPerTorrent());
|
||||
@@ -1095,6 +1102,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
}
|
||||
// Actually add the torrent
|
||||
QString root_folder = misc::truncateRootFolder(t);
|
||||
qDebug("Truncated root folder: %s", qPrintable(root_folder));
|
||||
add_torrent_params p;
|
||||
//Getting fast resume data if existing
|
||||
std::vector<char> buf;
|
||||
@@ -1114,20 +1122,20 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
} else {
|
||||
savePath = getSavePath(hash, fromScanDir, path, root_folder);
|
||||
}
|
||||
if(!defaultTempPath.isEmpty() && resumed && !TorrentPersistentData::isSeed(hash)) {
|
||||
if(!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) && resumed) {
|
||||
qDebug("addTorrent::Temp folder is enabled.");
|
||||
QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
|
||||
if(!root_folder.isEmpty()) {
|
||||
if(!torrent_tmp_path.endsWith("/")) torrent_tmp_path += "/";
|
||||
torrent_tmp_path += root_folder;
|
||||
}
|
||||
p.save_path = torrent_tmp_path.toLocal8Bit().constData();
|
||||
p.save_path = torrent_tmp_path.toUtf8().constData();
|
||||
// Check if save path exists, creating it otherwise
|
||||
if(!QDir(torrent_tmp_path).exists())
|
||||
QDir().mkpath(torrent_tmp_path);
|
||||
qDebug("addTorrent: using save_path: %s", qPrintable(torrent_tmp_path));
|
||||
} else {
|
||||
p.save_path = savePath.toLocal8Bit().constData();
|
||||
p.save_path = savePath.toUtf8().constData();
|
||||
// Check if save path exists, creating it otherwise
|
||||
if(!QDir(savePath).exists())
|
||||
QDir().mkpath(savePath);
|
||||
@@ -1170,7 +1178,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
TorrentPersistentData::setRootFolder(hash, root_folder);
|
||||
|
||||
// If temp path is enabled, move torrent
|
||||
/*if(!defaultTempPath.isEmpty() && !resumed) {
|
||||
if(!defaultTempPath.isEmpty() && !resumed) {
|
||||
qDebug("Temp folder is enabled, moving new torrent to temp folder");
|
||||
QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
|
||||
if(!root_folder.isEmpty()) {
|
||||
@@ -1178,7 +1186,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
torrent_tmp_path += root_folder;
|
||||
}
|
||||
h.move_storage(torrent_tmp_path);
|
||||
}*/
|
||||
}
|
||||
|
||||
// Connections limit per torrent
|
||||
h.set_max_connections(Preferences::getMaxConnecsPerTorrent());
|
||||
@@ -1541,6 +1549,7 @@ void Bittorrent::saveTempFastResumeData() {
|
||||
// Only save fast resume data for unfinished and unpaused torrents (Optimization)
|
||||
// Called periodically and on exit
|
||||
void Bittorrent::saveFastResumeData() {
|
||||
qDebug("Saving fast resume data...");
|
||||
// Stop listening for alerts
|
||||
resumeDataTimer.stop();
|
||||
timerAlerts->stop();
|
||||
@@ -2014,7 +2023,6 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
if (torrent_finished_alert* p = dynamic_cast<torrent_finished_alert*>(a.get())) {
|
||||
QTorrentHandle h(p->handle);
|
||||
if(h.is_valid()) {
|
||||
emit finishedTorrent(h);
|
||||
const QString hash = h.hash();
|
||||
#if LIBTORRENT_VERSION_MINOR > 14
|
||||
// Remove .!qB extension if necessary
|
||||
@@ -2046,27 +2054,23 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Move to download directory if necessary
|
||||
if(!defaultTempPath.isEmpty()) {
|
||||
// Check if directory is different
|
||||
const QDir current_dir(h.save_path());
|
||||
const QDir save_dir(getSavePath(hash));
|
||||
if(current_dir != save_dir) {
|
||||
h.move_storage(save_dir.absolutePath());
|
||||
// Move to download directory if necessary
|
||||
if(!defaultTempPath.isEmpty()) {
|
||||
// Check if directory is different
|
||||
const QDir current_dir(h.save_path());
|
||||
const QDir save_dir(getSavePath(hash));
|
||||
if(current_dir != save_dir) {
|
||||
h.move_storage(save_dir.absolutePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Recheck if the user asked to
|
||||
if(Preferences::recheckTorrentsOnCompletion() && !was_already_seeded) {
|
||||
// Remember finished state
|
||||
TorrentPersistentData::saveSeedStatus(h);
|
||||
h.force_recheck();
|
||||
} else {
|
||||
// Remember finished state
|
||||
TorrentPersistentData::saveSeedStatus(h);
|
||||
}
|
||||
qDebug("Received finished alert for %s", qPrintable(h.name()));
|
||||
if(!was_already_seeded) {
|
||||
// Recheck if the user asked to
|
||||
if(Preferences::recheckTorrentsOnCompletion()) {
|
||||
h.force_recheck();
|
||||
}
|
||||
emit finishedTorrent(h);
|
||||
qDebug("Received finished alert for %s", qPrintable(h.name()));
|
||||
bool will_shutdown = Preferences::shutdownWhenDownloadsComplete() && !hasDownloadingTorrents();
|
||||
// AutoRun program
|
||||
if(Preferences::isAutoRunEnabled())
|
||||
@@ -2077,6 +2081,8 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
// Auto-Shutdown
|
||||
if(will_shutdown) {
|
||||
qDebug("Preparing for auto-shutdown because all downloads are complete!");
|
||||
// Disabling it for next time
|
||||
Preferences::setShutdownWhenDownloadsComplete(false);
|
||||
#if LIBTORRENT_VERSION_MINOR < 15
|
||||
saveDHTEntry();
|
||||
#endif
|
||||
@@ -2171,7 +2177,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
if(h.is_valid()) {
|
||||
// Attempt to remove old folder if empty
|
||||
const QString& old_save_path = TorrentPersistentData::getPreviousPath(h.hash());
|
||||
const QString new_save_path = QString::fromLocal8Bit(p->path.c_str());
|
||||
const QString new_save_path = misc::toQStringU(p->path);
|
||||
qDebug("Torrent moved from %s to %s", qPrintable(old_save_path), qPrintable(new_save_path));
|
||||
QDir old_save_dir(old_save_path);
|
||||
if(old_save_dir != QDir(defaultSavePath) && old_save_dir != QDir(defaultTempPath)) {
|
||||
@@ -2490,7 +2496,10 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
qDebug("getSavePath, got save_path from persistent data: %s", qPrintable(savePath));
|
||||
}
|
||||
// Clean path
|
||||
savePath = savePath.replace("\\", "/");
|
||||
savePath = misc::expandPath(savePath);
|
||||
if(!savePath.endsWith("/"))
|
||||
savePath += "/";
|
||||
return savePath;
|
||||
}
|
||||
|
||||
|
@@ -191,7 +191,8 @@ void createtorrent::on_createButton_clicked(){
|
||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), last_path, tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
if(!destination.isEmpty()) {
|
||||
settings.setValue("CreateTorrent/last_save_path", misc::removeLastPathPart(destination));
|
||||
destination += QString::fromUtf8(".torrent");
|
||||
if(!destination.toUpper().endsWith(".TORRENT"))
|
||||
destination += QString::fromUtf8(".torrent");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@@ -219,16 +220,22 @@ void createtorrent::handleCreationSuccess(QString path, QString branch_path) {
|
||||
// Remove busy cursor
|
||||
setCursor(QCursor(Qt::ArrowCursor));
|
||||
if(checkStartSeeding->isChecked()) {
|
||||
QString root_folder;
|
||||
// Create save path temp data
|
||||
boost::intrusive_ptr<torrent_info> t;
|
||||
try {
|
||||
t = new torrent_info(path.toUtf8().data());
|
||||
root_folder = misc::truncateRootFolder(t);
|
||||
} catch(std::exception&) {
|
||||
QMessageBox::critical(0, tr("Torrent creation"), tr("Created torrent file is invalid. It won't be added to download list."));
|
||||
return;
|
||||
}
|
||||
QString hash = misc::toQString(t->info_hash());
|
||||
TorrentTempData::setSavePath(hash, branch_path);
|
||||
QString save_path = branch_path;
|
||||
if(!root_folder.isEmpty()) {
|
||||
save_path = QDir(save_path).absoluteFilePath(root_folder);
|
||||
}
|
||||
TorrentTempData::setSavePath(hash, save_path);
|
||||
#if LIBTORRENT_VERSION_MINOR > 14
|
||||
// Enable seeding mode (do not recheck the files)
|
||||
TorrentTempData::setSeedingMode(hash, true);
|
||||
@@ -284,8 +291,7 @@ void torrentCreatorThread::run() {
|
||||
char const* creator_str = "qBittorrent "VERSION;
|
||||
try {
|
||||
file_storage fs;
|
||||
file_pool fp;
|
||||
path full_path = complete(path(input_path.toLocal8Bit().data()));
|
||||
path full_path = complete(path(input_path.toUtf8().constData()));
|
||||
// Adding files to the torrent
|
||||
add_files(fs, full_path, file_filter);
|
||||
if(abort) return;
|
||||
@@ -310,7 +316,7 @@ void torrentCreatorThread::run() {
|
||||
t.set_priv(is_private);
|
||||
if(abort) return;
|
||||
// create the torrent and print it to out
|
||||
ofstream out(complete(path((const char*)save_path.toLocal8Bit())), std::ios_base::binary);
|
||||
ofstream out(complete(path((const char*)save_path.toUtf8())), std::ios_base::binary);
|
||||
bencode(std::ostream_iterator<char>(out), t.generate());
|
||||
emit updateProgress(100);
|
||||
emit creationSuccess(save_path, QString::fromUtf8(full_path.branch_path().string().c_str()));
|
||||
|
@@ -60,31 +60,34 @@ public:
|
||||
pix.fill();
|
||||
pixmap = pix;
|
||||
} else {
|
||||
const int nb_pieces = pieces.size();
|
||||
const qulonglong nb_pieces = pieces.size();
|
||||
// Reduce the number of pieces before creating the pixmap
|
||||
// otherwise it can crash when there are too many pieces
|
||||
if(nb_pieces > width()) {
|
||||
const int ratio = floor(nb_pieces/(double)width());
|
||||
std::vector<bool> scaled_pieces;
|
||||
std::vector<bool> scaled_downloading;
|
||||
for(int i=0; i<nb_pieces; i+= ratio) {
|
||||
const uint w = width();
|
||||
if(nb_pieces > w) {
|
||||
const uint ratio = floor(nb_pieces/(double)w);
|
||||
bitfield scaled_pieces(ceil(nb_pieces/(double)ratio), false);
|
||||
bitfield scaled_downloading(ceil(nb_pieces/(double)ratio), false);
|
||||
uint scaled_index = 0;
|
||||
for(qulonglong i=0; i<nb_pieces; i+= ratio) {
|
||||
bool have = true;
|
||||
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||
for(qulonglong j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||
if(!pieces[i]) { have = false; break; }
|
||||
}
|
||||
scaled_pieces.push_back(have);
|
||||
if(have) {
|
||||
scaled_downloading.push_back(false);
|
||||
scaled_pieces.set_bit(scaled_index);
|
||||
} else {
|
||||
bool downloading = false;
|
||||
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||
for(qulonglong j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||
if(downloading_pieces[i]) { downloading = true; break; }
|
||||
}
|
||||
scaled_downloading.push_back(downloading);
|
||||
if(downloading)
|
||||
scaled_downloading.set_bit(scaled_index);
|
||||
}
|
||||
++scaled_index;
|
||||
}
|
||||
QPixmap pix = QPixmap(scaled_pieces.size(), 1);
|
||||
pix.fill();
|
||||
//pix.fill();
|
||||
QPainter painter(&pix);
|
||||
for(uint i=0; i<scaled_pieces.size(); ++i) {
|
||||
if(scaled_pieces[i]) {
|
||||
@@ -101,7 +104,7 @@ public:
|
||||
pixmap = pix;
|
||||
} else {
|
||||
QPixmap pix = QPixmap(pieces.size(), 1);
|
||||
pix.fill();
|
||||
//pix.fill();
|
||||
QPainter painter(&pix);
|
||||
for(uint i=0; i<pieces.size(); ++i) {
|
||||
if(pieces[i]) {
|
||||
|
@@ -44,7 +44,7 @@
|
||||
#include <QTemporaryFile>
|
||||
|
||||
enum EngineColumns {ENGINE_NAME, ENGINE_URL, ENGINE_STATE, ENGINE_ID};
|
||||
#define UPDATE_URL "http://qbittorrent.svn.sourceforge.net/viewvc/qbittorrent/trunk/src/search_engine/engines/"
|
||||
#define UPDATE_URL "http://qbittorrent.svn.sourceforge.net/viewvc/qbittorrent/branches/v2_4_x/src/search_engine/engines/"
|
||||
|
||||
engineSelectDlg::engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines) : QDialog(parent), supported_engines(supported_engines) {
|
||||
setupUi(this);
|
||||
@@ -270,6 +270,7 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
||||
// Backup in case install fails
|
||||
QFile::copy(dest_path, dest_path+".bak");
|
||||
misc::safeRemove(dest_path);
|
||||
misc::safeRemove(dest_path+"c");
|
||||
update = true;
|
||||
}
|
||||
// Copy the plugin
|
||||
|
@@ -38,6 +38,7 @@
|
||||
//#include "proplistdelegate.h"
|
||||
#include "torrentpersistentdata.h"
|
||||
#include <QDebug>
|
||||
#include <QTranslator>
|
||||
|
||||
EventManager::EventManager(QObject *parent, Bittorrent *BTSession)
|
||||
: QObject(parent), BTSession(BTSession)
|
||||
@@ -124,8 +125,20 @@ QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
||||
|
||||
void EventManager::setGlobalPreferences(QVariantMap m) const {
|
||||
// UI
|
||||
if(m.contains("locale"))
|
||||
Preferences::setLocale(m["locale"].toString());
|
||||
if(m.contains("locale")) {
|
||||
QString locale = m["locale"].toString();
|
||||
if(Preferences::getLocale() != locale) {
|
||||
QTranslator *translator = new QTranslator;
|
||||
if(translator->load(QString::fromUtf8(":/lang/qbittorrent_") + locale)){
|
||||
qDebug("%s locale recognized, using translation.", qPrintable(locale));
|
||||
}else{
|
||||
qDebug("%s locale unrecognized, using default (en_GB).", qPrintable(locale));
|
||||
}
|
||||
qApp->installTranslator(translator);
|
||||
}
|
||||
|
||||
Preferences::setLocale(locale);
|
||||
}
|
||||
// Downloads
|
||||
if(m.contains("save_path"))
|
||||
Preferences::setSavePath(m["save_path"].toString());
|
||||
|
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
QStringList getNotMatchingTokens() const {
|
||||
QString notmatching = this->value("not", "").toString();
|
||||
return notmatching.split(" ");
|
||||
return notmatching.split(QRegExp("[\\s|]"));
|
||||
}
|
||||
|
||||
QString getNotMatchingTokens_str() const {
|
||||
|
@@ -407,9 +407,12 @@ class FilterParserThread : public QThread {
|
||||
// First, import current filter
|
||||
ip_filter filter = s->get_ip_filter();
|
||||
foreach(const QString &ip, IPs) {
|
||||
qDebug("Manual ban of peer %s", ip.toLocal8Bit().data());
|
||||
address_v4 addr = address_v4::from_string(ip.toLocal8Bit().data());
|
||||
filter.add_rule(addr, addr, ip_filter::blocked);
|
||||
qDebug("Manual ban of peer %s", ip.toLocal8Bit().constData());
|
||||
boost::system::error_code ec;
|
||||
address_v4 addr = address_v4::from_string(ip.toLocal8Bit().constData(), ec);
|
||||
Q_ASSERT(!ec);
|
||||
if(!ec)
|
||||
filter.add_rule(addr, addr, ip_filter::blocked);
|
||||
}
|
||||
s->set_ip_filter(filter);
|
||||
}
|
||||
|
508
src/gpl.html
Normal file
508
src/gpl.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -132,6 +132,7 @@ namespace json {
|
||||
tmp += c;
|
||||
}
|
||||
}
|
||||
if(!tmp.isEmpty()) couples << tmp;
|
||||
foreach(QString couple, couples) {
|
||||
QStringList parts = couple.split(":");
|
||||
if(parts.size() != 2) continue;
|
||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user