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:
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) {

11
src/rss_imp.cpp

@ -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;

1
src/rss_imp.h

@ -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();

2
src/src.pro

@ -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

Loading…
Cancel
Save