1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-09 18:32:15 +02:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Christophe Dumez
d09a3ddd0c Tagged v2.3.0rc5 release 2010-07-19 19:00:49 +00:00
160 changed files with 109753 additions and 19518 deletions

View File

@@ -12,7 +12,7 @@ Contributors:
* Silvan Scherrer <silvan.scherrer@aroa.ch>
Code from other projects:
* files src/qtsingleapp/* src/lineedit/*
* files src/qtsingleapp/*
copyright: Nokia Corporation
license: LGPL

View File

@@ -1,78 +1,4 @@
* 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
- FEATURE: Added button to password-lock the UI
- FEATURE: Added label-level Pause/Resume/Delete actions
- FEATURE: Torrents can now be filtered by name
- FEATURE: Run external program on torrent completion
- FEATURE: Detect executable updates in order to advise the user to restart
* Tue Jul 27 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
- FEATURE: Simplified torrent root folder renaming/truncating (< v2.3.0 is no longer forward compatible)
- FEATURE: Remember previous save paths in torrent addition dialog
- FEATURE: Max number of half-open connections can now be edited
@@ -89,12 +15,10 @@
- FEATURE: Torrents can be automatically paused once they reach a given ratio
- FEATURE: Several files can now be disabled at once
- FEATURE: Added "Select All/None" buttons to files list
- FEATURE: Added support for BitComet links (bc://bt/...)
- BUGFIX: Hide seeding torrents files priorities in Web UI
- BUGFIX: The user can disable permanently recursive torrent download
- BUGFIX: Peer Exchange status is now correctly reported
- BUGFIX: Use an INI file instead of the registry on Windows (More reliable)
- BUGFIX: Removed client spoofing feature to avoid tracker blacklisting
- COSMETIC: Display peers country name in tooltip
- COSMETIC: Display number of torrents in transfers tab label
- COSMETIC: Simplified program preferences

84
configure vendored
View File

@@ -18,24 +18,15 @@ Main options:
--help This help text.
Dependency options:
--disable-gui Disable qBittorrent
Graphical user interface for
headless running
--with-libboost-inc=[path] Path to libboost include
files
--with-libboost-lib=[path] Path to libboost library
files
--disable-libnotify Disable use of libnotify
--disable-geoip-database Disable use of geoip-database
--with-geoip-database-embedded Geoip Database will be
embedded in qBittorrent
executable (please follow
instructions in
src/geoip/README)
--disable-qtsingleapplication Disable use of libboost
--with-qtsingleapplication=[system|shipped] Use the shipped
qtsingleapplication library
or the system one
--disable-gui Disable qBittorrent Graphical user
interface for headless running
--with-libboost-inc=[path] Path to libboost include files
--with-libboost-lib=[path] Path to libboost library files
--disable-libnotify Disable use of libnotify
--disable-geoip-database Disable use of geoip-database
--with-geoip-database-embedded Geoip Database will be embedded in
qBittorrent executable (please follow
instructions in src/geoip/README)
EOT
}
@@ -182,16 +173,6 @@ while [ $# -gt 0 ]; do
shift
;;
--disable-qtsingleapplication)
QC_DISABLE_qtsingleapplication="Y"
shift
;;
--with-qtsingleapplication=*)
QC_WITH_QTSINGLEAPPLICATION=$optarg
shift
;;
--verbose)
QC_VERBOSE="Y"
shift
@@ -219,8 +200,6 @@ echo QC_WITH_LIBBOOST_LIB=$QC_WITH_LIBBOOST_LIB
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED
echo QC_DISABLE_qtsingleapplication=$QC_DISABLE_qtsingleapplication
echo QC_WITH_QTSINGLEAPPLICATION=$QC_WITH_QTSINGLEAPPLICATION
echo
fi
@@ -550,21 +529,10 @@ public:
} else {
return false;
}
QStringList incs3;
QString req_ver3 = "2.0";
QString version3, libs3, other3;
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
for(int n = 0; n < incs3.count(); ++n)
conf->addIncludePath(incs3[n]);
if(!libs3.isEmpty())
conf->addLib(libs3);
} else {
return false;
}
} else {
return false;
}
return true;
}
};
@@ -606,33 +574,6 @@ public:
#endif
}
};
#line 1 "qtsingleapplication.qcm"
/*
-----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;
}
};
EOT
cat >$1/modules_new.cpp <<EOT
@@ -654,9 +595,6 @@ cat >$1/modules_new.cpp <<EOT
o = new qc_geoip_database(conf);
o->required = false;
o->disabled = false;
o = new qc_qtsingleapplication(conf);
o->required = false;
o->disabled = false;
EOT
cat >$1/conf4.h <<EOT
@@ -1608,8 +1546,6 @@ export QC_WITH_LIBBOOST_LIB
export QC_DISABLE_libnotify
export QC_DISABLE_geoip_database
export QC_WITH_GEOIP_DATABASE_EMBEDDED
export QC_DISABLE_qtsingleapplication
export QC_WITH_QTSINGLEAPPLICATION
export QC_VERBOSE
rm -rf .qconftemp
(

View File

@@ -19,6 +19,4 @@
</dep>
<dep type='geoip-database'>
</dep>
<dep type='qtsingleapplication'>
</dep>
</qconf>

View File

@@ -40,21 +40,10 @@ public:
} else {
return false;
}
QStringList incs3;
QString req_ver3 = "2.0";
QString version3, libs3, other3;
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
for(int n = 0; n < incs3.count(); ++n)
conf->addIncludePath(incs3[n]);
if(!libs3.isEmpty())
conf->addLib(libs3);
} else {
return false;
}
} else {
return false;
}
return true;
}
};

View File

@@ -1,26 +0,0 @@
/*
-----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;
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -57,8 +57,6 @@ class about;
class createtorrent;
class downloadFromURL;
class HidableTabWidget;
class LineEdit;
class QFileSystemWatcher;
class GUI : public QMainWindow, private Ui::MainWindow{
Q_OBJECT
@@ -71,7 +69,6 @@ public:
QWidget* getCurrentTabWidget() const;
TransferListWidget* getTransferList() const { return transferList; }
QMenu* getTrayIconMenu();
PropertiesWidget *getProperties() const { return properties; }
public slots:
void trackerAuthenticationRequired(QTorrentHandle& h);
@@ -80,7 +77,6 @@ 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
@@ -101,10 +97,6 @@ protected slots:
void handleDownloadFromUrlFailure(QString, QString) const;
void createSystrayDelayed();
void tab_changed(int);
void on_actionLock_qBittorrent_triggered();
void defineUILockPassword();
bool unlockUI();
void notifyOfUpdate(QString);
// Keyboard shortcuts
void createKeyboardShortcuts();
void displayTransferTab() const;
@@ -138,7 +130,6 @@ protected:
void displaySearchTab(bool enable);
private:
QFileSystemWatcher *executable_watcher;
// Bittorrent
Bittorrent *BTSession;
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
@@ -159,8 +150,6 @@ private:
PropertiesWidget *properties;
bool displaySpeedInTitle;
bool force_exit;
bool ui_locked;
LineEdit *search_filter;
// Keyboard shortcuts
QShortcut *switchSearchShortcut;
QShortcut *switchSearchShortcut2;
@@ -171,7 +160,6 @@ private:
QAction *prioSeparator2;
QSplitter *hSplitter;
QSplitter *vSplitter;
QMenu *lockMenu;
// Search
QPointer<SearchEngine> searchEngine;
// RSS
@@ -182,7 +170,6 @@ private slots:
void on_actionRSS_Reader_triggered();
void on_actionSpeed_in_title_bar_triggered();
void on_actionTop_tool_bar_triggered();
void on_actionShutdown_when_downloads_complete_triggered();
};
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.4.8
Comment=V2.3.0
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[ar]=العميل Bittorrent

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -10,13 +10,13 @@
<string>torrent</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>qBitTorrentDocument</string>
<string>qbittorrentDocument</string>
<key>CFBundleTypeName</key>
<string>BitTorrent Document</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/x-bittorrent</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/x-bittorrent</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
@@ -47,7 +47,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>2.4.8</string>
<string>2.3.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>

View File

@@ -1,6 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>gpl.html</file>
</qresource>
</RCC>

File diff suppressed because it is too large Load Diff

View File

@@ -11,15 +11,15 @@
#include "preferences.h"
enum AdvSettingsCols {PROPERTY, VALUE};
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, PROGRAM_NOTIFICATIONS };
#define ROW_COUNT 13
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE };
#define ROW_COUNT 12
class AdvancedSettings: public QTableWidget {
Q_OBJECT
private:
QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh, *spin_maxhalfopen;
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding, *cb_program_notifications;
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding;
QComboBox *combo_iface;
public:
@@ -52,7 +52,6 @@ public:
delete spin_maxhalfopen;
delete cb_super_seeding;
delete combo_iface;
delete cb_program_notifications;
}
public slots:
@@ -86,8 +85,6 @@ public slots:
} else {
Preferences::setNetworkInterface(combo_iface->currentText());
}
// Program notification
Preferences::useProgramNotification(cb_program_notifications->isChecked());
}
protected slots:
@@ -178,7 +175,7 @@ protected slots:
setItem(NETWORK_IFACE, PROPERTY, new QTableWidgetItem(tr("Network Interface (requires restart)")));
combo_iface = new QComboBox;
combo_iface->addItem(tr("Any interface", "i.e. Any network interface"));
const QString current_iface = Preferences::getNetworkInterface();
const QString &current_iface = Preferences::getNetworkInterface();
int i = 1;
foreach(const QNetworkInterface& iface, QNetworkInterface::allInterfaces()) {
if(iface.name() == "lo") continue;
@@ -189,12 +186,6 @@ protected slots:
}
connect(combo_iface, SIGNAL(currentIndexChanged(int)), this, SLOT(emitSettingsChanged()));
setCellWidget(NETWORK_IFACE, VALUE, combo_iface);
// Program notifications
setItem(PROGRAM_NOTIFICATIONS, PROPERTY, new QTableWidgetItem(tr("Display program notification baloons")));
cb_program_notifications = new QCheckBox();
connect(cb_program_notifications, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
cb_program_notifications->setChecked(Preferences::useProgramNotification());
setCellWidget(PROGRAM_NOTIFICATIONS, VALUE, cb_program_notifications);
}
void emitSettingsChanged() {

File diff suppressed because it is too large Load Diff

View File

@@ -108,7 +108,6 @@ public:
session* getSession() const;
QHash<QString, TrackerInfos> getTrackersInfo(QString hash) const;
bool hasActiveTorrents() const;
bool hasDownloadingTorrents() const;
bool isQueueingEnabled() const;
int getMaximumActiveDownloads() const;
int getMaximumActiveTorrents() const;
@@ -200,9 +199,6 @@ protected slots:
void takeETASamples();
void exportTorrentFiles(QString path);
void saveTempFastResumeData();
void sendNotificationEmail(QTorrentHandle h);
void autoRunExternalProgram(QTorrentHandle h, bool async=true);
void cleanUpAutoRunProcess(int);
signals:
void addedTorrent(QTorrentHandle& h);

View File

@@ -50,7 +50,6 @@
#include "torrentpersistentdata.h"
#include "createtorrent_imp.h"
#include "misc.h"
#include "qinisettings.h"
using namespace libtorrent;
using namespace boost::filesystem;
@@ -81,11 +80,8 @@ createtorrent::~createtorrent() {
}
void createtorrent::on_addFolder_button_clicked(){
QIniSettings settings("qBittorrent", "qBittorrent");
QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString();
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), last_path, QFileDialog::ShowDirsOnly);
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly);
if(!dir.isEmpty()) {
settings.setValue("CreateTorrent/last_add_path", dir);
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
dir = dir.replace("/", "\\");
#endif
@@ -94,11 +90,8 @@ void createtorrent::on_addFolder_button_clicked(){
}
void createtorrent::on_addFile_button_clicked(){
QIniSettings settings("qBittorrent", "qBittorrent");
QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString();
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), last_path);
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath());
if(!file.isEmpty()) {
settings.setValue("CreateTorrent/last_add_path", misc::removeLastPathPart(file));
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
file = file.replace("/", "\\");
#endif
@@ -184,14 +177,13 @@ void createtorrent::on_createButton_clicked(){
return;
}
QStringList trackers = allItems(trackers_list);
QIniSettings settings("qBittorrent", "qBittorrent");
QString last_path = settings.value("CreateTorrent/last_save_path", QDir::homePath()).toString();
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), last_path, tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
/*if(!trackers.size()){
QMessageBox::critical(0, tr("No tracker path set"), tr("Please set at least one tracker"));
return;
}*/
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), QDir::homePath(), tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
if(!destination.isEmpty()) {
settings.setValue("CreateTorrent/last_save_path", misc::removeLastPathPart(destination));
if(!destination.toUpper().endsWith(".TORRENT"))
if(!destination.endsWith(QString::fromUtf8(".torrent")))
destination += QString::fromUtf8(".torrent");
} else {
return;
@@ -220,22 +212,16 @@ 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());
QString save_path = branch_path;
if(!root_folder.isEmpty()) {
save_path = QDir(save_path).absoluteFilePath(root_folder);
}
TorrentTempData::setSavePath(hash, save_path);
TorrentTempData::setSavePath(hash, branch_path);
#if LIBTORRENT_VERSION_MINOR > 14
// Enable seeding mode (do not recheck the files)
TorrentTempData::setSeedingMode(hash, true);
@@ -291,7 +277,8 @@ void torrentCreatorThread::run() {
char const* creator_str = "qBittorrent "VERSION;
try {
file_storage fs;
path full_path = complete(path(input_path.toUtf8().constData()));
file_pool fp;
path full_path = complete(path(input_path.toLocal8Bit().data()));
// Adding files to the torrent
add_files(fs, full_path, file_filter);
if(abort) return;
@@ -316,7 +303,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.toUtf8())), std::ios_base::binary);
ofstream out(complete(path((const char*)save_path.toLocal8Bit())), 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()));

