Browse Source

- Fixed typo and redesigned rss code a little

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
4a57037c47
  1. 13
      src/rss_imp.cpp
  2. 8
      src/rss_imp.h

13
src/rss_imp.cpp

@ -59,7 +59,7 @@
// refresh all streams by a button // refresh all streams by a button
void RSSImp::on_refreshAll_button_clicked() { void RSSImp::on_refreshAll_button_clicked() {
refreshAllStream(); refreshAllStreams();
} }
// display the news of a stream when click on it // display the news of a stream when click on it
@ -125,7 +125,7 @@
} }
//right-click somewhere, refresh all the streams //right-click somewhere, refresh all the streams
void RSSImp::refreshAllStream() { void RSSImp::refreshAllStreams() {
if(lastRefresh.elapsed()>REFRESH_FREQ_MAX) { if(lastRefresh.elapsed()>REFRESH_FREQ_MAX) {
textBrowser->clear(); textBrowser->clear();
listNews->clear(); listNews->clear();
@ -140,8 +140,11 @@
bool ok; bool ok;
QString newUrl = QInputDialog::getText(this, tr("Please type a rss stream url"), tr("Stream URL:"), QLineEdit::Normal, "http://", &ok); QString newUrl = QInputDialog::getText(this, tr("Please type a rss stream url"), tr("Stream URL:"), QLineEdit::Normal, "http://", &ok);
if(ok) { if(ok) {
rssmanager.addStream(newUrl); newUrl = newUrl.trimmed();
refreshStreamList(); if(!newUrl.isEmpty() && newUrl != "http://"){
rssmanager.addStream(newUrl);
refreshStreamList();
}
} }
} }
@ -193,7 +196,7 @@
connect(actionRename, SIGNAL(triggered()), this, SLOT(renameStream())); connect(actionRename, SIGNAL(triggered()), this, SLOT(renameStream()));
connect(actionRefresh, SIGNAL(triggered()), this, SLOT(refreshStream())); connect(actionRefresh, SIGNAL(triggered()), this, SLOT(refreshStream()));
connect(actionCreate, SIGNAL(triggered()), this, SLOT(createStream())); connect(actionCreate, SIGNAL(triggered()), this, SLOT(createStream()));
connect(actionRefreshAll, SIGNAL(triggered()), this, SLOT(refreshAllStream())); connect(actionRefreshAll, SIGNAL(triggered()), this, SLOT(refreshAllStreams()));
refreshStreamList(); refreshStreamList();
refreshTextBrowser(); refreshTextBrowser();
timer = new QTimer(this); timer = new QTimer(this);

8
src/rss_imp.h

@ -35,9 +35,6 @@ class RSSImp : public QWidget, public Ui::RSS{
private: private:
RssManager rssmanager; RssManager rssmanager;
void refreshStreamList();
void refreshNewsList();
void refreshTextBrowser();
QTimer* timer; QTimer* timer;
QTime lastRefresh; QTime lastRefresh;
@ -53,8 +50,11 @@ class RSSImp : public QWidget, public Ui::RSS{
void renameStream(); void renameStream();
void refreshStream(); void refreshStream();
void createStream(); void createStream();
void refreshAllStream();
void updateStreamNbNews(); void updateStreamNbNews();
void refreshAllStreams();
void refreshStreamList();
void refreshNewsList();
void refreshTextBrowser();
public: public:
RSSImp(); RSSImp();

Loading…
Cancel
Save