diff -Nru qbittorrent-1.5.4/Changelog qbittorrent-1.5.5/Changelog --- qbittorrent-1.5.4/Changelog 2009-10-25 00:07:35.000000000 +0100 +++ qbittorrent-1.5.5/Changelog 2009-11-04 17:50:13.000000000 +0000 @@ -1,3 +1,11 @@ +* Wed Nov 4 2009 - Christophe Dumez - v1.5.5 + - BUGFIX: Fixed man page + - BUGFIX: Fix crash on torrent addition (if libtorrent-rasterbar has debug enabled) + - BUGFIX: Fix trackers addition to torrents (bug introduced in v1.5.4) + - BUGFIX: Suppress compilation warning regarding sortNewsList() not being used + - BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion + - BUGFIX: Added safety mecanism which adds the torrents back to the list in case qbittorrent-resume.conf gets deleted or corrupted. + * Sun Oct 25 2009 - Christophe Dumez - v1.5.4 - BUGFIX: Updated man page - BUGFIX: Fixed possible crash with torrents containing unicode characters diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/debian/changelog /tmp/sgLIgXOqIt/qbittorrent-1.5.5/debian/changelog --- qbittorrent-1.5.4/debian/changelog 2009-11-15 04:12:09.000000000 +0000 +++ qbittorrent-1.5.5/debian/changelog 2009-11-15 04:12:10.000000000 +0000 @@ -1,8 +1,21 @@ -qbittorrent (1.5.4-1~karmic~ppa1) karmic; urgency=low +qbittorrent (1.5.5-2~karmic~ppa1) karmic; urgency=low * Backport to Karmic -- No Source Changes - -- Micah Gersten Tue, 03 Nov 2009 22:59:33 -0600 + -- Micah Gersten Sat, 14 Nov 2009 21:54:56 -0600 + +qbittorrent (1.5.5-2) unstable; urgency=low + + * debian/control: adding DM-Upload-Allowed, thanks to my sponsor + Michal Čihař. + + -- Cristian Greco Mon, 09 Nov 2009 12:28:01 +0100 + +qbittorrent (1.5.5-1) unstable; urgency=low + + * New upstream version. + + -- Cristian Greco Fri, 06 Nov 2009 18:30:46 +0100 qbittorrent (1.5.4-1) unstable; urgency=low diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/debian/control /tmp/sgLIgXOqIt/qbittorrent-1.5.5/debian/control --- qbittorrent-1.5.4/debian/control 2009-11-15 04:12:09.000000000 +0000 +++ qbittorrent-1.5.5/debian/control 2009-11-15 04:12:10.000000000 +0000 @@ -12,6 +12,7 @@ Vcs-Git: git://git.debian.org/git/collab-maint/qbittorrent.git Vcs-Browser: http://git.debian.org/?p=collab-maint/qbittorrent.git Homepage: http://www.qbittorrent.org/ +DM-Upload-Allowed: yes Package: qbittorrent Architecture: any diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/doc/qbittorrent.1 /tmp/sgLIgXOqIt/qbittorrent-1.5.5/doc/qbittorrent.1 --- qbittorrent-1.5.4/doc/qbittorrent.1 2009-09-30 22:07:21.000000000 +0100 +++ qbittorrent-1.5.5/doc/qbittorrent.1 2009-10-30 12:16:48.000000000 +0000 @@ -8,7 +8,7 @@ .SH "SYNOPSIS" -\fBqbittorrent\fR [--no-splash] [TORRENT_FILE | URL]... +\fBqbittorrent\fR [\-\-no-splash] [TORRENT_FILE | URL]... \fBqbittorrent\fR \-\-help diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/INSTALL /tmp/sgLIgXOqIt/qbittorrent-1.5.5/INSTALL --- qbittorrent-1.5.4/INSTALL 2009-09-03 12:39:30.000000000 +0100 +++ qbittorrent-1.5.5/INSTALL 2009-11-04 17:15:43.000000000 +0000 @@ -1,12 +1,6 @@ qBittorrent - A BitTorrent client in C++ / Qt4 ------------------------------------------ -*** Necessary if qt3 is default on your system *** -export QTDIR=/usr/include/qt4 -export PATH=$QTDIR/bin:$PATH -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib -*** End *** - ./configure make && make install qbittorrent @@ -28,9 +22,6 @@ - python >= 2.3 (needed by search engine) -- libmagick++ (advised, not required) - * Needed for favicons support (RSS / Search plugins) - - libzzip (advised, not required) * Needed for zip support (Search plugins) diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/src/bittorrent.cpp /tmp/sgLIgXOqIt/qbittorrent-1.5.5/src/bittorrent.cpp --- qbittorrent-1.5.4/src/bittorrent.cpp 2009-09-30 19:40:13.000000000 +0100 +++ qbittorrent-1.5.5/src/bittorrent.cpp 2009-11-04 17:50:13.000000000 +0000 @@ -856,7 +856,8 @@ qDebug("Setting file piority to %d", priority); v.push_back(priority); } - h.prioritize_files(v); + if(v.size() == (unsigned int)h.num_files()) + h.prioritize_files(v); } float bittorrent::getRealRatio(QString hash) const{ @@ -981,6 +982,12 @@ FSMutex->lock(); qDebug("Scanning directory: %s", scan_dir.toLocal8Bit().data()); QDir dir(scan_dir); + QDir torrentBackup(misc::qBittorrentPath() + "BT_backup"); + // Check that scan dir is not BT_backup (silly but who knows...) + if(dir == torrentBackup) { + std::cerr << "Scan directory cannot be qBittorrent backup folder!" << std::endl; + return; + } QStringList filters; filters << "*.torrent"; QStringList files = dir.entryList(filters, QDir::Files, QDir::Unsorted); @@ -1520,14 +1527,31 @@ // backup directory void bittorrent::startUpTorrents() { qDebug("Resuming unfinished torrents"); + QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QDir torrentBackup(misc::qBittorrentPath() + "BT_backup"); QStringList fileNames; QStringList known_torrents = TorrentPersistentData::knownTorrents(); - if(known_torrents.empty()) { + + if(known_torrents.empty() && !settings.value("v1_4_x_torrent_imported", false).toBool()) { qDebug("No known torrent, importing old torrents"); importOldTorrents(); return; } + + // Safety measure because some people reported torrent loss since + // we switch the v1.5 way of resuming torrents on startup + QStringList filters; + filters << "*.torrent"; + QStringList torrents_on_hd = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted); + foreach(QString hash, torrents_on_hd) { + hash.chop(8); // remove trailing .torrent + if(!known_torrents.contains(hash)) { + std::cerr << "ERROR Detected!!! Adding back torrent " << hash.toLocal8Bit().data() << " which got lost for some reason." << std::endl; + addTorrent(torrentBackup.path()+QDir::separator()+hash+".torrent", false, QString(), true); + } + } + // End of safety measure + qDebug("Starting up torrents"); if(isQueueingEnabled()) { QList > hashes; @@ -1688,79 +1712,78 @@ // TODO: Remove in qBittorrent v1.6.0 void bittorrent::importOldTorrents() { QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); - if(!settings.value("v1_4_x_torrent_imported", false).toBool()) { - // Import old torrent - QDir torrentBackup(misc::qBittorrentPath() + "BT_backup"); - QStringList fileNames; - QStringList filters; - filters << "*.torrent"; - fileNames = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted); - if(isQueueingEnabled()) { - QList > filePaths; - foreach(const QString &fileName, fileNames) { - QString filePath = torrentBackup.path()+QDir::separator()+fileName; - int prio = 99999; - // Get priority - QString prioPath = filePath; - prioPath.replace(".torrent", ".prio"); - if(QFile::exists(prioPath)) { - QFile prio_file(prioPath); - if(prio_file.open(QIODevice::ReadOnly | QIODevice::Text)) { - bool ok = false; - prio = prio_file.readAll().toInt(&ok); - if(!ok) - prio = 99999; - prio_file.close(); - } + Q_ASSERT(!settings.value("v1_4_x_torrent_imported", false).toBool()); + // Import old torrent + QDir torrentBackup(misc::qBittorrentPath() + "BT_backup"); + QStringList fileNames; + QStringList filters; + filters << "*.torrent"; + fileNames = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted); + if(isQueueingEnabled()) { + QList > filePaths; + foreach(const QString &fileName, fileNames) { + QString filePath = torrentBackup.path()+QDir::separator()+fileName; + int prio = 99999; + // Get priority + QString prioPath = filePath; + prioPath.replace(".torrent", ".prio"); + if(QFile::exists(prioPath)) { + QFile prio_file(prioPath); + if(prio_file.open(QIODevice::ReadOnly | QIODevice::Text)) { + bool ok = false; + prio = prio_file.readAll().toInt(&ok); + if(!ok) + prio = 99999; + prio_file.close(); } - misc::insertSort2(filePaths, qMakePair(prio, filePath)); } - // Resume downloads - QPair fileName; - foreach(fileName, filePaths) { - importOldTempData(fileName.second); - QTorrentHandle h = addTorrent(fileName.second, false, QString(), true); - // Sequential download - if(TorrentTempData::hasTempData(h.hash())) { - qDebug("addTorrent: Setting download as sequential (from tmp data)"); - h.set_sequential_download(TorrentTempData::isSequential(h.hash())); - } - applyFormerAttributeFiles(h); - QString savePath = TorrentTempData::getSavePath(h.hash()); - // Save persistent data for new torrent - TorrentPersistentData::saveTorrentPersistentData(h); - // Save save_path - if(!defaultTempPath.isEmpty() && !savePath.isNull()) { - qDebug("addTorrent: Saving save_path in persistent data: %s", savePath.toLocal8Bit().data()); - TorrentPersistentData::saveSavePath(h.hash(), savePath); - } + misc::insertSort2(filePaths, qMakePair(prio, filePath)); + } + // Resume downloads + QPair fileName; + foreach(fileName, filePaths) { + importOldTempData(fileName.second); + QTorrentHandle h = addTorrent(fileName.second, false, QString(), true); + // Sequential download + if(TorrentTempData::hasTempData(h.hash())) { + qDebug("addTorrent: Setting download as sequential (from tmp data)"); + h.set_sequential_download(TorrentTempData::isSequential(h.hash())); + } + applyFormerAttributeFiles(h); + QString savePath = TorrentTempData::getSavePath(h.hash()); + // Save persistent data for new torrent + TorrentPersistentData::saveTorrentPersistentData(h); + // Save save_path + if(!defaultTempPath.isEmpty() && !savePath.isNull()) { + qDebug("addTorrent: Saving save_path in persistent data: %s", savePath.toLocal8Bit().data()); + TorrentPersistentData::saveSavePath(h.hash(), savePath); } - } else { - QStringList filePaths; - foreach(const QString &fileName, fileNames) { - filePaths.append(torrentBackup.path()+QDir::separator()+fileName); - } - // Resume downloads - foreach(const QString &fileName, filePaths) { - importOldTempData(fileName); - QTorrentHandle h = addTorrent(fileName, false, QString(), true); - // Sequential download - if(TorrentTempData::hasTempData(h.hash())) { - qDebug("addTorrent: Setting download as sequential (from tmp data)"); - h.set_sequential_download(TorrentTempData::isSequential(h.hash())); - } - applyFormerAttributeFiles(h); - QString savePath = TorrentTempData::getSavePath(h.hash()); - // Save persistent data for new torrent - TorrentPersistentData::saveTorrentPersistentData(h); - // Save save_path - if(!defaultTempPath.isEmpty() && !savePath.isNull()) { - qDebug("addTorrent: Saving save_path in persistent data: %s", savePath.toLocal8Bit().data()); - TorrentPersistentData::saveSavePath(h.hash(), savePath); - } + } + } else { + QStringList filePaths; + foreach(const QString &fileName, fileNames) { + filePaths.append(torrentBackup.path()+QDir::separator()+fileName); + } + // Resume downloads + foreach(const QString &fileName, filePaths) { + importOldTempData(fileName); + QTorrentHandle h = addTorrent(fileName, false, QString(), true); + // Sequential download + if(TorrentTempData::hasTempData(h.hash())) { + qDebug("addTorrent: Setting download as sequential (from tmp data)"); + h.set_sequential_download(TorrentTempData::isSequential(h.hash())); + } + applyFormerAttributeFiles(h); + QString savePath = TorrentTempData::getSavePath(h.hash()); + // Save persistent data for new torrent + TorrentPersistentData::saveTorrentPersistentData(h); + // Save save_path + if(!defaultTempPath.isEmpty() && !savePath.isNull()) { + qDebug("addTorrent: Saving save_path in persistent data: %s", savePath.toLocal8Bit().data()); + TorrentPersistentData::saveSavePath(h.hash(), savePath); } } - settings.setValue("v1_4_x_torrent_imported", true); - std::cout << "Successfully imported torrents from v1.4.x (or previous) instance" << std::endl; } + settings.setValue("v1_4_x_torrent_imported", true); + std::cout << "Successfully imported torrents from v1.4.x (or previous) instance" << std::endl; } diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/src/Icons/qBittorrent.desktop /tmp/sgLIgXOqIt/qbittorrent-1.5.5/src/Icons/qBittorrent.desktop --- qbittorrent-1.5.4/src/Icons/qBittorrent.desktop 2009-10-25 00:07:35.000000000 +0100 +++ qbittorrent-1.5.5/src/Icons/qBittorrent.desktop 2009-10-30 15:19:52.000000000 +0000 @@ -1,6 +1,6 @@ [Desktop Entry] Categories=Qt;Network;P2P; -Comment=V1.5.4 +Comment=V1.5.5 Exec=qbittorrent %f GenericName=Bittorrent client GenericName[bg]=Торент клиент Binary files /tmp/yHw0VnYIgK/qbittorrent-1.5.4/src/Icons/skin/splash.png and /tmp/sgLIgXOqIt/qbittorrent-1.5.5/src/Icons/skin/splash.png differ diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/src/qtorrenthandle.cpp /tmp/sgLIgXOqIt/qbittorrent-1.5.5/src/qtorrenthandle.cpp --- qbittorrent-1.5.4/src/qtorrenthandle.cpp 2009-10-15 21:03:45.000000000 +0100 +++ qbittorrent-1.5.5/src/qtorrenthandle.cpp 2009-11-01 14:11:28.000000000 +0000 @@ -163,11 +163,6 @@ return misc::toQString(h.save_path().string()); } -fs::path QTorrentHandle::save_path_boost() const { - Q_ASSERT(h.is_valid()); - return h.save_path(); -} - QStringList QTorrentHandle::url_seeds() const { Q_ASSERT(h.is_valid()); QStringList res; @@ -234,9 +229,9 @@ return h.get_torrent_info().file_at(index).size; } -std::vector const& QTorrentHandle::trackers() const { +std::vector QTorrentHandle::trackers() const { Q_ASSERT(h.is_valid()); - return h.get_torrent_info().trackers(); + return h.trackers(); } torrent_status::state_t QTorrentHandle::state() const { diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/src/qtorrenthandle.h /tmp/sgLIgXOqIt/qbittorrent-1.5.5/src/qtorrenthandle.h --- qbittorrent-1.5.4/src/qtorrenthandle.h 2009-09-03 12:39:30.000000000 +0100 +++ qbittorrent-1.5.5/src/qtorrenthandle.h 2009-11-01 14:11:28.000000000 +0000 @@ -81,7 +81,6 @@ int num_incomplete() const; void scrape_tracker() const; QString save_path() const; - fs::path save_path_boost() const; QStringList url_seeds() const; size_type actual_size() const; int download_limit() const; @@ -93,7 +92,7 @@ bool is_queued() const; QString file_at(unsigned int index) const; size_type filesize_at(unsigned int index) const; - std::vector const& trackers() const; + std::vector trackers() const; torrent_status::state_t state() const; QString creator() const; QString comment() const; diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/src/rss.cpp /tmp/sgLIgXOqIt/qbittorrent-1.5.5/src/rss.cpp --- qbittorrent-1.5.4/src/rss.cpp 2009-09-03 12:39:30.000000000 +0100 +++ qbittorrent-1.5.5/src/rss.cpp 2009-10-30 15:19:52.000000000 +0000 @@ -604,7 +604,7 @@ unsigned int max_articles = settings.value(QString::fromUtf8("Preferences/RSS/RSSMaxArticlesPerFeed"), 100).toInt(); unsigned int nb_articles = this->size(); if(nb_articles > max_articles) { - QList listItem = sortNewsList(this->values()); + QList listItem = RssManager::sortNewsList(this->values()); int excess = nb_articles - max_articles; for(int i=0; i &list, RssItem *item) { + int i = 0; + while(i < list.size() && item->getDate() < list.at(i)->getDate()) { + ++i; + } + list.insert(i, item); + } + + static QList sortNewsList(QList news_list) { + QList new_list; + foreach(RssItem *item, news_list) { + insertSortElem(new_list, item); + } + return new_list; + } }; -static void insertSortElem(QList &list, RssItem *item) { - int i = 0; - while(i < list.size() && item->getDate() < list.at(i)->getDate()) { - ++i; - } - list.insert(i, item); -} -static QList sortNewsList(QList news_list) { - QList new_list; - foreach(RssItem *item, news_list) { - insertSortElem(new_list, item); - } - return new_list; -} + #endif diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/src/rss_imp.cpp /tmp/sgLIgXOqIt/qbittorrent-1.5.5/src/rss_imp.cpp --- qbittorrent-1.5.4/src/rss_imp.cpp 2009-09-03 12:39:30.000000000 +0100 +++ qbittorrent-1.5.5/src/rss_imp.cpp 2009-10-30 15:19:52.000000000 +0000 @@ -431,9 +431,9 @@ qDebug("Getting the list of news"); QList news; if(rss_item == rssmanager) - news = sortNewsList(rss_item->getUnreadNewsList()); + news = RssManager::sortNewsList(rss_item->getUnreadNewsList()); else - news = sortNewsList(rss_item->getNewsList()); + news = RssManager::sortNewsList(rss_item->getNewsList()); // Clear the list first textBrowser->clear(); previous_news = 0; diff -Nru /tmp/yHw0VnYIgK/qbittorrent-1.5.4/src/src.pro /tmp/sgLIgXOqIt/qbittorrent-1.5.5/src/src.pro --- qbittorrent-1.5.4/src/src.pro 2009-10-25 00:07:35.000000000 +0100 +++ qbittorrent-1.5.5/src/src.pro 2009-10-30 15:19:52.000000000 +0000 @@ -14,10 +14,10 @@ network # Update this VERSION for each release -DEFINES += VERSION=\\\"v1.5.4\\\" +DEFINES += VERSION=\\\"v1.5.5\\\" DEFINES += VERSION_MAJOR=1 DEFINES += VERSION_MINOR=5 -DEFINES += VERSION_BUGFIX=4 +DEFINES += VERSION_BUGFIX=5 !mac:QMAKE_LFLAGS += -Wl,--as-needed contains(DEBUG_MODE, 1) { CONFIG += debug