1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-14 11:52:15 +02:00

Compare commits

..

25 Commits

Author SHA1 Message Date
sledgehammer999
3947f9c8ae Bump to 3.1.5 2014-01-16 23:41:22 +02:00
sledgehammer999
6c6ebaf485 Update Changelog. 2014-01-16 23:36:58 +02:00
sledgehammer999
57915462b0 Sync translations from Transifex. 2014-01-16 23:35:28 +02:00
sledgehammer999
8b94da20d3 Don't count paused torrents for the autoshutdown. Closes #1280. 2014-01-16 16:17:50 +02:00
Sébastien Lavoie
84c65c2b50 Issue #1251 - Added basic retina support 2014-01-12 15:16:40 +02:00
Nick Tiskov
e8c9db0084 Fix rss settings corruption when checking regexp and going to other rule. 2014-01-12 15:16:30 +02:00
sledgehammer999
19419b85ff Correctly remove isohunt engine. 2014-01-11 18:31:22 +02:00
sledgehammer999
5eb8a2a9f0 Remove isohunt search engine. 2014-01-11 18:14:47 +02:00
sledgehammer999
95bdb61ad2 Fix piratebay search engine. 2014-01-11 18:14:35 +02:00
Konstantin Goncharik
d79c79b4ae In preferences.h now argument is const references 2014-01-06 02:35:47 +02:00
Konstantin Goncharik
9b77d1f9f3 In statsdialog.cpp fix initialization iEnd 2014-01-06 02:35:34 +02:00
Konstantin Goncharik
659fa242e2 In smtp.cpp fix 'ct' reassign. 2014-01-06 02:35:22 +02:00
Konstantin Goncharik
1ba13b32a8 In rssdownloadrule.{cpp,h} 'RssDownloadRule::operator==' made const. 2014-01-06 02:35:09 +02:00
Konstantin Goncharik
1c38568f42 In qbtsession.cpp exception made caught by reference
Conflicts:
	src/qtlibtorrent/qbtsession.cpp
2014-01-06 02:34:52 +02:00
Konstantin Goncharik
7c1f712181 In qtorrenthandle.cpp exception made caught by reference 2014-01-06 02:34:11 +02:00
sledgehammer999
81d813c4c5 Fix notifications with xfce4-notifyd. 2014-01-04 19:41:59 +02:00
sledgehammer999
2cf7e94767 Force write settings to disk before exiting. 2014-01-04 19:41:47 +02:00
sledgehammer999
9f71dd2c61 Correctly detect libtorrent version. 2014-01-03 02:37:14 +02:00
sledgehammer999
f93374a946 Delete temporary after they aren't needed. Closes #1188. 2014-01-03 02:37:13 +02:00
sledgehammer999
4158465109 Ensure that the options window will always be placed onscreen. Closes #1226. 2014-01-03 02:37:12 +02:00
sledgehammer999
125d130984 Ensure that at least one column in the tranferlist is always visible. Closes #1165. 2014-01-03 02:37:11 +02:00
sledgehammer999
f66ef95918 Allow to resize the columns in Add New Torrent dialog. Closes #1207 #676 2014-01-03 02:37:11 +02:00
sledgehammer999
634b4d4f4d Preview now correctly uses the selected file. Closes #1222 #1182. 2014-01-03 02:37:10 +02:00
sledgehammer999
ced950a764 Do cleanup work in an earlier stage to ensure correct conf saving. 2014-01-03 02:37:09 +02:00
sledgehammer999
d84c367db5 Fix compilation with Qt 4.7. Closes #1215. 2013-12-31 19:58:21 +02:00
49 changed files with 336 additions and 388 deletions

View File

@@ -1,3 +1,20 @@
* Thu 16 Jan 2014 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.1.5
- BUGFIX: Fix compilation with Qt 4.7. Closes #1215. (sledgehammer999)
- BUGFIX: Third attempt at fixing saving settings on OS shutdown. (sledgehammer999)
- BUGFIX: Preview now correctly uses the selected file. Closes #1222 #1182. (sledgehammer999)
- BUGFIX: Allow to resize the columns in Add New Torrent dialog. Closes #1207 #676 (sledgehammer999)
- BUGFIX: Ensure that at least one column in the tranferlist is always visible. Closes #1165. (sledgehammer999)
- BUGFIX: Ensure that the options window will always be placed onscreen. Closes #1226. (sledgehammer999)
- BUGFIX: Delete temporary files after they aren't needed. Closes #1188. (sledgehammer999)
- BUGFIX: Correctly detect libtorrent version. (sledgehammer999)
- BUGFIX: Various code cppcheck fixes (Konstantin Goncharik)
- BUGFIX: Remove isohunt search engine and update thepiratebay url (sledgehammer999)
- BUGFIX: Fix rss settings corruption when checking regexp and going to other rule. (Gelmir)
- BUGFIX: Don't count paused torrents for the autoshutdown. Closes #1280. (sledgehammer999)
- LINUX: Fix notifications with xfce4-notifyd.
- OSX: Added basic retina support. Closes #1251. (Sébastien Lavoie)
- OTHER: Sync translations from Transifex.
* Sun 29 Dec 2013 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.1.4
- FEATURE: Statistics dialog (Gelmir)
- FEATURE: Tooltips explaining each peer's connection flags (sledgehammer999)

View File