View File

@@ -60,34 +60,31 @@ public:
pix.fill();
pixmap = pix;
} else {
const qulonglong nb_pieces = pieces.size();
const int nb_pieces = pieces.size();
// Reduce the number of pieces before creating the pixmap
// otherwise it can crash when there are too many pieces
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) {
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) {
bool have = true;
for(qulonglong j=i; j<qMin(i+ratio, nb_pieces); ++j) {
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
if(!pieces[i]) { have = false; break; }
}
scaled_pieces.push_back(have);
if(have) {
scaled_pieces.set_bit(scaled_index);
scaled_downloading.push_back(false);
} else {
bool downloading = false;
for(qulonglong j=i; j<qMin(i+ratio, nb_pieces); ++j) {
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
if(downloading_pieces[i]) { downloading = true; break; }
}
if(downloading)
scaled_downloading.set_bit(scaled_index);
scaled_downloading.push_back(downloading);
}
++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]) {
@@ -104,7 +101,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]) {

View File

@@ -51,7 +51,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
show();
// Paste clipboard if there is an URL in it
QString clip_txt = qApp->clipboard()->text();
if(clip_txt.startsWith("http://", Qt::CaseInsensitive) || clip_txt.startsWith("https://", Qt::CaseInsensitive) || clip_txt.startsWith("ftp://", Qt::CaseInsensitive) || clip_txt.startsWith("magnet:", Qt::CaseInsensitive) || clip_txt.startsWith("bc://bt/", Qt::CaseInsensitive)) {
if(clip_txt.startsWith("http://", Qt::CaseInsensitive) || clip_txt.startsWith("https://", Qt::CaseInsensitive) || clip_txt.startsWith("ftp://", Qt::CaseInsensitive) || clip_txt.startsWith("magnet:", Qt::CaseInsensitive)) {
textUrls->setText(clip_txt);
}
}

View File

@@ -101,7 +101,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
}
void downloadThread::loadCookies(const QString &host_name, QString url) {
const QList<QByteArray> raw_cookies = Preferences::getHostNameCookies(host_name);
const QList<QByteArray> &raw_cookies = Preferences::getHostNameCookies(host_name);
QNetworkCookieJar *cookie_jar = networkManager.cookieJar();
QList<QNetworkCookie> cookies;
qDebug("Loading cookies for host name: %s", qPrintable(host_name));
@@ -135,7 +135,7 @@ QNetworkReply* downloadThread::downloadUrl(QString url){
loadCookies(host_name, url);
// Process download request
qDebug("url is %s", qPrintable(url));
const QUrl qurl = QUrl::fromEncoded(url.toLocal8Bit());
const QUrl &qurl = QUrl::fromEncoded(url.toLocal8Bit());
QNetworkRequest request(qurl);
// Spoof Firefox 3.5 user agent to avoid
// Web server banning

View File

@@ -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/branches/v2_4_x/src/search_engine/engines/"
#define UPDATE_URL "http://qbittorrent.svn.sourceforge.net/viewvc/qbittorrent/trunk/src/search_engine/engines/"
engineSelectDlg::engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines) : QDialog(parent), supported_engines(supported_engines) {
setupUi(this);
@@ -81,11 +81,7 @@ void engineSelectDlg::dropEvent(QDropEvent *event) {
QString file;
foreach(file, files) {
qDebug("dropped %s", qPrintable(file));
#ifdef Q_WS_WIN
file = file.replace("file:///", "");
#else
file = file.replace("file://", "");
#endif
if(file.startsWith("http://", Qt::CaseInsensitive) || file.startsWith("https://", Qt::CaseInsensitive) || file.startsWith("ftp://", Qt::CaseInsensitive)) {
setCursor(QCursor(Qt::WaitCursor));
downloader->downloadUrl(file);
@@ -269,8 +265,7 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
if(QFile::exists(dest_path)) {
// Backup in case install fails
QFile::copy(dest_path, dest_path+".bak");
misc::safeRemove(dest_path);
misc::safeRemove(dest_path+"c");
QFile::remove(dest_path);
update = true;
}
// Copy the plugin
@@ -281,22 +276,22 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
if(!supported_engines->contains(plugin_name)) {
if(update) {
// Remove broken file
misc::safeRemove(dest_path);
QFile::remove(dest_path);
// restore backup
QFile::copy(dest_path+".bak", dest_path);
misc::safeRemove(dest_path+".bak");
QFile::remove(dest_path+".bak");
QMessageBox::warning(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin could not be updated, keeping old version.", "%1 is the name of the search engine").arg(plugin_name));
return;
} else {
// Remove broken file
misc::safeRemove(dest_path);
QFile::remove(dest_path);
QMessageBox::warning(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin could not be installed.", "%1 is the name of the search engine").arg(plugin_name));
return;
}
}
// Install was successful, remove backup
if(update) {
misc::safeRemove(dest_path+".bak");
QFile::remove(dest_path+".bak");
}
if(update) {
QMessageBox::information(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin was successfully updated.", "%1 is the name of the search engine").arg(plugin_name));
@@ -414,7 +409,7 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
// Close file
versions.close();
// Clean up tmp file
misc::safeRemove(versions_file);
QFile::remove(versions_file);
if(file_correct && !updated) {
QMessageBox::information(this, tr("Search plugin update")+" -- "+tr("qBittorrent"), tr("All your plugins are already up to date."));
}
@@ -444,21 +439,21 @@ void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
}
}
// Delete tmp file
misc::safeRemove(filePath);
QFile::remove(filePath);
return;
}
if(url.endsWith("versions.txt")) {
if(!parseVersionsFile(filePath)) {
QMessageBox::warning(this, tr("Search plugin update")+" -- "+tr("qBittorrent"), tr("Sorry, update server is temporarily unavailable."));
}
misc::safeRemove(filePath);
QFile::remove(filePath);
return;
}
if(url.endsWith(".py", Qt::CaseInsensitive)) {
QString plugin_name = url.split('/').last();
plugin_name.replace(".py", "");
installPlugin(filePath, plugin_name);
misc::safeRemove(filePath);
QFile::remove(filePath);
return;
}
}

View File

@@ -38,7 +38,6 @@
//#include "proplistdelegate.h"
#include "torrentpersistentdata.h"
#include <QDebug>
#include <QTranslator>
EventManager::EventManager(QObject *parent, Bittorrent *BTSession)
: QObject(parent), BTSession(BTSession)
@@ -125,20 +124,8 @@ QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
void EventManager::setGlobalPreferences(QVariantMap m) const {
// UI
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);
}
if(m.contains("locale"))
Preferences::setLocale(m["locale"].toString());
// Downloads
if(m.contains("save_path"))
Preferences::setSavePath(m["save_path"].toString());
@@ -176,16 +163,6 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
}
if(m.contains("export_dir"))
Preferences::setExportDir(m["export_dir"].toString());
if(m.contains("mail_notification_enabled"))
Preferences::setMailNotificationEnabled(m["mail_notification_enabled"].toBool());
if(m.contains("mail_notification_email"))
Preferences::setMailNotificationEmail(m["mail_notification_email"].toString());
if(m.contains("mail_notification_smtp"))
Preferences::setMailNotificationSMTP(m["mail_notification_smtp"].toString());
if(m.contains("autorun_enabled"))
Preferences::setAutoRunEnabled(m["autorun_enabled"].toBool());
if(m.contains("autorun_program"))
Preferences::setAutoRunProgram(m["autorun_program"].toString());
if(m.contains("preallocate_all"))
Preferences::preAllocateAllFiles(m["preallocate_all"].toBool());
if(m.contains("queueing_enabled"))
@@ -231,6 +208,12 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
Preferences::setLSDEnabled(m["lsd"].toBool());
if(m.contains("encryption"))
Preferences::setEncryptionSetting(m["encryption"].toInt());
if(m.contains("peer_id"))
Preferences::setPeerID(m["peer_id"].toString());
if(m.contains("peer_version"))
Preferences::setClientVersion(m["peer_version"].toString());
if(m.contains("peer_build"))
Preferences::setClientBuild(m["peer_build"].toString());
// Proxy
if(m.contains("proxy_type"))
Preferences::setPeerProxyType(m["proxy_type"].toInt());
@@ -288,11 +271,6 @@ QVariantMap EventManager::getGlobalPreferences() const {
data["download_in_scan_dirs"] = var_list;
data["export_dir_enabled"] = Preferences::isTorrentExportEnabled();
data["export_dir"] = Preferences::getExportDir();
data["mail_notification_enabled"] = Preferences::isMailNotificationEnabled();
data["mail_notification_email"] = Preferences::getMailNotificationEmail();
data["mail_notification_smtp"] = Preferences::getMailNotificationSMTP();
data["autorun_enabled"] = Preferences::isAutoRunEnabled();
data["autorun_program"] = Preferences::getAutoRunProgram();
data["preallocate_all"] = Preferences::preAllocateAllFiles();
data["queueing_enabled"] = Preferences::isQueueingSystemEnabled();
data["max_active_downloads"] = Preferences::getMaxActiveDownloads();
@@ -317,6 +295,9 @@ QVariantMap EventManager::getGlobalPreferences() const {
data["pex"] = Preferences::isPeXEnabled();
data["lsd"] = Preferences::isLSDEnabled();
data["encryption"] = Preferences::getEncryptionSetting();
data["peer_id"] = Preferences::getPeerID();
data["peer_version"] = Preferences::getClientVersion();
data["peer_build"] = Preferences::getClientBuild();
// Proxy
data["proxy_type"] = Preferences::getPeerProxyType();
data["proxy_ip"] = Preferences::getPeerProxyIp();

View File

@@ -105,7 +105,7 @@ public:
QStringList getNotMatchingTokens() const {
QString notmatching = this->value("not", "").toString();
return notmatching.split(QRegExp("[\\s|]"));
return notmatching.split(" ");
}
QString getNotMatchingTokens_str() const {

View File

@@ -201,14 +201,9 @@ signals:
private:
void addTorrentsFromDir(const QDir &dir, QStringList &torrents) {
const QStringList files = dir.entryList(filters, QDir::Files, QDir::Unsorted);
foreach(const QString &file, files) {
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
torrents << dir.absoluteFilePath(file).replace("/", "\\");
#else
torrents << dir.absoluteFilePath(file);
#endif
}
const QStringList &files = dir.entryList(filters, QDir::Files, QDir::Unsorted);
foreach(const QString &file, files)
torrents << dir.canonicalPath() + '/' + file;
}
};

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