Commit 60908cbe authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 2.0.7

parent 1af8120d
* Mon Jan 11 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.7
- BUGFIX: Fix 'Add in pause' setting in torrent addition dialog
- BUGFIX: Update RSS feed as soon as feed downloader is enabled
- BUGFIX: RSS Feed downloader ignores articles above maximum number of articles
- BUGFIX: Fix possible bug when deleting a RSS folder
- BUGFIX: Remove persistant data when a RSS feed is deleted
- BUGFIX: RSS filters are now alphabetically sorted
- BUGFIX: Fix crash when renaming currently displayed RSS filter
- BUGFIX: Remove overwriting confirmation when exporting RSS filters since Qt takes care of it
* Tue Jan 5 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.6
- BUGFIX: Fix detection of invalid torrent files
- BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop
......
......@@ -157,6 +157,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
// Methods
int getCurrentTabIndex() const;
QPoint screenCenter() const;
TransferListWidget* getTransferList() const { return transferList; }
};
#endif
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.0.6
Comment=V2.0.7
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[bg]=Торент клиент
......
This diff was suppressed by a .gitattributes entry.
......@@ -47,10 +47,16 @@ public:
}
}
void itemRemoved(QTreeWidgetItem *item) {
void itemAboutToBeRemoved(QTreeWidgetItem *item) {
RssFile* file = mapping.take(item);
if(file->getType() == RssFile::STREAM)
if(file->getType() == RssFile::STREAM) {
feeds_items.remove(file->getID());
} else {
QList<RssStream*> feeds = ((RssFolder*)file)->getAllFeeds();
foreach(RssStream* feed, feeds) {
feeds_items.remove(feed->getID());
}
}
}
bool hasFeed(QString url) const {
......
......@@ -257,6 +257,7 @@ public:
// Restore saved info
enableDl_cb->setChecked(filters.isDownloadingEnabled());
fillFiltersList();
filtersList->sortItems(Qt::AscendingOrder);
if(filters.size() > 0) {
// Select first filter
filtersList->setCurrentItem(filtersList->item(0));
......@@ -267,6 +268,8 @@ public:
}
~FeedDownloaderDlg() {
if(enableDl_cb->isChecked())
emit filteringEnabled();
// Make sure we save everything
saveCurrentFilterSettings();
filters.save();
......@@ -374,11 +377,14 @@ protected slots:
QMessageBox::warning(0, tr("Invalid filter name"), tr("This filter name is already in use."));
}
}while(!validated);
// Save the current filter
saveCurrentFilterSettings();
// Rename the filter
filters.rename(current_name, new_name);
if(selected_filter == current_name)
selected_filter = new_name;
item->setText(new_name);
filtersList->sortItems(Qt::AscendingOrder);
}
}
......@@ -432,6 +438,7 @@ protected slots:
}
}while(!validated);
QListWidgetItem *it = new QListWidgetItem(filter_name, filtersList);
filtersList->sortItems(Qt::AscendingOrder);
filtersList->setCurrentItem(it);
//showFilterSettings(it);
}
......@@ -487,16 +494,19 @@ protected slots:
// Append file extension
if(!destination.endsWith(".filters"))
destination += ".filters";
if(QFile::exists(destination)) {
/*if(QFile::exists(destination)) {
int ret = QMessageBox::question(0, tr("Overwriting confirmation"), tr("Are you sure you want to overwrite existing file?"), QMessageBox::Yes|QMessageBox::No);
if(ret != QMessageBox::Yes) return;
}
}*/
if(filters.serialize(destination))
QMessageBox::information(0, tr("Export successful"), tr("Filters export was successful."));
else
QMessageBox::warning(0, tr("Export failure"), tr("Filters could not be exported due to an I/O error."));
}
signals:
void filteringEnabled();
};
#undef QHash
......
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 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.
......@@ -90,8 +90,12 @@ void RssFolder::refreshAll(){
}
void RssFolder::removeFile(QString ID) {
if(this->contains(ID))
delete this->take(ID);
if(this->contains(ID)) {
RssFile* child = this->take(ID);
child->removeAllSettings();
child->removeAllItems();
delete child;
}
}
RssFolder* RssFolder::addFolder(QString name) {
......@@ -427,6 +431,20 @@ void RssStream::removeAllItems() {
this->clear();
}
void RssStream::removeAllSettings() {
QSettings qBTRSS("qBittorrent", "qBittorrent-rss");
QHash<QString, QVariant> feeds_w_downloader = qBTRSS.value("downloader_on", QHash<QString, QVariant>()).toHash();
if(feeds_w_downloader.contains(url)) {
feeds_w_downloader.remove(url);
qBTRSS.setValue("downloader_on", feeds_w_downloader);
}
QHash<QString, QVariant> all_feeds_filters = qBTRSS.value("feed_filters", QHash<QString, QVariant>()).toHash();
if(all_feeds_filters.contains(url)) {
all_feeds_filters.remove(url);
qBTRSS.setValue("feed_filters", all_feeds_filters);
}
}
bool RssStream::itemAlreadyExists(QString name) {
return this->contains(name);
}
......@@ -579,36 +597,7 @@ short RssStream::readDoc(const QDomDocument& doc) {
(*this)[title] = item;
} else {
delete item;
item = this->value(title);
}
QString torrent_url;
if(item->has_attachment())
torrent_url = item->getTorrentUrl();
else
torrent_url = item->getLink();
// Check if the item should be automatically downloaded
if(!already_exists || !(*this)[item->getTitle()]->isRead()) {
FeedFilter * matching_filter = FeedFilters::getFeedFilters(url).matches(item->getTitle());
if(matching_filter != 0) {
// Download the torrent
BTSession->addConsoleMessage(tr("Automatically downloading %1 torrent from %2 RSS feed...").arg(item->getTitle()).arg(getName()));
if(matching_filter->isValid()) {
QString save_path = matching_filter->getSavePath();
if(save_path.isEmpty())
BTSession->downloadUrlAndSkipDialog(torrent_url);
else
BTSession->downloadUrlAndSkipDialog(torrent_url, save_path);
} else {
// All torrents are downloaded from this feed
BTSession->downloadUrlAndSkipDialog(torrent_url);
}
// Item was downloaded, consider it as Read
(*this)[item->getTitle()]->setRead();
// Clean up
delete matching_filter;
}
}
} else {
delete item;
}
......@@ -619,6 +608,35 @@ short RssStream::readDoc(const QDomDocument& doc) {
channel = channel.nextSibling().toElement();
}
resizeList();
// RSS Feed Downloader
foreach(RssItem* item, values()) {
if(item->isRead()) continue;
QString torrent_url;
if(item->has_attachment())
torrent_url = item->getTorrentUrl();
else
torrent_url = item->getLink();
// Check if the item should be automatically downloaded
FeedFilter * matching_filter = FeedFilters::getFeedFilters(url).matches(item->getTitle());
if(matching_filter != 0) {
// Download the torrent
BTSession->addConsoleMessage(tr("Automatically downloading %1 torrent from %2 RSS feed...").arg(item->getTitle()).arg(getName()));
if(matching_filter->isValid()) {
QString save_path = matching_filter->getSavePath();
if(save_path.isEmpty())
BTSession->downloadUrlAndSkipDialog(torrent_url);
else
BTSession->downloadUrlAndSkipDialog(torrent_url, save_path);
} else {
// All torrents are downloaded from this feed
BTSession->downloadUrlAndSkipDialog(torrent_url);
}
// Item was downloaded, consider it as Read
item->setRead();
// Clean up
delete matching_filter;
}
}
return 0;
}
......
......@@ -97,11 +97,13 @@ public:
virtual FileType getType() const = 0;
virtual QString getName() const = 0;
virtual QString getID() const = 0;
virtual void removeAllItems() = 0;
virtual void rename(QString new_name) = 0;
virtual void markAllAsRead() = 0;
virtual RssFolder* getParent() const = 0;
virtual void setParent(RssFolder*) = 0;
virtual void refresh() = 0;
virtual void removeAllSettings() = 0;
virtual QList<RssItem*> getNewsList() const = 0;
virtual QList<RssItem*> getUnreadNewsList() const = 0;
QStringList getPath() const {
......@@ -225,11 +227,11 @@ protected:
negOffset = true; // military zone: RFC 2822 treats as '-0000'
else if (zone != "UT" && zone != "GMT") { // treated as '+0000'
offset = (zone == "EDT") ? -4*3600
: (zone == "EST" || zone == "CDT") ? -5*3600
: (zone == "CST" || zone == "MDT") ? -6*3600
: (zone == "MST" || zone == "PDT") ? -7*3600
: (zone == "PST") ? -8*3600
: 0;
: (zone == "EST" || zone == "CDT") ? -5*3600
: (zone == "CST" || zone == "MDT") ? -6*3600
: (zone == "MST" || zone == "PDT") ? -7*3600
: (zone == "PST") ? -8*3600
: 0;
if (!offset) {
// Check for any other alphabetic time zone
bool nonalpha = false;
......@@ -408,6 +410,7 @@ public:
void refresh();
QString getID() const { return url; }
void removeAllItems();
void removeAllSettings();
bool itemAlreadyExists(QString hash);
void setLoading(bool val);
bool isLoading();
......@@ -464,6 +467,19 @@ public:
bool hasChild(QString ID) { return this->contains(ID); }
QList<RssItem*> getNewsList() const;
QList<RssItem*> getUnreadNewsList() const;
void removeAllSettings() {
foreach(RssFile* child, values()) {
child->removeAllSettings();
}
}
void removeAllItems() {
foreach(RssFile* child, values()) {
child->removeAllItems();
}
qDeleteAll(values());
clear();
}
public slots:
void refreshAll();
......
......@@ -219,7 +219,7 @@ void RSSImp::deleteSelectedItems() {
}
RssFile *rss_item = listStreams->getRSSItem(item);
// Notify TreeWidget
listStreams->itemRemoved(item);
listStreams->itemAboutToBeRemoved(item);
// Actually delete the item
rss_item->getParent()->removeFile(rss_item->getID());
delete item;
......@@ -374,8 +374,10 @@ void RSSImp::copySelectedFeedsURL() {
void RSSImp::showFeedDownloader() {
QTreeWidgetItem* item = listStreams->selectedItems()[0];
RssFile* rss_item = listStreams->getRSSItem(item);
if(rss_item->getType() == RssFile::STREAM)
new FeedDownloaderDlg(this, listStreams->getItemID(item), rss_item->getName(), BTSession);
if(rss_item->getType() == RssFile::STREAM) {
FeedDownloaderDlg* feedDownloader = new FeedDownloaderDlg(this, listStreams->getItemID(item), rss_item->getName(), BTSession);
connect(feedDownloader, SIGNAL(filteringEnabled()), this, SLOT(on_updateAllButton_clicked()));
}
}
void RSSImp::on_markReadButton_clicked() {
......
......@@ -12,10 +12,10 @@ CONFIG += qt \
thread
# Update this VERSION for each release
DEFINES += VERSION=\\\"v2.0.6\\\"
DEFINES += VERSION=\\\"v2.0.7\\\"
DEFINES += VERSION_MAJOR=2
DEFINES += VERSION_MINOR=0
DEFINES += VERSION_BUGFIX=6
DEFINES += VERSION_BUGFIX=7
# !mac:QMAKE_LFLAGS += -Wl,--as-needed
contains(DEBUG_MODE, 1) {
......
......@@ -51,6 +51,8 @@
#include "torrentpersistentdata.h"
#include "torrentfilesmodel.h"
#include "preferences.h"
#include "GUI.h"
#include "transferlistwidget.h"
using namespace libtorrent;
......@@ -69,9 +71,10 @@ private:
boost::intrusive_ptr<torrent_info> t;
public:
torrentAdditionDialog(QWidget *parent, Bittorrent* _BTSession) : QDialog(parent) {
torrentAdditionDialog(GUI *parent, Bittorrent* _BTSession) : QDialog((QWidget*)parent) {
setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
connect(this, SIGNAL(torrentPaused(QTorrentHandle&)), parent->getTransferList(), SLOT(pauseTorrent(QTorrentHandle&)));
BTSession = _BTSession;
// Set Properties list model
PropListModel = new TorrentFilesModel();
......@@ -341,10 +344,15 @@ public slots:
savePiecesPriorities();
// Add to download list
QTorrentHandle h = BTSession->addTorrent(filePath, false, from_url);
if(addInPause->isChecked() && h.is_valid())
if(addInPause->isChecked() && h.is_valid()) {
h.pause();
emit torrentPaused(h);
}
close();
}
signals:
void torrentPaused(QTorrentHandle &h);
};
#endif
......@@ -77,7 +77,6 @@ protected slots:
void displayListMenu(const QPoint&);
void updateMetadata(QTorrentHandle &h);
void currentChanged(const QModelIndex& current, const QModelIndex&);
void pauseTorrent(QTorrentHandle &h);
void resumeTorrent(QTorrentHandle &h);
#ifdef LIBTORRENT_0_15
void toggleSelectedTorrentsSuperSeeding();
......@@ -89,6 +88,7 @@ protected slots:
public slots:
void refreshList();
void addTorrent(QTorrentHandle& h);
void pauseTorrent(QTorrentHandle &h);
void setFinished(QTorrentHandle &h);
void setRefreshInterval(int t);
void startSelectedTorrents();
......
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