diff --git a/src/SearchTab.cpp b/src/SearchTab.cpp index 23b6bd197..5d0177c9d 100644 --- a/src/SearchTab.cpp +++ b/src/SearchTab.cpp @@ -135,16 +135,23 @@ QTreeView* SearchTab::getCurrentTreeView() return resultsBrowser; } -QStandardItemModel* SearchTab::getCurrentSearchListModel() +QSortFilterProxyModel* SearchTab::getCurrentSearchListProxy() const +{ + return proxyModel; +} + +QStandardItemModel* SearchTab::getCurrentSearchListModel() const { return SearchListModel; } // Set the color of a row in data model void SearchTab::setRowColor(int row, QString color){ + proxyModel->setDynamicSortFilter(false); for(int i=0; icolumnCount(); ++i){ proxyModel->setData(proxyModel->index(row, i), QVariant(QColor(color)), Qt::ForegroundRole); } + proxyModel->setDynamicSortFilter(true); } diff --git a/src/SearchTab.h b/src/SearchTab.h index 6762c257a..16f2dd781 100644 --- a/src/SearchTab.h +++ b/src/SearchTab.h @@ -63,7 +63,8 @@ public: ~SearchTab(); bool loadColWidthResultsList(); QLabel * getCurrentLabel(); - QStandardItemModel * getCurrentSearchListModel(); + QStandardItemModel* getCurrentSearchListModel() const; + QSortFilterProxyModel* getCurrentSearchListProxy() const; QTreeView * getCurrentTreeView(); void setRowColor(int row, QString color); QHeaderView* header() const; diff --git a/src/searchEngine.cpp b/src/searchEngine.cpp index 94333406c..25c43617d 100644 --- a/src/searchEngine.cpp +++ b/src/searchEngine.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include "searchEngine.h" #include "bittorrent.h" @@ -464,7 +465,7 @@ void SearchEngine::appendSearchResult(QString line){ } // Add item to search result list - QStandardItemModel *cur_model = currentSearchTab->getCurrentSearchListModel(); + QStandardItemModel* cur_model = currentSearchTab->getCurrentSearchListModel(); int row = cur_model->rowCount(); cur_model->insertRow(row); @@ -523,7 +524,7 @@ void SearchEngine::on_download_button_clicked(){ foreach(const QModelIndex &index, selectedIndexes){ if(index.column() == NAME){ // Get Item url - QStandardItemModel *model = all_tab.at(tabWidget->currentIndex())->getCurrentSearchListModel(); + QSortFilterProxyModel* model = all_tab.at(tabWidget->currentIndex())->getCurrentSearchListProxy(); QString torrent_url = model->data(model->index(index.row(), URL_COLUMN)).toString(); QString engine_url = model->data(model->index(index.row(), ENGINE_URL_COLUMN)).toString(); downloadTorrent(engine_url, torrent_url); diff --git a/src/search_engine/engines/piratebay.py b/src/search_engine/engines/piratebay.py index 98f5da9b2..e37e77876 100644 --- a/src/search_engine/engines/piratebay.py +++ b/src/search_engine/engines/piratebay.py @@ -1,4 +1,4 @@ -#VERSION: 1.21 +#VERSION: 1.22 #AUTHORS: Fabien Devaux (fab@gnux.info) #CONTRIBUTORS: Christophe Dumez (chris@qbittorrent.org) @@ -101,8 +101,6 @@ class piratebay(object): while True and i<11: results = [] parser = self.SimpleSGMLParser(results, self.url) - print self.url+'/search/%s/%u/99/%s' % (what, i, self.supported_categories[cat]) - return dat = retrieve_url(self.url+'/search/%s/%u/99/%s' % (what, i, self.supported_categories[cat])) parser.feed(dat) parser.close() diff --git a/src/search_engine/engines/versions.txt b/src/search_engine/engines/versions.txt index 4dc0186ca..c5909d88b 100644 --- a/src/search_engine/engines/versions.txt +++ b/src/search_engine/engines/versions.txt @@ -2,4 +2,4 @@ isohunt: 1.30 torrentreactor: 1.20 btjunkie: 2.21 mininova: 1.31 -piratebay: 1.21 +piratebay: 1.22