Commit 83ac9f98 authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 2.9.5

parent 544ac4d5
...@@ -74,6 +74,7 @@ Translations authors: ...@@ -74,6 +74,7 @@ Translations authors:
copyright: copyright:
- Arabic: SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com) - Arabic: SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com)
- Armenian: Hrant Ohanyan (hrantohanyan@mail.am) - Armenian: Hrant Ohanyan (hrantohanyan@mail.am)
- Belarusian: Mihas Varantsou (meequz@gmail.com)
- Brazilian: Nick Marinho (nickmarinho@gmail.com) - Brazilian: Nick Marinho (nickmarinho@gmail.com)
- Bulgarian: Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net) - Bulgarian: Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)
- Catalan: Francisco Luque Contreras (frannoe@ya.com) - Catalan: Francisco Luque Contreras (frannoe@ya.com)
......
* 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
- 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+Del removes torrents on Mac OS X (Closes #928852)
- BUGFIX: Fix potential bug when moving single file torrents to tmp folder (closes #932861)
- BUGFIX: Fix torrent import dialog layout (Closes #930932)
- BUGFIX: Prevent log window buffer from filling up (Closes #929673)
- I18N: Add Belarusian translation
* Thu Dec 29 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.3 * Thu Dec 29 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.3
- BUGFIX: Fix btdigg plugin (Python3 support + torrent name in magnet links) - BUGFIX: Fix btdigg plugin (Python3 support + torrent name in magnet links)
- BUGFIX: Fix banning of IPv6 peers (Closes #885021) - BUGFIX: Fix banning of IPv6 peers (Closes #885021)
......
...@@ -9,7 +9,8 @@ dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/ && ...@@ -9,7 +9,8 @@ dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/ &&
dist.commands += git clone . ../$${PROJECT_NAME}-$${PROJECT_VERSION} && dist.commands += git clone . ../$${PROJECT_NAME}-$${PROJECT_VERSION} &&
dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.git && dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.git &&
dist.commands += rm -f ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.gitignore && dist.commands += rm -f ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.gitignore &&
dist.commands += tar zcpvf ../$${PROJECT_NAME}-$${PROJECT_VERSION}.tar.gz ../$${PROJECT_NAME}-$${PROJECT_VERSION} && dist.commands += cd .. &&
dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION} dist.commands += tar czf $${PROJECT_NAME}-$${PROJECT_VERSION}.tar.gz $${PROJECT_NAME}-$${PROJECT_VERSION} &&
dist.commands += rm -fR $${PROJECT_NAME}-$${PROJECT_VERSION}
QMAKE_EXTRA_TARGETS += dist QMAKE_EXTRA_TARGETS += dist
...@@ -47,7 +47,7 @@ ...@@ -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.3</string> <string>2.9.5</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
......
...@@ -64,6 +64,7 @@ class about : public QDialog, private Ui::AboutDlg{ ...@@ -64,6 +64,7 @@ class about : public QDialog, private Ui::AboutDlg{
QString trans_txt = "<p>"+tr("I would like to thank the following people who volunteered to translate qBittorrent:")+"</p>"; QString trans_txt = "<p>"+tr("I would like to thank the following people who volunteered to translate qBittorrent:")+"</p>";
trans_txt += QString::fromUtf8("<ul><li><u>Arabic:</u> SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com)</li>\ trans_txt += QString::fromUtf8("<ul><li><u>Arabic:</u> SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com)</li>\
<li><u>Armenian:</u> Hrant Ohanyan (hrantohanyan@mail.am)</li>\ <li><u>Armenian:</u> Hrant Ohanyan (hrantohanyan@mail.am)</li>\
<li><u>Belarusian:</u> Mihas Varantsou (meequz@gmail.com)</li>\
<li><u>Brazilian:</u> Nick Marinho (nickmarinho@gmail.com)</li>\ <li><u>Brazilian:</u> Nick Marinho (nickmarinho@gmail.com)</li>\
<li><u>Bulgarian:</u> Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)</li>\ <li><u>Bulgarian:</u> Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)</li>\
<li><u>Catalan:</u> Francisco Luque Contreras (frannoe@ya.com)</li>\ <li><u>Catalan:</u> Francisco Luque Contreras (frannoe@ya.com)</li>\
......
...@@ -66,9 +66,14 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) { ...@@ -66,9 +66,14 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
const QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); const QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if(redirection.isValid()) { if(redirection.isValid()) {
// We should redirect // We should redirect
qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(redirection.toUrl().toString())); QUrl newUrl = redirection.toUrl();
m_redirectMapping.insert(redirection.toUrl().toString(), url); // Resolve relative urls
downloadUrl(redirection.toUrl().toString()); if (newUrl.isRelative())
newUrl = reply->url().resolved(newUrl);
const QString newUrlString = newUrl.toString();
qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(newUrlString));
m_redirectMapping.insert(newUrlString, url);
downloadUrl(newUrlString);
reply->deleteLater(); reply->deleteLater();
return; return;
} }
......
...@@ -34,5 +34,6 @@ ...@@ -34,5 +34,6 @@
<file>lang/qbittorrent_hr.qm</file> <file>lang/qbittorrent_hr.qm</file>
<file>lang/qbittorrent_ro.qm</file> <file>lang/qbittorrent_ro.qm</file>
<file>lang/qbittorrent_ka.qm</file> <file>lang/qbittorrent_ka.qm</file>
<file>lang/qbittorrent_be.qm</file>
</qresource> </qresource>
</RCC> </RCC>
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -64,7 +64,7 @@ void LogListWidget::keyPressEvent(QKeyEvent *event) ...@@ -64,7 +64,7 @@ void LogListWidget::keyPressEvent(QKeyEvent *event)
void LogListWidget::appendLine(const QString &line) void LogListWidget::appendLine(const QString &line)
{ {
QListWidgetItem *item = new QListWidgetItem(this); QListWidgetItem *item = new QListWidgetItem;
// We need to use QLabel here to support rich text // We need to use QLabel here to support rich text
QLabel *lbl = new QLabel(line); QLabel *lbl = new QLabel(line);
lbl->setContentsMargins(4, 2, 4, 2); lbl->setContentsMargins(4, 2, 4, 2);
......
...@@ -196,6 +196,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo ...@@ -196,6 +196,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
connect(actionIncreasePriority, SIGNAL(triggered()), transferList, SLOT(increasePrioSelectedTorrents())); connect(actionIncreasePriority, SIGNAL(triggered()), transferList, SLOT(increasePrioSelectedTorrents()));
connect(actionDecreasePriority, SIGNAL(triggered()), transferList, SLOT(decreasePrioSelectedTorrents())); connect(actionDecreasePriority, SIGNAL(triggered()), transferList, SLOT(decreasePrioSelectedTorrents()));
connect(actionToggleVisibility, SIGNAL(triggered()), this, SLOT(toggleVisibility())); connect(actionToggleVisibility, SIGNAL(triggered()), this, SLOT(toggleVisibility()));
connect(actionMinimize, SIGNAL(triggered()), SLOT(minimizeWindow()));
m_pwr = new PowerManagement(this); m_pwr = new PowerManagement(this);
preventTimer = new QTimer(this); preventTimer = new QTimer(this);
...@@ -542,13 +543,21 @@ void MainWindow::createKeyboardShortcuts() { ...@@ -542,13 +543,21 @@ void MainWindow::createKeyboardShortcuts() {
connect(switchRSSShortcut, SIGNAL(activated()), this, SLOT(displayRSSTab())); connect(switchRSSShortcut, SIGNAL(activated()), this, SLOT(displayRSSTab()));
actionDocumentation->setShortcut(QKeySequence("F1")); actionDocumentation->setShortcut(QKeySequence("F1"));
actionOptions->setShortcut(QKeySequence(QString::fromUtf8("Alt+O"))); actionOptions->setShortcut(QKeySequence(QString::fromUtf8("Alt+O")));
#ifdef Q_WS_MAC
actionDelete->setShortcut(QKeySequence("Ctrl+Backspace"));
#else
actionDelete->setShortcut(QKeySequence(QString::fromUtf8("Del"))); actionDelete->setShortcut(QKeySequence(QString::fromUtf8("Del")));
#endif
actionStart->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+S"))); actionStart->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+S")));
actionStart_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+S"))); actionStart_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+S")));
actionPause->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+P"))); actionPause->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+P")));
actionPause_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+P"))); actionPause_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+P")));
actionDecreasePriority->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+-"))); actionDecreasePriority->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+-")));
actionIncreasePriority->setShortcut(QKeySequence(QString::fromUtf8("Ctrl++"))); actionIncreasePriority->setShortcut(QKeySequence(QString::fromUtf8("Ctrl++")));
#ifdef Q_WS_MAC
actionMinimize->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+M")));
addAction(actionMinimize);
#endif
} }
// Keyboard shortcuts slots // Keyboard shortcuts slots
...@@ -1332,6 +1341,11 @@ void MainWindow::showConnectionSettings() ...@@ -1332,6 +1341,11 @@ void MainWindow::showConnectionSettings()
options->showConnectionTab(); options->showConnectionTab();
} }
void MainWindow::minimizeWindow()
{
setWindowState(windowState() ^ Qt::WindowMinimized);
}
void MainWindow::on_actionExecution_Logs_triggered(bool checked) void MainWindow::on_actionExecution_Logs_triggered(bool checked)
{ {
if(checked) { if(checked) {
......
...@@ -110,6 +110,7 @@ protected slots: ...@@ -110,6 +110,7 @@ protected slots:
bool unlockUI(); bool unlockUI();
void notifyOfUpdate(QString); void notifyOfUpdate(QString);
void showConnectionSettings(); void showConnectionSettings();
void minimizeWindow();
// Keyboard shortcuts // Keyboard shortcuts
void createKeyboardShortcuts(); void createKeyboardShortcuts();
void displayTransferTab() const; void displayTransferTab() const;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>914</width> <width>914</width>
<height>25</height> <height>22</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_Edit"> <widget class="QMenu" name="menu_Edit">
...@@ -370,6 +370,11 @@ ...@@ -370,6 +370,11 @@
<string>Show</string> <string>Show</string>
</property> </property>
</action> </action>
<action name="actionMinimize">
<property name="text">
<string notr="true">Minimize</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="icons.qrc"/> <include location="icons.qrc"/>
......
...@@ -80,10 +80,6 @@ public: ...@@ -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: ...@@ -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;
......
...@@ -1271,6 +1271,7 @@ QString options_imp::languageToLocalizedString(QLocale::Language language, const ...@@ -1271,6 +1271,7 @@ QString options_imp::languageToLocalizedString(QLocale::Language language, const
case QLocale::Japanese: return QString::fromUtf8("日本語"); case QLocale::Japanese: return QString::fromUtf8("日本語");
case QLocale::Arabic: return QString::fromUtf8("عربي"); case QLocale::Arabic: return QString::fromUtf8("عربي");
case QLocale::Georgian: return QString::fromUtf8("ქართული"); case QLocale::Georgian: return QString::fromUtf8("ქართული");
case QLocale::Byelorussian: return QString::fromUtf8("Беларуская");
case QLocale::Chinese: { case QLocale::Chinese: {
if(country == "cn") if(country == "cn")
return QString::fromUtf8("中文 (简体)"); return QString::fromUtf8("中文 (简体)");
......
...@@ -900,7 +900,7 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed) { ...@@ -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 ...@@ -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 ...@@ -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) {
......
...@@ -670,7 +670,9 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const { ...@@ -670,7 +670,9 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const {
bool was_seed = is_seed(); bool was_seed = is_seed();
vector<size_type> progress; vector<size_type> progress;
file_progress(progress); file_progress(progress);
qDebug() << Q_FUNC_INFO << "Changing files priorities...";
torrent_handle::prioritize_files(files); torrent_handle::prioritize_files(files);
qDebug() << Q_FUNC_INFO << "Moving unwanted files to .unwanted folder...";
for(uint i=0; i<files.size(); ++i) { for(uint i=0; i<files.size(); ++i) {
// Move unwanted files to a .unwanted subfolder // Move unwanted files to a .unwanted subfolder
if(files[i] == 0 && progress[i] < filesize_at(i)) { if(files[i] == 0 && progress[i] < filesize_at(i)) {
...@@ -706,19 +708,25 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const { ...@@ -706,19 +708,25 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const {
} }
} }
// Move wanted files back to their original folder // Move wanted files back to their original folder
qDebug() << Q_FUNC_INFO << "Moving wanted files back from .unwanted folder";
if(files[i] > 0) { if(files[i] > 0) {
QString old_path = filepath_at(i); QString parent_relpath = misc::branchPath(filepath_at(i));
QString old_name = filename_at(i); if(QDir(parent_relpath).dirName() == ".unwanted") {
QDir parent_path(misc::branchPath(old_path)); QString old_name = filename_at(i);
if(parent_path.dirName() == ".unwanted") { QString new_relpath = misc::branchPath(parent_relpath);
QDir new_path(misc::branchPath(parent_path.path())); if (new_relpath.isEmpty())
rename_file(i, new_path.filePath(old_name)); rename_file(i, old_name);
else
rename_file(i, QDir(new_relpath).filePath(old_name));
// Remove .unwanted directory if empty // Remove .unwanted directory if empty
new_path.rmdir(".unwanted"); qDebug() << "Attempting to remove .unwanted folder at " << QDir(save_path() + QDir::separator() + new_relpath).absoluteFilePath(".unwanted");
QDir(save_path() + QDir::separator() + new_relpath).rmdir(".unwanted");
} }
} }
} }
if(was_seed && !is_seed()) { if(was_seed && !is_seed()) {
qDebug() << "Torrent is no longer SEEDING";
// Save seed status // Save seed status
TorrentPersistentData::saveSeedStatus(*this); TorrentPersistentData::saveSeedStatus(*this);
// Move to temp folder if necessary // Move to temp folder if necessary
...@@ -728,6 +736,7 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const { ...@@ -728,6 +736,7 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const {
QString root_folder = TorrentPersistentData::getRootFolder(hash()); QString root_folder = TorrentPersistentData::getRootFolder(hash());
if(!root_folder.isEmpty()) if(!root_folder.isEmpty())
tmp_path = QDir(tmp_path).absoluteFilePath(root_folder); tmp_path = QDir(tmp_path).absoluteFilePath(root_folder);
qDebug() << "tmp folder is enabled, move torrent to " << tmp_path << " from " << save_path();
move_storage(tmp_path); move_storage(tmp_path);
} }
} }
......
...@@ -471,8 +471,7 @@ void AutomatedRssDownloader::updateMatchingArticles() ...@@ -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() ...@@ -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
......
This diff is collapsed.
...@@ -48,7 +48,8 @@ public: ...@@ -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: ...@@ -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: ...@@ -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;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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