Commit b8941bd2 authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 2.4.6

parent 9b831dd2
* 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
......
/*
-----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;
}
};
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.4.5
Comment=V2.4.6
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[ar]=العميل Bittorrent
......
This diff was suppressed by a .gitattributes entry.
......@@ -47,7 +47,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>2.4.5</string>
<string>2.4.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
......
......@@ -864,7 +864,7 @@ 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() && !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("\\", "/");
......@@ -913,10 +913,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());
......@@ -1116,7 +1116,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
} else {
savePath = getSavePath(hash, fromScanDir, path, root_folder);
}
if(!defaultTempPath.isEmpty() && !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()) {
......@@ -1172,7 +1172,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()) {
......@@ -1180,7 +1180,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());
......
......@@ -220,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);
......@@ -285,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;
......@@ -311,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()));
......
......@@ -629,6 +629,10 @@ void QTorrentHandle::move_storage(QString new_path) const {
Q_ASSERT(h.is_valid());
if(QDir(save_path()) == QDir(new_path)) return;
TorrentPersistentData::setPreviousSavePath(hash(), save_path());
// Create destination directory if necessary
// or move_storage() will fail...
QDir().mkpath(new_path);
// Actually move the storage
h.move_storage(new_path.toLocal8Bit().constData());
}
......
......@@ -12,13 +12,13 @@ CONFIG += qt \
# Update this VERSION for each release
os2 {
DEFINES += VERSION=\'\"v2.4.5\"\'
DEFINES += VERSION=\'\"v2.4.6\"\'
} else {
DEFINES += VERSION=\\\"v2.4.5\\\"
DEFINES += VERSION=\\\"v2.4.6\\\"
}
DEFINES += VERSION_MAJOR=2
DEFINES += VERSION_MINOR=4
DEFINES += VERSION_BUGFIX=5
DEFINES += VERSION_BUGFIX=6
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
DEFINES += VERSION_TYPE=NORMAL
......
......@@ -1486,7 +1486,9 @@ void TransferListWidget::applyStatusFilter(int f) {
statusFilterModel->setFilterRegExp(QRegExp());
}
// Select first item if nothing is selected
if(selectionModel()->selectedRows(0).empty() && statusFilterModel->rowCount() > 0)
selectionModel()->setCurrentIndex(statusFilterModel->index(0, TR_NAME), QItemSelectionModel::SelectCurrent|QItemSelectionModel::Rows);
if(selectionModel()->selectedRows(0).empty() && nameFilterModel->rowCount() > 0) {
qDebug("Nothing is selected, selecting first row: %s", qPrintable(nameFilterModel->index(0, TR_NAME).data().toString()));
selectionModel()->setCurrentIndex(nameFilterModel->index(0, TR_NAME), QItemSelectionModel::SelectCurrent|QItemSelectionModel::Rows);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment