1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

- Updated selectFirstFeed() function due to code rewrite

This commit is contained in:
Christophe Dumez 2009-08-23 13:35:45 +00:00
parent 3550e31871
commit 06fb19e8be
4 changed files with 5 additions and 14 deletions

View File

@ -32,8 +32,11 @@ public:
void itemAdded(QTreeWidgetItem *item, RssFile* file) { void itemAdded(QTreeWidgetItem *item, RssFile* file) {
mapping[item] = file; mapping[item] = file;
if(file->getType() == RssFile::STREAM) if(file->getType() == RssFile::STREAM) {
feeds_items[file->getID()] = item; feeds_items[file->getID()] = item;
if(topLevelItemCount() == 1)
setCurrentItem(item);
}
} }
void itemRemoved(QTreeWidgetItem *item) { void itemRemoved(QTreeWidgetItem *item) {

View File

@ -162,8 +162,6 @@ void RSSImp::on_newFeedButton_clicked() {
// Set text // Set text
item->setText(0, stream->getName() + QString::fromUtf8(" (0)")); item->setText(0, stream->getName() + QString::fromUtf8(" (0)"));
item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png"))); item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png")));
if(listStreams->topLevelItemCount() == 1)
selectFirstFeed();
stream->refresh(); stream->refresh();
rssmanager->saveStreamList(); rssmanager->saveStreamList();
} }
@ -471,8 +469,6 @@ RSSImp::RSSImp(bittorrent *BTSession) : QWidget(), BTSession(BTSession){
connect(listNews, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(refreshTextBrowser(QListWidgetItem *))); connect(listNews, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(refreshTextBrowser(QListWidgetItem *)));
connect(listNews, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(downloadTorrent())); connect(listNews, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(downloadTorrent()));
// Select first news of first feed
selectFirstFeed();
// Refresh all feeds // Refresh all feeds
rssmanager->refreshAll(); rssmanager->refreshAll();
// Restore sliders position // Restore sliders position
@ -484,13 +480,6 @@ RSSImp::RSSImp(bittorrent *BTSession) : QWidget(), BTSession(BTSession){
qDebug("RSSImp constructed"); qDebug("RSSImp constructed");
} }
void RSSImp::selectFirstFeed(){
if(listStreams->topLevelItemCount()){
QTreeWidgetItem *first = listStreams->topLevelItem(0);
listStreams->setCurrentItem(first);
}
}
RSSImp::~RSSImp(){ RSSImp::~RSSImp(){
qDebug("Deleting RSSImp..."); qDebug("Deleting RSSImp...");
delete listStreams; delete listStreams;

View File

@ -68,7 +68,6 @@ protected slots:
void openNewsUrl(); void openNewsUrl();
void downloadTorrent(); void downloadTorrent();
void fillFeedsList(QTreeWidgetItem *parent=0, RssFolder *rss_parent=0); void fillFeedsList(QTreeWidgetItem *parent=0, RssFolder *rss_parent=0);
void selectFirstFeed();
void saveSlidersPosition(); void saveSlidersPosition();
void restoreSlidersPosition(); void restoreSlidersPosition();
void showFeedDownloader(); void showFeedDownloader();

View File

@ -14,7 +14,7 @@ CONFIG += qt \
network network
# Update this VERSION for each release # Update this VERSION for each release
DEFINES += VERSION=\\\"v1.5.0beta1\\\" DEFINES += VERSION=\\\"v1.5.0beta2\\\"
DEFINES += VERSION_MAJOR=1 DEFINES += VERSION_MAJOR=1
DEFINES += VERSION_MINOR=5 DEFINES += VERSION_MINOR=5
DEFINES += VERSION_BUGFIX=0 DEFINES += VERSION_BUGFIX=0