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

Imported Upstream version 2.9.5

parent 544ac4d5
......@@ -74,6 +74,7 @@ Translations authors:
copyright:
- Arabic: SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com)
- Armenian: Hrant Ohanyan (hrantohanyan@mail.am)
- Belarusian: Mihas Varantsou (meequz@gmail.com)
- Brazilian: Nick Marinho (nickmarinho@gmail.com)
- Bulgarian: Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)
- 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
- BUGFIX: Fix btdigg plugin (Python3 support + torrent name in magnet links)
- BUGFIX: Fix banning of IPv6 peers (Closes #885021)
......
......@@ -9,7 +9,8 @@ dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/ &&
dist.commands += git clone . ../$${PROJECT_NAME}-$${PROJECT_VERSION} &&
dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.git &&
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 += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}
dist.commands += cd .. &&
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
......@@ -47,7 +47,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>2.9.3</string>
<string>2.9.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
......
......@@ -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>";
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>Belarusian:</u> Mihas Varantsou (meequz@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>Catalan:</u> Francisco Luque Contreras (frannoe@ya.com)</li>\
......
......@@ -66,9 +66,14 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
const QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if(redirection.isValid()) {
// We should redirect
qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(redirection.toUrl().toString()));
m_redirectMapping.insert(redirection.toUrl().toString(), url);
downloadUrl(redirection.toUrl().toString());
QUrl newUrl = redirection.toUrl();
// Resolve relative urls
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();
return;
}
......
......@@ -34,5 +34,6 @@
<file>lang/qbittorrent_hr.qm</file>
<file>lang/qbittorrent_ro.qm</file>
<file>lang/qbittorrent_ka.qm</file>
<file>lang/qbittorrent_be.qm</file>
</qresource>
</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)
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
QLabel *lbl = new QLabel(line);
lbl->setContentsMargins(4, 2, 4, 2);
......
......@@ -196,6 +196,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
connect(actionIncreasePriority, SIGNAL(triggered()), transferList, SLOT(increasePrioSelectedTorrents()));
connect(actionDecreasePriority, SIGNAL(triggered()), transferList, SLOT(decreasePrioSelectedTorrents()));
connect(actionToggleVisibility, SIGNAL(triggered()), this, SLOT(toggleVisibility()));
connect(actionMinimize, SIGNAL(triggered()), SLOT(minimizeWindow()));
m_pwr = new PowerManagement(this);
preventTimer = new QTimer(this);
......@@ -542,13 +543,21 @@ void MainWindow::createKeyboardShortcuts() {
connect(switchRSSShortcut, SIGNAL(activated()), this, SLOT(displayRSSTab()));
actionDocumentation->setShortcut(QKeySequence("F1"));
actionOptions->setShortcut(QKeySequence(QString::fromUtf8("Alt+O")));
#ifdef Q_WS_MAC
actionDelete->setShortcut(QKeySequence("Ctrl+Backspace"));
#else
actionDelete->setShortcut(QKeySequence(QString::fromUtf8("Del")));
#endif
actionStart->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+S")));
actionStart_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+S")));
actionPause->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+P")));
actionPause_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+P")));
actionDecreasePriority->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
......@@ -1332,6 +1341,11 @@ void MainWindow::showConnectionSettings()
options->showConnectionTab();
}
void MainWindow::minimizeWindow()
{
setWindowState(windowState() ^ Qt::WindowMinimized);
}
void MainWindow::on_actionExecution_Logs_triggered(bool checked)
{
if(checked) {
......
......@@ -110,6 +110,7 @@ protected slots:
bool unlockUI();
void notifyOfUpdate(QString);
void showConnectionSettings();
void minimizeWindow();
// Keyboard shortcuts
void createKeyboardShortcuts();
void displayTransferTab() const;
......
......@@ -29,7 +29,7 @@
<x>0</x>
<y>0</y>
<width>914</width>
<height>25</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menu_Edit">
......@@ -370,6 +370,11 @@
<string>Show</string>
</property>
</action>
<action name="actionMinimize">
<property name="text">
<string notr="true">Minimize</string>
</property>
</action>
</widget>
<resources>
<include location="icons.qrc"/>
......
......@@ -80,10 +80,6 @@ public:
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 inline QString removeLastPathPart(QString path) {
......@@ -95,7 +91,7 @@ public:
}
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);
libtorrent::sha1_hash x;
i>>x;
......
......@@ -1271,6 +1271,7 @@ QString options_imp::languageToLocalizedString(QLocale::Language language, const
case QLocale::Japanese: return QString::fromUtf8("日本語");
case QLocale::Arabic: return QString::fromUtf8("عربي");
case QLocale::Georgian: return QString::fromUtf8("ქართული");
case QLocale::Byelorussian: return QString::fromUtf8("Беларуская");
case QLocale::Chinese: {
if(country == "cn")
return QString::fromUtf8("中文 (简体)");
......
......@@ -900,7 +900,7 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed) {
Q_ASSERT(magnet_uri.startsWith("magnet:", Qt::CaseInsensitive));
// 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");
addConsoleMessage(tr("'%1' is already in download list.", "e.g: 'xxx.avi' is already in download list.").arg(magnet_uri));
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
// and add them
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();
bool trackers_added = false;
for(std::vector<announce_entry>::iterator it=new_trackers.begin();it!=new_trackers.end();it++) {
std::string tracker_url = it->url;
foreach (const announce_entry& new_tracker, new_trackers) {
std::string new_tracker_url = new_tracker.url;
// Check if existing torrent has this tracker
bool found = false;
for(std::vector<announce_entry>::iterator itold=old_trackers.begin();itold!=old_trackers.end();itold++) {
if(tracker_url == itold->url) {
foreach (const announce_entry& existing_tracker, existing_trackers) {
if(QUrl(new_tracker_url.c_str()) == QUrl(existing_tracker.url.c_str())) {
found = true;
break;
}
}
if(found) {
if (!found) {
h_ex.add_tracker(announce_entry(new_tracker_url));
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."));
}
bool urlseeds_added = false;
const QStringList old_urlseeds = h_ex.url_seeds();
#if LIBTORRENT_VERSION_MINOR > 15
std::vector<web_seed_entry> new_urlseeds = t->web_seeds();
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());
if(!old_urlseeds.contains(new_url)) {
if (!old_urlseeds.contains(new_url)) {
urlseeds_added = true;
h_ex.add_url_seed(new_url);
}
......@@ -1352,17 +1354,16 @@ void QBtSession::mergeTorrents(QTorrentHandle &h_ex, boost::intrusive_ptr<torren
#else
std::vector<std::string> new_urlseeds = t->url_seeds();
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());
if(!old_urlseeds.contains(new_url)) {
if (!old_urlseeds.contains(new_url)) {
urlseeds_added = true;
h_ex.add_url_seed(new_url);
}
}
#endif
if(urlseeds_added) {
if(urlseeds_added)
addConsoleMessage(tr("Note: new URL seeds were added to the existing torrent."));
}
}
void QBtSession::exportTorrentFiles(QString path) {
......
......@@ -670,7 +670,9 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const {
bool was_seed = is_seed();
vector<size_type> progress;
file_progress(progress);
qDebug() << Q_FUNC_INFO << "Changing files priorities...";
torrent_handle::prioritize_files(files);
qDebug() << Q_FUNC_INFO << "Moving unwanted files to .unwanted folder...";
for(uint i=0; i<files.size(); ++i) {
// Move unwanted files to a .unwanted subfolder
if(files[i] == 0 && progress[i] < filesize_at(i)) {
......@@ -706,19 +708,25 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const {
}
}
// Move wanted files back to their original folder
qDebug() << Q_FUNC_INFO << "Moving wanted files back from .unwanted folder";
if(files[i] > 0) {
QString old_path = filepath_at(i);
QString old_name = filename_at(i);
QDir parent_path(misc::branchPath(old_path));
if(parent_path.dirName() == ".unwanted") {
QDir new_path(misc::branchPath(parent_path.path()));
rename_file(i, new_path.filePath(old_name));
QString parent_relpath = misc::branchPath(filepath_at(i));
if(QDir(parent_relpath).dirName() == ".unwanted") {
QString old_name = filename_at(i);
QString new_relpath = misc::branchPath(parent_relpath);
if (new_relpath.isEmpty())
rename_file(i, old_name);
else
rename_file(i, QDir(new_relpath).filePath(old_name));
// 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()) {
qDebug() << "Torrent is no longer SEEDING";
// Save seed status
TorrentPersistentData::saveSeedStatus(*this);
// Move to temp folder if necessary
......@@ -728,6 +736,7 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const {
QString root_folder = TorrentPersistentData::getRootFolder(hash());
if(!root_folder.isEmpty())
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);
}
}
......
......@@ -471,8 +471,7 @@ void AutomatedRssDownloader::updateMatchingArticles()
if(!rule.isValid()) continue;
foreach(const QString &feed_url, rule.rssFeeds()) {
qDebug() << Q_FUNC_INFO << feed_url;
Q_ASSERT(all_feeds.contains(feed_url));
if(!all_feeds.contains(feed_url)) continue;
if(!all_feeds.contains(feed_url)) continue; // Feed was removed
const RssFeed *feed = all_feeds.value(feed_url);
Q_ASSERT(feed);
if(!feed) continue;
......
......@@ -51,8 +51,10 @@ RssDownloadRuleList* RssDownloadRuleList::instance()
void RssDownloadRuleList::drop()
{
if(m_instance)
if(m_instance) {
delete m_instance;
m_instance = 0;
}
}
RssDownloadRule RssDownloadRuleList::findMatchingRule(const QString &feed_url, const QString &article_title) const
......
This diff is collapsed.
......@@ -48,7 +48,8 @@ public:
FileType type() const;
void refresh();
QString id() const { return m_url; }
void removeAllSettings();
virtual void removeAllSettings();
virtual void saveItemsToDisk();
bool itemAlreadyExists(const QString &hash) const;
void setLoading(bool val);
bool isLoading() const;
......@@ -77,7 +78,6 @@ private:
bool parseXmlFile(const QString &file_path);
void downloadMatchingArticleTorrents();
QString iconUrl() const;
void saveItemsToDisk();
void loadItemsFromDisk();
private:
......
......@@ -54,6 +54,7 @@ public:
virtual void setParent(RssFolder* parent) = 0;
virtual void refresh() = 0;
virtual void removeAllSettings() = 0;
virtual void saveItemsToDisk() = 0;
virtual const QList<RssArticle> articleList() const = 0;
virtual const QList<RssArticle> unreadArticleList() const = 0;
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