mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 05:08:05 -06:00
Compare commits
7 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eda04b3ef3 | ||
|
|
3ef6e7bf65 | ||
|
|
146cf9a435 | ||
|
|
dff6b057b9 | ||
|
|
3b7448dfc7 | ||
|
|
4e4ac771a9 | ||
|
|
06a376d014 |
@@ -1,3 +1,10 @@
|
|||||||
|
* Sat Feb 18 2012 - Christophe Dumez <chris@qbittorrent.org> - v2.9.5
|
||||||
|
- BUGFIX: Fix crash when disabling then reenabling RSS
|
||||||
|
- BUGFIX: Fix duplicate torrent detection when adding a magnet link
|
||||||
|
- BUGFIX: Fix import of new trackers when adding a torrent with same hash (Closes #747000)
|
||||||
|
- BUGFIX: Fix possible redownload of torrents marked as read (Closes #927495)
|
||||||
|
- BUGFIX: Properly remove RSS feed settings/history upon feed removal
|
||||||
|
|
||||||
* Sat Feb 18 2012 - Christophe Dumez <chris@qbittorrent.org> - v2.9.4
|
* Sat Feb 18 2012 - Christophe Dumez <chris@qbittorrent.org> - v2.9.4
|
||||||
- BUGFIX: qBittorrent does not handle redirection to relative URLs correctly (Closes #919905)
|
- BUGFIX: qBittorrent does not handle redirection to relative URLs correctly (Closes #919905)
|
||||||
- BUGFIX: Cmd+M minimizes main window on Mac OS X (Closes #928216)
|
- BUGFIX: Cmd+M minimizes main window on Mac OS X (Closes #928216)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>2.9.4</string>
|
<string>2.9.5</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
|
|||||||
@@ -80,10 +80,6 @@ public:
|
|||||||
return QString(o.str().c_str());
|
return QString(o.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline libtorrent::sha1_hash toSha1Hash(const QString &hash) {
|
|
||||||
return libtorrent::sha1_hash(hash.toAscii().constData());
|
|
||||||
}
|
|
||||||
|
|
||||||
static void chmod644(const QDir& folder);
|
static void chmod644(const QDir& folder);
|
||||||
|
|
||||||
static inline QString removeLastPathPart(QString path) {
|
static inline QString removeLastPathPart(QString path) {
|
||||||
@@ -95,7 +91,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline libtorrent::sha1_hash QStringToSha1(const QString& s) {
|
static inline libtorrent::sha1_hash QStringToSha1(const QString& s) {
|
||||||
std::string str(s.toLocal8Bit().data());
|
std::string str(s.toAscii().data());
|
||||||
std::istringstream i(str);
|
std::istringstream i(str);
|
||||||
libtorrent::sha1_hash x;
|
libtorrent::sha1_hash x;
|
||||||
i>>x;
|
i>>x;
|
||||||
|
|||||||
@@ -900,7 +900,7 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed) {
|
|||||||
Q_ASSERT(magnet_uri.startsWith("magnet:", Qt::CaseInsensitive));
|
Q_ASSERT(magnet_uri.startsWith("magnet:", Qt::CaseInsensitive));
|
||||||
|
|
||||||
// Check for duplicate torrent
|
// Check for duplicate torrent
|
||||||
if(s->find_torrent(misc::toSha1Hash(hash)).is_valid()) {
|
if(s->find_torrent(misc::QStringToSha1(hash)).is_valid()) {
|
||||||
qDebug("/!\\ Torrent is already in download list");
|
qDebug("/!\\ Torrent is already in download list");
|
||||||
addConsoleMessage(tr("'%1' is already in download list.", "e.g: 'xxx.avi' is already in download list.").arg(magnet_uri));
|
addConsoleMessage(tr("'%1' is already in download list.", "e.g: 'xxx.avi' is already in download list.").arg(magnet_uri));
|
||||||
return h;
|
return h;
|
||||||
@@ -1316,35 +1316,37 @@ void QBtSession::mergeTorrents(QTorrentHandle &h_ex, boost::intrusive_ptr<torren
|
|||||||
// Check if the torrent contains trackers or url seeds we don't know about
|
// Check if the torrent contains trackers or url seeds we don't know about
|
||||||
// and add them
|
// and add them
|
||||||
if(!h_ex.is_valid()) return;
|
if(!h_ex.is_valid()) return;
|
||||||
std::vector<announce_entry> old_trackers = h_ex.trackers();
|
std::vector<announce_entry> existing_trackers = h_ex.trackers();
|
||||||
std::vector<announce_entry> new_trackers = t->trackers();
|
std::vector<announce_entry> new_trackers = t->trackers();
|
||||||
bool trackers_added = false;
|
bool trackers_added = false;
|
||||||
for(std::vector<announce_entry>::iterator it=new_trackers.begin();it!=new_trackers.end();it++) {
|
foreach (const announce_entry& new_tracker, new_trackers) {
|
||||||
std::string tracker_url = it->url;
|
std::string new_tracker_url = new_tracker.url;
|
||||||
|
// Check if existing torrent has this tracker
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for(std::vector<announce_entry>::iterator itold=old_trackers.begin();itold!=old_trackers.end();itold++) {
|
foreach (const announce_entry& existing_tracker, existing_trackers) {
|
||||||
if(tracker_url == itold->url) {
|
if(QUrl(new_tracker_url.c_str()) == QUrl(existing_tracker.url.c_str())) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(found) {
|
|
||||||
|
if (!found) {
|
||||||
|
h_ex.add_tracker(announce_entry(new_tracker_url));
|
||||||
trackers_added = true;
|
trackers_added = true;
|
||||||
announce_entry entry(tracker_url);
|
|
||||||
h_ex.add_tracker(entry);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(trackers_added) {
|
|
||||||
|
if (trackers_added)
|
||||||
addConsoleMessage(tr("Note: new trackers were added to the existing torrent."));
|
addConsoleMessage(tr("Note: new trackers were added to the existing torrent."));
|
||||||
}
|
|
||||||
bool urlseeds_added = false;
|
bool urlseeds_added = false;
|
||||||
const QStringList old_urlseeds = h_ex.url_seeds();
|
const QStringList old_urlseeds = h_ex.url_seeds();
|
||||||
#if LIBTORRENT_VERSION_MINOR > 15
|
#if LIBTORRENT_VERSION_MINOR > 15
|
||||||
std::vector<web_seed_entry> new_urlseeds = t->web_seeds();
|
std::vector<web_seed_entry> new_urlseeds = t->web_seeds();
|
||||||
std::vector<web_seed_entry>::iterator it;
|
std::vector<web_seed_entry>::iterator it;
|
||||||
for(it = new_urlseeds.begin(); it != new_urlseeds.end(); it++) {
|
for (it = new_urlseeds.begin(); it != new_urlseeds.end(); it++) {
|
||||||
const QString new_url = misc::toQString(it->url.c_str());
|
const QString new_url = misc::toQString(it->url.c_str());
|
||||||
if(!old_urlseeds.contains(new_url)) {
|
if (!old_urlseeds.contains(new_url)) {
|
||||||
urlseeds_added = true;
|
urlseeds_added = true;
|
||||||
h_ex.add_url_seed(new_url);
|
h_ex.add_url_seed(new_url);
|
||||||
}
|
}
|
||||||
@@ -1352,17 +1354,16 @@ void QBtSession::mergeTorrents(QTorrentHandle &h_ex, boost::intrusive_ptr<torren
|
|||||||
#else
|
#else
|
||||||
std::vector<std::string> new_urlseeds = t->url_seeds();
|
std::vector<std::string> new_urlseeds = t->url_seeds();
|
||||||
std::vector<std::string>::iterator it;
|
std::vector<std::string>::iterator it;
|
||||||
for(it = new_urlseeds.begin(); it != new_urlseeds.end(); it++) {
|
for (it = new_urlseeds.begin(); it != new_urlseeds.end(); it++) {
|
||||||
const QString new_url = misc::toQString(it->c_str());
|
const QString new_url = misc::toQString(it->c_str());
|
||||||
if(!old_urlseeds.contains(new_url)) {
|
if (!old_urlseeds.contains(new_url)) {
|
||||||
urlseeds_added = true;
|
urlseeds_added = true;
|
||||||
h_ex.add_url_seed(new_url);
|
h_ex.add_url_seed(new_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(urlseeds_added) {
|
if(urlseeds_added)
|
||||||
addConsoleMessage(tr("Note: new URL seeds were added to the existing torrent."));
|
addConsoleMessage(tr("Note: new URL seeds were added to the existing torrent."));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QBtSession::exportTorrentFiles(QString path) {
|
void QBtSession::exportTorrentFiles(QString path) {
|
||||||
|
|||||||
@@ -471,8 +471,7 @@ void AutomatedRssDownloader::updateMatchingArticles()
|
|||||||
if(!rule.isValid()) continue;
|
if(!rule.isValid()) continue;
|
||||||
foreach(const QString &feed_url, rule.rssFeeds()) {
|
foreach(const QString &feed_url, rule.rssFeeds()) {
|
||||||
qDebug() << Q_FUNC_INFO << feed_url;
|
qDebug() << Q_FUNC_INFO << feed_url;
|
||||||
Q_ASSERT(all_feeds.contains(feed_url));
|
if(!all_feeds.contains(feed_url)) continue; // Feed was removed
|
||||||
if(!all_feeds.contains(feed_url)) continue;
|
|
||||||
const RssFeed *feed = all_feeds.value(feed_url);
|
const RssFeed *feed = all_feeds.value(feed_url);
|
||||||
Q_ASSERT(feed);
|
Q_ASSERT(feed);
|
||||||
if(!feed) continue;
|
if(!feed) continue;
|
||||||
|
|||||||
@@ -51,8 +51,10 @@ RssDownloadRuleList* RssDownloadRuleList::instance()
|
|||||||
|
|
||||||
void RssDownloadRuleList::drop()
|
void RssDownloadRuleList::drop()
|
||||||
{
|
{
|
||||||
if(m_instance)
|
if(m_instance) {
|
||||||
delete m_instance;
|
delete m_instance;
|
||||||
|
m_instance = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RssDownloadRule RssDownloadRuleList::findMatchingRule(const QString &feed_url, const QString &article_title) const
|
RssDownloadRule RssDownloadRuleList::findMatchingRule(const QString &feed_url, const QString &article_title) const
|
||||||
|
|||||||
@@ -55,15 +55,14 @@ RssFeed::RssFeed(RssFolder* parent, const QString &url): m_parent(parent), m_ico
|
|||||||
}
|
}
|
||||||
|
|
||||||
RssFeed::~RssFeed(){
|
RssFeed::~RssFeed(){
|
||||||
// Saving current articles to hard disk
|
|
||||||
if(m_refreshed) {
|
|
||||||
saveItemsToDisk();
|
|
||||||
}
|
|
||||||
if(!m_icon.startsWith(":/") && QFile::exists(m_icon))
|
if(!m_icon.startsWith(":/") && QFile::exists(m_icon))
|
||||||
misc::safeRemove(m_icon);
|
misc::safeRemove(m_icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RssFeed::saveItemsToDisk() {
|
void RssFeed::saveItemsToDisk() {
|
||||||
|
qDebug() << Q_FUNC_INFO << m_url;
|
||||||
|
if (!m_refreshed)
|
||||||
|
return;
|
||||||
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
||||||
QVariantList old_items;
|
QVariantList old_items;
|
||||||
foreach(const RssArticle &item, m_articles.values()) {
|
foreach(const RssArticle &item, m_articles.values()) {
|
||||||
@@ -105,6 +104,7 @@ void RssFeed::refresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RssFeed::removeAllSettings() {
|
void RssFeed::removeAllSettings() {
|
||||||
|
qDebug() << "Removing all settings / history for feed: " << m_url;
|
||||||
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
||||||
QHash<QString, QVariant> feeds_w_downloader = qBTRSS.value("downloader_on", QHash<QString, QVariant>()).toHash();
|
QHash<QString, QVariant> feeds_w_downloader = qBTRSS.value("downloader_on", QHash<QString, QVariant>()).toHash();
|
||||||
if (feeds_w_downloader.contains(m_url)) {
|
if (feeds_w_downloader.contains(m_url)) {
|
||||||
@@ -283,13 +283,13 @@ bool RssFeed::parseRSS(QIODevice* device) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure we limit the number of articles
|
||||||
|
resizeList();
|
||||||
|
|
||||||
// RSS Feed Downloader
|
// RSS Feed Downloader
|
||||||
if(RssSettings().isRssDownloadingEnabled())
|
if(RssSettings().isRssDownloadingEnabled())
|
||||||
downloadMatchingArticleTorrents();
|
downloadMatchingArticleTorrents();
|
||||||
|
|
||||||
// Make sure we limit the number of articles
|
|
||||||
resizeList();
|
|
||||||
|
|
||||||
// Save items to disk (for safety)
|
// Save items to disk (for safety)
|
||||||
saveItemsToDisk();
|
saveItemsToDisk();
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ public:
|
|||||||
FileType type() const;
|
FileType type() const;
|
||||||
void refresh();
|
void refresh();
|
||||||
QString id() const { return m_url; }
|
QString id() const { return m_url; }
|
||||||
void removeAllSettings();
|
virtual void removeAllSettings();
|
||||||
|
virtual void saveItemsToDisk();
|
||||||
bool itemAlreadyExists(const QString &hash) const;
|
bool itemAlreadyExists(const QString &hash) const;
|
||||||
void setLoading(bool val);
|
void setLoading(bool val);
|
||||||
bool isLoading() const;
|
bool isLoading() const;
|
||||||
@@ -77,7 +78,6 @@ private:
|
|||||||
bool parseXmlFile(const QString &file_path);
|
bool parseXmlFile(const QString &file_path);
|
||||||
void downloadMatchingArticleTorrents();
|
void downloadMatchingArticleTorrents();
|
||||||
QString iconUrl() const;
|
QString iconUrl() const;
|
||||||
void saveItemsToDisk();
|
|
||||||
void loadItemsFromDisk();
|
void loadItemsFromDisk();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public:
|
|||||||
virtual void setParent(RssFolder* parent) = 0;
|
virtual void setParent(RssFolder* parent) = 0;
|
||||||
virtual void refresh() = 0;
|
virtual void refresh() = 0;
|
||||||
virtual void removeAllSettings() = 0;
|
virtual void removeAllSettings() = 0;
|
||||||
|
virtual void saveItemsToDisk() = 0;
|
||||||
virtual const QList<RssArticle> articleList() const = 0;
|
virtual const QList<RssArticle> articleList() const = 0;
|
||||||
virtual const QList<RssArticle> unreadArticleList() const = 0;
|
virtual const QList<RssArticle> unreadArticleList() const = 0;
|
||||||
QStringList pathHierarchy() const;
|
QStringList pathHierarchy() const;
|
||||||
|
|||||||
@@ -196,6 +196,13 @@ void RssFolder::removeAllSettings() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RssFolder::saveItemsToDisk()
|
||||||
|
{
|
||||||
|
foreach(IRssFile* child, m_children.values()) {
|
||||||
|
child->saveItemsToDisk();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QString RssFolder::id() const {
|
QString RssFolder::id() const {
|
||||||
return m_name;
|
return m_name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ public:
|
|||||||
bool hasChild(const QString &childId);
|
bool hasChild(const QString &childId);
|
||||||
const QList<RssArticle> articleList() const;
|
const QList<RssArticle> articleList() const;
|
||||||
const QList<RssArticle> unreadArticleList() const;
|
const QList<RssArticle> unreadArticleList() const;
|
||||||
void removeAllSettings();
|
virtual void removeAllSettings();
|
||||||
|
virtual void saveItemsToDisk();
|
||||||
void removeAllItems();
|
void removeAllItems();
|
||||||
void renameChildFolder(const QString &old_name, const QString &new_name);
|
void renameChildFolder(const QString &old_name, const QString &new_name);
|
||||||
IRssFile *takeChild(const QString &childId);
|
IRssFile *takeChild(const QString &childId);
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ RssManager::~RssManager(){
|
|||||||
m_refreshTimer.stop();
|
m_refreshTimer.stop();
|
||||||
delete m_rssDownloader;
|
delete m_rssDownloader;
|
||||||
RssDownloadRuleList::drop();
|
RssDownloadRuleList::drop();
|
||||||
|
saveItemsToDisk();
|
||||||
saveStreamList();
|
saveStreamList();
|
||||||
qDebug("RSSManager deleted");
|
qDebug("RSSManager deleted");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
PROJECT_NAME = qbittorrent
|
PROJECT_NAME = qbittorrent
|
||||||
PROJECT_VERSION = 2.9.4
|
PROJECT_VERSION = 2.9.5
|
||||||
|
|
||||||
os2 {
|
os2 {
|
||||||
DEFINES += VERSION=\'\"v$${PROJECT_VERSION}\"\'
|
DEFINES += VERSION=\'\"v$${PROJECT_VERSION}\"\'
|
||||||
@@ -9,4 +9,4 @@ os2 {
|
|||||||
|
|
||||||
DEFINES += VERSION_MAJOR=2
|
DEFINES += VERSION_MAJOR=2
|
||||||
DEFINES += VERSION_MINOR=9
|
DEFINES += VERSION_MINOR=9
|
||||||
DEFINES += VERSION_BUGFIX=4
|
DEFINES += VERSION_BUGFIX=5
|
||||||
|
|||||||
Reference in New Issue
Block a user