@@ -82,6 +82,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(QWidget *parent) :
ui->label_combo->addItem(label);
}
ui->label_combo->model()->sort(0);
ui->content_tree->header()->setSortIndicator(0, Qt::AscendingOrder);
loadState();
// Signal / slots
connect(ui->adv_button, SIGNAL(clicked(bool)), SLOT(showAdvancedSettings(bool)));
@@ -214,13 +215,13 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path, const QString
ui->date_lbl->setText(m_torrentInfo->creation_date() ? misc::toQString(*m_torrentInfo->creation_date()) : tr("Not available"));
updateDiskSpaceLabel();
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
file_storage fs = m_torrentInfo->files();
#endif
// Populate m_filesList
for (int i = 0; i < m_torrentInfo->num_files(); ++i) {
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
m_filesPath << misc::toQStringU(fs.file_path(m_torrentInfo->file_at(i)));
#else
m_filesPath << misc::toQStringU(m_torrentInfo->file_at(i).path.string());
@@ -243,10 +244,9 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path, const QString
// Expand root folder
ui->content_tree->setExpanded(m_contentModel->index(0, 0), true);
ui->content_tree->header()->setResizeMode(0, QHeaderView::Stretch);
} else {
// Update save paths (append file name to them)
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
QString single_file_relpath = misc::toQStringU(fs.file_path(m_torrentInfo->file_at(0)));
#else
QString single_file_relpath = misc::toQStringU(m_torrentInfo->file_at(0).path.string());
@@ -675,13 +675,13 @@ void AddNewTorrentDialog::updateMetadata(const QTorrentHandle &h) {
ui->date_lbl->setText(m_torrentInfo->creation_date() ? misc::toQString(*m_torrentInfo->creation_date()) : tr("Not available"));
updateDiskSpaceLabel();
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
file_storage fs = m_torrentInfo->files();
#endif
// Populate m_filesList
for (int i = 0; i < m_torrentInfo->num_files(); ++i) {
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
m_filesPath << misc::toQStringU(fs.file_path(m_torrentInfo->file_at(i)));
#else
m_filesPath << misc::toQStringU(m_torrentInfo->file_at(i).path.string());
@@ -704,10 +704,9 @@ void AddNewTorrentDialog::updateMetadata(const QTorrentHandle &h) {
// Expand root folder
ui->content_tree->setExpanded(m_contentModel->index(0, 0), true);
ui->content_tree->header()->setResizeMode(0, QHeaderView::Stretch);
} else {
// Update save paths (append file name to them)
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
QString single_file_relpath = misc::toQStringU(fs.file_path(m_torrentInfo->file_at(0)));
#else
QString single_file_relpath = misc::toQStringU(m_torrentInfo->file_at(0).path.string());

View File

@@ -176,9 +176,6 @@
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>

View File

@@ -134,8 +134,8 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
}
// Success
QTemporaryFile *tmpfile = new QTemporaryFile;
tmpfile->setAutoRemove(false);
if (tmpfile->open()) {
tmpfile->setAutoRemove(false);
QString filePath = tmpfile->fileName();
qDebug("Temporary filename is: %s", qPrintable(filePath));
if (reply->isOpen() || reply->open(QIODevice::ReadOnly)) {
@@ -153,6 +153,7 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
emit downloadFinished(url, filePath);
} else {
delete tmpfile;
fsutils::forceRemove(filePath);
// Error when reading the request
emit downloadFailure(url, tr("I/O Error"));
}

View File

@@ -41,7 +41,7 @@ class HeadlessLoader: public QObject {
public:
HeadlessLoader(const QStringList &torrentCmdLine) {
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(deleteBTSession()), Qt::DirectConnection);
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(shutdownCleanUp()), Qt::DirectConnection);
Preferences pref;
// Enable Web UI
pref.setWebUiEnabled(true);
@@ -63,7 +63,8 @@ public:
}
public slots:
void deleteBTSession() {
void shutdownCleanUp() {
Preferences().sync();
QBtSession::drop();
}

View File

@@ -739,13 +739,13 @@ Túto informáciu by ste mali zistiť z nastavení svojho webového prehliadača
<location filename="../deletionconfirmationdlg.h" line="46"/>
<source>Are you sure you want to delete &quot;%1&quot; from the transfer list?</source>
<comment>Are you sure you want to delete &quot;ubuntu-linux-iso&quot; from the transfer list?</comment>
<translation type="unfinished"/>
<translation>Ste si istý, že chcete vymazať &quot;%1&quot; zo zoznamu prenosov?</translation>
</message>
<message>
<location filename="../deletionconfirmationdlg.h" line="48"/>
<source>Are you sure you want to delete these %1 torrents from the transfer list?</source>
<comment>Are you sure you want to delete these 5 torrents from the transfer list?</comment>
<translation type="unfinished"/>
<translation>Ste si istý, že chcete vymazať týchto %1 torrentov zo zoznamu prenosov?</translation>
</message>
</context>
<context>
@@ -1326,19 +1326,19 @@ Už vás nebudeme ďalej upozorňovať.</translation>
<message>
<location filename="../mainwindow.ui" line="382"/>
<source>Statistics</source>
<translation type="unfinished"/>
<translation>Štatistika</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="387"/>
<location filename="../mainwindow.cpp" line="1383"/>
<source>Check for updates</source>
<translation type="unfinished"/>
<translation>Skontrolovať aktualizácie</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="390"/>
<location filename="../mainwindow.cpp" line="1384"/>
<source>Check for program updates</source>
<translation type="unfinished"/>
<translation>Skontrolovať aktualizácie programu</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="292"/>
@@ -1546,12 +1546,12 @@ Chcete asociovať qBittorrent so súbormi torrent a odkazmi Magnet?</translation
<message>
<location filename="../mainwindow.cpp" line="1484"/>
<source>Checking for updates...</source>
<translation type="unfinished"/>
<translation>Overujem aktualizácie...</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1485"/>
<source>Already checking for program updates in the background</source>
<translation type="unfinished"/>
<translation>Overovanie aktualizácií programu už prebieha na pozadí </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="415"/>
@@ -1792,22 +1792,22 @@ Chcete aktualizovať qBittorrent na verziu %1?</translation>
<message>
<location filename="../properties/peerlistwidget.cpp" line="468"/>
<source>interested(local) and choked(peer)</source>
<translation type="unfinished"/>
<translation>interesovaný(lokálny) a obmedzený(rovesník)</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="474"/>
<source>interested(local) and unchoked(peer)</source>
<translation type="unfinished"/>
<translation>interesovaný(lokálny) a neobmedzený(rovesník)</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="483"/>
<source>interested(peer) and choked(local)</source>
<translation type="unfinished"/>
<translation>interesovaný(rovesník) a obmedzený(lokálny)</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="489"/>
<source>interested(peer) and unchoked(local)</source>
<translation type="unfinished"/>
<translation>interesovaný(rovesník) a neobmedzený(lokálny)</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="497"/>
@@ -1822,42 +1822,42 @@ Chcete aktualizovať qBittorrent na verziu %1?</translation>
<message>
<location filename="../properties/peerlistwidget.cpp" line="511"/>
<source>incoming connection</source>
<translation type="unfinished"/>
<translation>prichádzajúce spojenie</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="518"/>
<source>not interested(local) and unchoked(peer)</source>
<translation type="unfinished"/>
<translation>neinteresovaný(lokálny) a neobmedzený(rovesník)</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="525"/>
<source>not interested(peer) and unchoked(local)</source>
<translation type="unfinished"/>
<translation>neinteresovaný(rovesník) a neobmedzený(lokálny)</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="532"/>
<source>peer from PEX</source>
<translation type="unfinished"/>
<translation>rovesník z PEX</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="539"/>
<source>peer from DHT</source>
<translation type="unfinished"/>
<translation>rovesník z DHT</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="546"/>
<source>encrypted traffic</source>
<translation type="unfinished"/>
<translation>šifrovaný prenos</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="553"/>
<source>encrypted handshake</source>
<translation type="unfinished"/>
<translation>šifrovaný handshake</translation>
</message>
<message>
<location filename="../properties/peerlistwidget.cpp" line="569"/>
<source>peer from LSD</source>
<translation type="unfinished"/>
<translation>rovesník z LSD</translation>
</message>
</context>
<context>
@@ -3745,42 +3745,42 @@ Prosím, nainštalujte ho ručne.</translation>
<message>
<location filename="../statsdialog.ui" line="14"/>
<source>Statistics</source>
<translation type="unfinished"/>
<translation>Štatistika</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="20"/>
<source>User statistics</source>
<translation type="unfinished"/>
<translation>Užívateľská štatistika</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="26"/>
<source>Total peer connections:</source>
<translation type="unfinished"/>
<translation>Celkovo spojení s rovesníkmi:</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="33"/>
<source>Global ratio:</source>
<translation type="unfinished"/>
<translation>Globálny pomer:</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="47"/>
<source>Alltime download:</source>
<translation type="unfinished"/>
<translation>Stiahnuté totálne:</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="68"/>
<source>Alltime upload:</source>
<translation type="unfinished"/>
<translation>Nahrané totálne:</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="82"/>
<source>Total waste (this session):</source>
<translation type="unfinished"/>
<translation>Celkovo zahodené (v tomto sedení):</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="99"/>
<source>Cache statistics</source>
<translation type="unfinished"/>
<translation>Štatistika vyrovnávacej pamäte</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="105"/>
@@ -3795,12 +3795,12 @@ Prosím, nainštalujte ho ručne.</translation>
<message>
<location filename="../statsdialog.ui" line="136"/>
<source>Performance statistics</source>
<translation type="unfinished"/>
<translation>Štatistika činnosti:</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="170"/>
<source>Queued I/O jobs:</source>
<translation type="unfinished"/>
<translation>I/O úlohy zaradené do fronty:</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="177"/>
@@ -3810,7 +3810,7 @@ Prosím, nainštalujte ho ručne.</translation>
<message>
<location filename="../statsdialog.ui" line="184"/>
<source>Average time in queue (ms):</source>
<translation type="unfinished"/>
<translation>Priemerný čas vo fronte (ms):</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="191"/>
@@ -3820,12 +3820,12 @@ Prosím, nainštalujte ho ručne.</translation>
<message>
<location filename="../statsdialog.ui" line="198"/>
<source>Total queued size:</source>
<translation type="unfinished"/>
<translation>Celková veľkosť fronty:</translation>
</message>
<message>
<location filename="../statsdialog.ui" line="243"/>
<source>OK</source>
<translation type="unfinished"/>
<translation>OK</translation>
</message>
</context>
<context>

View File

@@ -45,13 +45,17 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1.4</string>
<string>3.1.5</string>
<key>CFBundleSignature</key>
<string>qBit</string>
<key>CFBundleExecutable</key>
<string>qbittorrent</string>
<key>CFBundleIdentifier</key>
<string>org.qbittorrent</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>NSAppleScriptEnabled</key>
<string>YES</string>
<key>NSHumanReadableCopyright</key>

View File

@@ -110,7 +110,7 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
setWindowTitle(QString("qBittorrent %1").arg(QString::fromUtf8(VERSION)));
displaySpeedInTitle = pref.speedInTitleBar();
// Clean exit on log out
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(deleteBTSession()), Qt::DirectConnection);
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(shutdownCleanUp()), Qt::DirectConnection);
// Setting icons
#if defined(Q_WS_X11)
if (Preferences().useSystemIconTheme())
@@ -336,19 +336,15 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
}
}
void MainWindow::deleteBTSession() {
guiUpdater->stop();
status_bar->stopTimer();
QBtSession::drop();
m_pwr->setActivityState(false);
// Save window size, columns size
writeSettings();
}
// Destructor
MainWindow::~MainWindow() {
void MainWindow::shutdownCleanUp() {
qDebug("GUI destruction");
hide();
guiUpdater->stop();
status_bar->stopTimer();
m_pwr->setActivityState(false);
QBtSession::drop();
// Save window size, columns size
writeSettings();
#ifdef Q_WS_MAC
// Workaround to avoid bug http://bugreports.qt.nokia.com/browse/QTBUG-7305
setUnifiedTitleAndToolBarOnMac(false);
@@ -381,15 +377,12 @@ MainWindow::~MainWindow() {
delete properties;
delete hSplitter;
delete vSplitter;
if (systrayCreator) {
if (systrayCreator)
delete systrayCreator;
}
if (systrayIcon) {
if (systrayIcon)
delete systrayIcon;
}
if (myTrayIconMenu) {
if (myTrayIconMenu)
delete myTrayIconMenu;
}
delete tabs;
// Keyboard shortcuts
delete switchSearchShortcut;
@@ -397,7 +390,8 @@ MainWindow::~MainWindow() {
delete switchTransferShortcut;
delete switchRSSShortcut;
IconProvider::drop();
qDebug("Exiting GUI destructor...");
Preferences().sync();
qDebug("Finished GUI destruction");
}
void MainWindow::defineUILockPassword() {
@@ -633,7 +627,7 @@ void MainWindow::handleDownloadFromUrlFailure(QString url, QString reason) const
void MainWindow::on_actionSet_global_upload_limit_triggered() {
qDebug("actionSet_global_upload_limit_triggered");
bool ok;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
int cur_limit = QBtSession::instance()->getSession()->settings().upload_rate_limit;
#else
int cur_limit = QBtSession::instance()->getSession()->upload_rate_limit();
@@ -652,7 +646,7 @@ void MainWindow::on_actionSet_global_upload_limit_triggered() {
void MainWindow::on_actionSet_global_download_limit_triggered() {
qDebug("actionSet_global_download_limit_triggered");
bool ok;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
int cur_limit = QBtSession::instance()->getSession()->settings().download_rate_limit;
#else
int cur_limit = QBtSession::instance()->getSession()->download_rate_limit();
@@ -1181,15 +1175,22 @@ void MainWindow::showNotificationBaloon(QString title, QString msg) const {
org::freedesktop::Notifications notifications("org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
QDBusConnection::sessionBus());
if (notifications.isValid()) {
QVariantMap hints;
hints["desktop-entry"] = "qBittorrent";
QDBusPendingReply<uint> reply = notifications.Notify("qBittorrent", 0, "qbittorrent", title,
msg, QStringList(), hints, -1);
reply.waitForFinished();
if (!reply.isError())
return;
}
// Testing for 'notifications.isValid()' isn't helpful here.
// If the notification daemon is configured to run 'as needed'
// the above check can be false if the daemon wasn't started
// by another application. In this case DBus will be able to
// start the notification daemon and complete our request. Such
// a daemon is xfce4-notifyd, DBus autostarts it and after
// some inactivity shuts it down. Other DEs, like GNOME, choose
// to start their daemons at the session startup and have it sit
// idling for the whole session.
QVariantMap hints;
hints["desktop-entry"] = "qBittorrent";
QDBusPendingReply<uint> reply = notifications.Notify("qBittorrent", 0, "qbittorrent", title,
msg, QStringList(), hints, -1);
reply.waitForFinished();
if (!reply.isError())
return;
#endif
if (systrayIcon && QSystemTrayIcon::supportsMessages())
systrayIcon->showMessage(title, msg, QSystemTrayIcon::Information, TIME_TRAY_BALLOON);

View File

@@ -72,7 +72,6 @@ class MainWindow : public QMainWindow, private Ui::MainWindow{
public:
// Construct / Destruct
MainWindow(QWidget *parent=0, const QStringList& torrentCmdLine = QStringList());
~MainWindow();
// Methods
QWidget* getCurrentTabWidget() const;
TransferListWidget* getTransferList() const { return transferList; }
@@ -86,7 +85,7 @@ public slots:
void downloadFromURLList(const QStringList& urls);
void updateAltSpeedsBtn(bool alternative);
void updateNbTorrents();
void deleteBTSession();
void shutdownCleanUp();
protected slots:
// GUI related slots

View File

@@ -518,7 +518,7 @@ QString misc::parseHtmlLinks(const QString &raw_text)
return result;
}
#if LIBTORRENT_VERSION_NUM < 001600
#if LIBTORRENT_VERSION_NUM < 1600
QString misc::toQString(const boost::posix_time::ptime& boostDate) {
if (boostDate.is_not_a_date_time()) return "";
struct std::tm tm;

View File

@@ -107,7 +107,7 @@ namespace misc
QList<int> intListfromStringList(const QStringList &l);
QList<bool> boolListfromStringList(const QStringList &l);
#if LIBTORRENT_VERSION_NUM < 001600
#if LIBTORRENT_VERSION_NUM < 1600
QString toQString(const boost::posix_time::ptime& boostDate);
#else
QString toQString(time_t t);

View File

@@ -14,7 +14,7 @@
enum AdvSettingsCols {PROPERTY, VALUE};
enum AdvSettingsRows {DISK_CACHE,
#if LIBTORRENT_VERSION_NUM >= 001610
#if LIBTORRENT_VERSION_NUM >= 1610
DISK_CACHE_TTL,
#endif
OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, NETWORK_ADDRESS, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
@@ -37,7 +37,7 @@ private:
cb_super_seeding, cb_program_notifications, cb_tracker_status, cb_confirm_torrent_deletion,
cb_enable_tracker_ext;
QComboBox combo_iface;
#if LIBTORRENT_VERSION_NUM >= 001610
#if LIBTORRENT_VERSION_NUM >= 1610
QSpinBox spin_cache_ttl;
#endif
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
@@ -76,7 +76,7 @@ public slots:
Preferences pref;
// Disk write cache
pref.setDiskCacheSize(spin_cache.value());
#if LIBTORRENT_VERSION_NUM >= 001610
#if LIBTORRENT_VERSION_NUM >= 1610
pref.setDiskCacheTTL(spin_cache_ttl.value());
#endif
// Outgoing ports
@@ -182,7 +182,7 @@ private slots:
spin_cache.setValue(pref.diskCacheSize());
updateCacheSpinSuffix(spin_cache.value());
setRow(DISK_CACHE, tr("Disk write cache size"), &spin_cache);
#if LIBTORRENT_VERSION_NUM >= 001610
#if LIBTORRENT_VERSION_NUM >= 1610
// Disk cache expiry
spin_cache_ttl.setMinimum(15);
spin_cache_ttl.setMaximum(600);

View File

@@ -122,7 +122,7 @@ options_imp::options_imp(QWidget *parent):
checkStartup->setVisible(false);
groupFileAssociation->setVisible(false);
#endif
#if LIBTORRENT_VERSION_NUM < 001600
#if LIBTORRENT_VERSION_NUM < 1600
checkAnonymousMode->setVisible(false);
label_anonymous->setVisible(false);
#endif
@@ -208,7 +208,7 @@ options_imp::options_imp(QWidget *parent):
connect(spinMaxUploads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinMaxUploadsPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
connect(checkAnonymousMode, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
#endif
connect(checkPeX, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@@ -254,7 +254,7 @@ options_imp::options_imp(QWidget *parent):
applyButton->setEnabled(false);
// Tab selection mecanism
connect(tabSelection, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
#if LIBTORRENT_VERSION_NUM < 001600
#if LIBTORRENT_VERSION_NUM < 1600
checkuTP->setVisible(false);
checkLimituTPConnections->setVisible(false);
#endif
@@ -266,8 +266,8 @@ options_imp::options_imp(QWidget *parent):
connect(advancedSettings, SIGNAL(settingsChanged()), this, SLOT(enableApplyButton()));
// Adapt size
show();
loadWindowState();
show();
}
void options_imp::initializeLanguageCombo()
@@ -304,7 +304,8 @@ void options_imp::loadWindowState() {
QIniSettings settings;
resize(settings.value(QString::fromUtf8("Preferences/State/size"), sizeFittingScreen()).toSize());
QPoint p = settings.value(QString::fromUtf8("Preferences/State/pos"), QPoint()).toPoint();
if (!p.isNull())
QRect scr_rect = qApp->desktop()->screenGeometry();
if (!p.isNull() && scr_rect.contains(p))
move(p);
// Load slider size
const QStringList sizes_str = settings.value("Preferences/State/hSplitterSizes", QStringList()).toStringList();
@@ -459,7 +460,7 @@ void options_imp::saveOptions() {
pref.setDHTPort(getDHTPort());
pref.setLSDEnabled(isLSDEnabled());
pref.setEncryptionSetting(getEncryptionSetting());
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
pref.enableAnonymousMode(checkAnonymousMode->isChecked());
#endif
pref.setGlobalMaxRatio(getMaxRatio());
@@ -745,7 +746,7 @@ void options_imp::loadOptions() {
checkPeX->setChecked(pref.isPeXEnabled());
checkLSD->setChecked(pref.isLSDEnabled());
comboEncryption->setCurrentIndex(pref.getEncryptionSetting());
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
checkAnonymousMode->setChecked(pref.isAnonymousModeEnabled());
/* make sure ui matches options */
toggleAnonymousMode(checkAnonymousMode->isChecked());

View File

@@ -894,7 +894,7 @@ public:
return value("Preferences/DynDNS/DomainName", "changeme.dyndns.org").toString();
}
void setDynDomainName(const QString name) {
void setDynDomainName(const QString &name) {
setValue("Preferences/DynDNS/DomainName", name);
}
@@ -902,7 +902,7 @@ public:
return value("Preferences/DynDNS/Username").toString();
}
void setDynDNSUsername(const QString username) {
void setDynDNSUsername(const QString &username) {
setValue("Preferences/DynDNS/Username", username);
}
@@ -910,7 +910,7 @@ public:
return value("Preferences/DynDNS/Password").toString();
}
void setDynDNSPassword(const QString password) {
void setDynDNSPassword(const QString &password) {
setValue("Preferences/DynDNS/Password", password);
}
@@ -980,7 +980,7 @@ public:
}
uint diskCacheSize() const {
#if LIBTORRENT_VERSION_NUM >= 001610
#if LIBTORRENT_VERSION_NUM >= 1610
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), 0).toUInt();
#else
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), 128).toUInt();
@@ -991,7 +991,7 @@ public:
setValue(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), size);
}
#if LIBTORRENT_VERSION_NUM >= 001610
#if LIBTORRENT_VERSION_NUM >= 1610
uint diskCacheTTL() const {
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheTTL"), 60).toUInt();
}
@@ -1109,7 +1109,7 @@ public:
return value(QString::fromUtf8("Preferences/Connection/InetAddress"), QString()).toString();
}
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
bool isAnonymousModeEnabled() const {
return value(QString::fromUtf8("Preferences/Advanced/AnonymousMode"), false).toBool();
}

View File

@@ -52,6 +52,7 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent)
previewListModel->setHeaderData(SIZE, Qt::Horizontal, tr("Size"));
previewListModel->setHeaderData(PROGRESS, Qt::Horizontal, tr("Progress"));
previewList->setModel(previewListModel);
previewList->hideColumn(FILE_INDEX);
listDelegate = new PreviewListDelegate(this);
previewList->setItemDelegate(listDelegate);
previewList->header()->resizeSection(0, 200);
@@ -71,7 +72,7 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent)
previewListModel->setData(previewListModel->index(row, NAME), QVariant(fileName));
previewListModel->setData(previewListModel->index(row, SIZE), QVariant((qlonglong)h.filesize_at(i)));
previewListModel->setData(previewListModel->index(row, PROGRESS), QVariant((double)fp[i]/h.filesize_at(i)));
indexes << i;
previewListModel->setData(previewListModel->index(row, FILE_INDEX), QVariant(i));
}
}
@@ -104,26 +105,19 @@ PreviewSelect::~PreviewSelect() {
void PreviewSelect::on_previewButton_clicked() {
QModelIndex index;
QModelIndexList selectedIndexes = previewList->selectionModel()->selectedRows(NAME);
QModelIndexList selectedIndexes = previewList->selectionModel()->selectedRows(FILE_INDEX);
if (selectedIndexes.size() == 0) return;
// Flush data
h.flush_cache();
QStringList absolute_paths(h.absolute_files_path());
QString path;
foreach (index, selectedIndexes) {
path = absolute_paths.at(indexes.at(index.row()));
// File
if (QFile::exists(path)) {
emit readyToPreviewFile(path);
} else {
QMessageBox::critical(0, tr("Preview impossible"), tr("Sorry, we can't preview this file"));
}
close();
return;
}
qDebug("Cannot find file: %s", path.toLocal8Bit().data());
QMessageBox::critical(0, tr("Preview impossible"), tr("Sorry, we can't preview this file"));
//only one file should be selected
QString path = absolute_paths.at(selectedIndexes.at(0).data().toInt());
// File
if (QFile::exists(path))
emit readyToPreviewFile(path);
else
QMessageBox::critical(0, tr("Preview impossible"), tr("Sorry, we can't preview this file"));
close();
}

View File

@@ -46,7 +46,7 @@ class PreviewSelect: public QDialog, private Ui::preview {
Q_OBJECT
public:
enum PreviewColumn { NAME, SIZE, PROGRESS, NB_COLUMNS };
enum PreviewColumn { NAME, SIZE, PROGRESS, FILE_INDEX, NB_COLUMNS };
public:
PreviewSelect(QWidget* parent, QTorrentHandle h);
@@ -63,7 +63,6 @@ private:
QStandardItemModel *previewListModel;
PreviewListDelegate *listDelegate;
QTorrentHandle h;
QList<int> indexes;
};

View File

@@ -239,7 +239,7 @@ void PeerListWidget::limitUpRateSelectedPeers(const QStringList& peer_ips)
bool ok = false;
int cur_limit = -1;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
boost::asio::ip::tcp::endpoint first_ep = m_peerEndpoints.value(peer_ips.first(),
boost::asio::ip::tcp::endpoint());
if (first_ep != boost::asio::ip::tcp::endpoint())
@@ -274,7 +274,7 @@ void PeerListWidget::limitDlRateSelectedPeers(const QStringList& peer_ips)
return;
bool ok = false;
int cur_limit = -1;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
boost::asio::ip::tcp::endpoint first_ep = m_peerEndpoints.value(peer_ips.first(),
boost::asio::ip::tcp::endpoint());
if (first_ep != boost::asio::ip::tcp::endpoint())
@@ -443,7 +443,7 @@ QString PeerListWidget::getConnectionString(int connection_type)
{
QString connection;
switch(connection_type) {
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
case peer_info::bittorrent_utp:
connection = "uTP";
break;
@@ -554,8 +554,7 @@ void PeerListWidget::getFlags(const peer_info& peer, QString& flags, QString& to
tooltip += ", ";
}
#if LIBTORRENT_VERSION_NUM > 001500
//P = Peer is using uTorrent uTP
#if LIBTORRENT_VERSION_NUM > 1500 //P = Peer is using uTorrent uTP
if (peer.connection_type & peer_info::bittorrent_utp) {
flags += "P ";
tooltip += QString::fromUtf8("μTP");

View File

@@ -453,7 +453,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint&) {
myFilesLlistMenu.addSeparator();
}
QMenu subMenu;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
if (!h.status(0x0).is_seeding) {
#else
if (!static_cast<torrent_handle>(h).is_seed()) {

View File

@@ -159,7 +159,7 @@ public:
if (index.column() != PRIORITY) return 0;
if (properties) {
QTorrentHandle h = properties->getCurrentTorrent();
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
if (!h.is_valid() || !h.has_metadata() || h.status(0x0).is_seeding) return 0;
#else
if (!h.is_valid() || !h.has_metadata() || static_cast<libtorrent::torrent_handle>(h).is_seed()) return 0;

View File

@@ -41,6 +41,7 @@
#include "ui_trackersadditiondlg.h"
#include "downloadthread.h"
#include "qtorrenthandle.h"
#include "fs_utils.h"
class TrackersAdditionDlg : public QDialog, private Ui::TrackersAdditionDlg{
Q_OBJECT
@@ -79,6 +80,7 @@ public slots:
setCursor(Qt::ArrowCursor);
uTorrentListButton->setEnabled(true);
sender()->deleteLater();
fsutils::forceRemove(path);
return;
}
QList<QUrl> existingTrackers;
@@ -113,7 +115,7 @@ public slots:
}
// Clean up
list_file.close();
list_file.remove();
fsutils::forceRemove(path);
//To restore the cursor ...
setCursor(Qt::ArrowCursor);
uTorrentListButton->setEnabled(true);

View File

@@ -69,12 +69,12 @@
#include <libtorrent/torrent_info.hpp>
#include <libtorrent/upnp.hpp>
#include <libtorrent/natpmp.hpp>
#if LIBTORRENT_VERSION_NUM < 001600
#if LIBTORRENT_VERSION_NUM < 1600
#include <boost/filesystem/exception.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#endif
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
#include "libtorrent/error_code.hpp"
#endif
#include <queue>
@@ -120,7 +120,7 @@ QBtSession::QBtSession()
BigRatioTimer->setInterval(10000);
connect(BigRatioTimer, SIGNAL(timeout()), SLOT(processBigRatios()));
Preferences pref;
#if LIBTORRENT_VERSION_NUM < 001600
#if LIBTORRENT_VERSION_NUM < 1600
// To avoid some exceptions
boost::filesystem::path::default_name_check(boost::filesystem::no_check);
#endif
@@ -398,7 +398,7 @@ void QBtSession::configureSession() {
sessionSettings.upnp_ignore_nonrouters = true;
sessionSettings.use_dht_as_fallback = false;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
// Disable support for SSL torrents for now
sessionSettings.ssl_listen = 0;
#endif
@@ -414,11 +414,11 @@ void QBtSession::configureSession() {
sessionSettings.auto_scrape_min_interval = 900; // 15 minutes
int cache_size = pref.diskCacheSize();
sessionSettings.cache_size = cache_size ? cache_size * 64 : -1;
#if LIBTORRENT_VERSION_NUM >= 001610
#if LIBTORRENT_VERSION_NUM >= 1610
sessionSettings.cache_expiry = pref.diskCacheTTL();
#endif
qDebug() << "Using a disk cache size of" << cache_size << "MiB";
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
sessionSettings.anonymous_mode = pref.isAnonymousModeEnabled();
if (sessionSettings.anonymous_mode) {
addConsoleMessage(tr("Anonymous mode [ON]"), "blue");
@@ -457,7 +457,7 @@ void QBtSession::configureSession() {
// IP address to announce to trackers
QString announce_ip = pref.getNetworkAddress();
if (!announce_ip.isEmpty()) {
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
sessionSettings.announce_ip = announce_ip.toStdString();
#else
boost::system::error_code ec;
@@ -470,7 +470,7 @@ void QBtSession::configureSession() {
}
// Super seeding
sessionSettings.strict_super_seeding = pref.isSuperSeedingEnabled();
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
// * Max Half-open connections
sessionSettings.half_open_limit = pref.getMaxHalfOpenConnections();
// * Max connections limit
@@ -485,7 +485,7 @@ void QBtSession::configureSession() {
// * Global max upload slots
s->set_max_uploads(pref.getMaxUploads());
#endif
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
// uTP
sessionSettings.enable_incoming_utp = pref.isuTPEnabled();
sessionSettings.enable_outgoing_utp = pref.isuTPEnabled();
@@ -761,8 +761,9 @@ bool QBtSession::hasDownloadingTorrents() const {
for ( ; torrentIT != torrentITend; ++torrentIT) {
if (torrentIT->is_valid()) {
try {
const torrent_status::state_t state = torrentIT->status().state;
if (state != torrent_status::finished && state != torrent_status::seeding)
const torrent_status status = torrentIT->status();
if (status.state != torrent_status::finished && status.state != torrent_status::seeding
&& !status.paused)
return true;
} catch(std::exception) {}
}
@@ -985,7 +986,7 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed, bool f
// Adding torrent to Bittorrent session
try {
h = QTorrentHandle(add_magnet_uri(*s, magnet_uri.toStdString(), p));
}catch(std::exception e) {
}catch(std::exception &e) {
qDebug("Error: %s", e.what());
}
// Check if it worked
@@ -1137,7 +1138,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
qDebug("Successfully loaded fast resume data");
}
}
#if LIBTORRENT_VERSION_NUM < 001600
#if LIBTORRENT_VERSION_NUM < 1600
else {
// Generate fake resume data to make sure unwanted files
// are not allocated
@@ -1184,7 +1185,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
// Adding torrent to Bittorrent session
try {
h = QTorrentHandle(s->add_torrent(p));
}catch(std::exception e) {
}catch(std::exception &e) {
qDebug("Error: %s", e.what());
}
// Check if it worked
@@ -1273,7 +1274,7 @@ add_torrent_params QBtSession::initializeAddTorrentParams(const QString &hash) {
p.storage_mode = storage_mode_sparse;
// Priorities
/*#if LIBTORRENT_VERSION_NUM >= 001600
/*#if LIBTORRENT_VERSION_NUM >= 1600
if (TorrentTempData::hasTempData(hash)) {
std::vector<int> fp;
TorrentTempData::getFilesPriority(hash, fp);
@@ -1390,7 +1391,7 @@ void QBtSession::mergeTorrents(QTorrentHandle &h_ex, boost::intrusive_ptr<torren
bool urlseeds_added = false;
const QStringList old_urlseeds = h_ex.url_seeds();
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
std::vector<web_seed_entry> new_urlseeds = t->web_seeds();
std::vector<web_seed_entry>::iterator it = new_urlseeds.begin();
@@ -1460,7 +1461,7 @@ void QBtSession::exportTorrentFiles(QString path) {
// Set the maximum number of opened connections
void QBtSession::setMaxConnections(int maxConnec) {
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
Q_UNUSED(maxConnec);
Q_ASSERT(0); // Should not be used
#else
@@ -1559,7 +1560,7 @@ void QBtSession::loadSessionState() {
state_file.read(&in[0], content_size);
// bdecode
lazy_entry e;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
libtorrent::error_code ec;
lazy_bdecode(&in[0], &in[0] + in.size(), e, ec);
if (!ec) {
@@ -1598,7 +1599,7 @@ bool QBtSession::enableDHT(bool b) {
s->add_dht_router(std::make_pair(std::string("dht.aelitis.com"), 6881)); // Vuze
DHTEnabled = true;
qDebug("DHT enabled");
}catch(std::exception e) {
}catch(std::exception &e) {
qDebug("Could not enable DHT, reason: %s", e.what());
return false;
}
@@ -1649,13 +1650,13 @@ void QBtSession::saveTempFastResumeData() {
QTorrentHandle h = QTorrentHandle(*torrentIT);
try {
if (!h.is_valid() || !h.has_metadata() /*|| h.is_seed() || h.is_paused()*/) continue;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
if (!h.need_save_resume_data()) continue;
#endif
if (h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking || h.has_error()) continue;
qDebug("Saving fastresume data for %s", qPrintable(h.name()));
h.save_resume_data();
}catch(std::exception e) {}
}catch(std::exception &e) {}
}
}
@@ -1944,13 +1945,13 @@ void QBtSession::setListeningPort(int port) {
qDebug() << Q_FUNC_INFO << port;
Preferences pref;
std::pair<int,int> ports(port, port);
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
libtorrent::error_code ec;
#endif
const QString iface_name = pref.getNetworkInterface();
if (iface_name.isEmpty()) {
addConsoleMessage(tr("qBittorrent is trying to listen on any interface port: TCP/%1", "e.g: qBittorrent is trying to listen on any interface port: TCP/6881").arg(QString::number(port)), "blue");
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
s->listen_on(ports, ec, 0, session::listen_no_system_port);
#else
s->listen_on(ports);
@@ -1968,7 +1969,7 @@ void QBtSession::setListeningPort(int port) {
qDebug("This network interface has %d IP addresses", network_iface.addressEntries().size());
foreach (const QNetworkAddressEntry &entry, network_iface.addressEntries()) {
qDebug("Trying to listen on IP %s (%s)", qPrintable(entry.ip().toString()), qPrintable(iface_name));
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
s->listen_on(ports, ec, entry.ip().toString().toAscii().constData(), session::listen_no_system_port);
if (!ec) {
#else
@@ -1986,7 +1987,7 @@ void QBtSession::setListeningPort(int port) {
void QBtSession::setDownloadRateLimit(long rate) {
qDebug() << Q_FUNC_INFO << rate;
Q_ASSERT(rate == -1 || rate >= 0);
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
session_settings settings = s->settings();
settings.download_rate_limit = rate;
s->set_settings(settings);
@@ -2000,7 +2001,7 @@ void QBtSession::setDownloadRateLimit(long rate) {
void QBtSession::setUploadRateLimit(long rate) {
qDebug() << Q_FUNC_INFO << rate;
Q_ASSERT(rate == -1 || rate >= 0);
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
session_settings settings = s->settings();
settings.upload_rate_limit = rate;
s->set_settings(settings);
@@ -2108,7 +2109,7 @@ void QBtSession::setSessionSettings(const session_settings &sessionSettings) {
void QBtSession::setProxySettings(proxy_settings proxySettings) {
qDebug() << Q_FUNC_INFO;
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
proxySettings.proxy_peer_connections = Preferences().proxyPeerConnections();
s->set_proxy(proxySettings);
#else
@@ -2791,6 +2792,7 @@ void QBtSession::processDownloadedFile(QString url, QString file_path) {
h.pause();
emit newDownloadedTorrentFromRss(url);
}
fsutils::forceRemove(file_path);
}
// Return current download rate for the BT
@@ -2955,7 +2957,7 @@ void QBtSession::recoverPersistentData(const QString &hash, const std::vector<ch
return;
libtorrent::lazy_entry fast;
#if LIBTORRENT_VERSION_NUM < 001600
#if LIBTORRENT_VERSION_NUM < 1600
try {
libtorrent::lazy_bdecode(&(buf.front()), &(buf.back()), fast);
} catch (std::exception&) {

File diff suppressed because it is too large Load Diff

View File

@@ -175,7 +175,7 @@ void TorrentSpeedMonitor::getSamples()
std::vector<torrent_handle>::const_iterator itend = torrents.end();
for ( ; it != itend; ++it) {
try {
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
torrent_status st = it->status(0x0);
#else
torrent_status st = it->status();

View File

@@ -482,9 +482,6 @@ void AutomatedRssDownloader::handleFeedCheckStateChange(QListWidgetItem *feed_it
void AutomatedRssDownloader::updateMatchingArticles()
{
ui->treeMatchingArticles->clear();
if (ui->ruleDefBox->isEnabled()) {
saveEditedRule();
}
RssManagerPtr manager = m_manager.toStrongRef();
if (!manager)
return;

View File

@@ -629,6 +629,7 @@ void RSSImp::updateFeedIcon(const QString& url, const QString& iconPath)
{
QTreeWidgetItem* item = m_feedList->getTreeItemFromUrl(url);
item->setData(0, Qt::DecorationRole, QVariant(QIcon(iconPath)));
fsutils::forceRemove(iconPath);
}
void RSSImp::updateFeedInfos(const QString& url, const QString& display_name, uint nbUnread)

View File

@@ -106,7 +106,7 @@ QVariantHash RssDownloadRule::toVariantHash() const
return hash;
}
bool RssDownloadRule::operator==(const RssDownloadRule &other) {
bool RssDownloadRule::operator==(const RssDownloadRule &other) const {
return m_name == other.name();
}

View File

@@ -67,7 +67,7 @@ public:
inline void setUseRegex(bool enabled) { m_useRegex = enabled; }
QStringList findMatchingArticles(const RssFeedPtr& feed) const;
// Operators
bool operator==(const RssDownloadRule &other);
bool operator==(const RssDownloadRule &other) const;
private:
QString m_name;

View File

@@ -30,6 +30,7 @@
#include "rssparser.h"
#include "downloadthread.h"
#include "fs_utils.h"
#include <QDebug>
#include <QFile>
#include <QRegExp>
@@ -496,12 +497,13 @@ void RssParser::parseFeed(const ParsingJob& job)
}
// Clean up
QFile::remove(job.filePath);
fileRss.close();
emit feedParsingFinished(job.feedUrl, QString());
fsutils::forceRemove(job.filePath);
}
void RssParser::reportFailure(const ParsingJob& job, const QString& error)
{
QFile::remove(job.filePath);
emit feedParsingFinished(job.feedUrl, error);
fsutils::forceRemove(job.filePath);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

View File

@@ -1,69 +0,0 @@
#VERSION: 1.42
#AUTHORS: Christophe Dumez (chris@qbittorrent.org)
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the author nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from novaprinter import prettyPrinter
import re
from helpers import retrieve_url, download_file
class isohunt(object):
url = 'https://isohunt.to'
name = 'isoHunt'
supported_categories = {'all': '', 'movies': '1', 'tv': '3', 'music': '2', 'games': '4', 'anime': '7', 'software': '5', 'pictures': '6', 'books': '9'}
def download_torrent(self, info):
print download_file(info)
def search(self, what, cat='all'):
# Remove {} since isohunt does not seem
# to handle those very well
what = what.replace('{', '').replace('}', '')
i = 1
while True and i<11:
res = 0
dat = retrieve_url(self.url+'/torrents.php?ihq=%s&iht=%s&ihp=%s&ihs1=2&iho1=d'%(what, self.supported_categories[cat],i))
# I know it's not very readable, but the SGML parser feels in pain
section_re = re.compile('(?s)id=link.*?</tr><tr')
torrent_re = re.compile('(?s)torrent_details/(?P<link>.*?[^/]+).*?'
'>(?P<name>.*?)</a>.*?'
'>(?P<size>[\d,\.]+\s+MB)</td>.*?'
'>(?P<seeds>\d+)</td>.*?'
'>(?P<leech>\d+)</td>')
for match in section_re.finditer(dat):
txt = match.group(0)
m = torrent_re.search(txt)
if m:
torrent_infos = m.groupdict()
torrent_infos['name'] = re.sub('<.*?>', '', torrent_infos['name'])
torrent_infos['engine_url'] = self.url
torrent_code = torrent_infos['link']
torrent_infos['link'] = self.url + '/download/' + torrent_code
torrent_infos['desc_link'] = self.url + '/torrent_details/' + torrent_code + '/dvdrip?tab=summary'
prettyPrinter(torrent_infos)
res = res + 1
if res == 0:
break
i = i + 1

View File

@@ -1,4 +1,4 @@
#VERSION: 1.52
#VERSION: 1.53
#AUTHORS: Fabien Devaux (fab@gnux.info)
#CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org)
@@ -33,7 +33,7 @@ from helpers import retrieve_url, download_file
PREVIOUS_IDS = set()
class piratebay(object):
url = 'https://thepiratebay.sx'
url = 'https://thepiratebay.se'
name = 'The Pirate Bay'
supported_categories = {'all': '0', 'movies': '200', 'music': '100', 'games': '400', 'software': '300'}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

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