Browse Source

- Updated selectFirstFeed() function due to code rewrite

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
06fb19e8be
  1. 5
      src/feedList.h
  2. 11
      src/rss_imp.cpp
  3. 1
      src/rss_imp.h
  4. 2
      src/src.pro

5
src/feedList.h

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

11
src/rss_imp.cpp

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

1
src/rss_imp.h

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

2
src/src.pro

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

Loading…
Cancel
Save