summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index cc1bbbb..a7f98be 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -33,60 +33,60 @@
extern "C" {
#include "libstocks/stocks.h"
}
#include "stocktickerpluginwidget.h"
StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char* name)
: QWidget(parent, name ) {
init();
startTimer(1000);
}
StockTickerPluginWidget::~StockTickerPluginWidget() {
}
void StockTickerPluginWidget::init() {
QHBoxLayout* layout = new QHBoxLayout( this );
stocktickerTicker = new Ticker(this);
stocktickerTicker->setMinimumHeight(15);
connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( doStocks() ));
layout->addWidget( stocktickerTicker);
+// Config cfg( "stockticker");
+// cfg.setGroup("Timer");
+// timerDelay= cfg.readNumEntry("Delay",0);
+// if(timerDelay > 0 )
+// startTimer(timerDelay*60000);
+// qDebug("timer ^ set for %d",(timerDelay*60000)/60000);
- Config cfg( "stockticker");
- cfg.setGroup("Timer");
- timerDelay= cfg.readNumEntry("Delay",0);
- if(timerDelay > 0)
- startTimer(timerDelay*60000);
-
}
void StockTickerPluginWidget::doStocks() {
-
Config cfg( "stockticker");
+
cfg.setGroup( "Symbols" );
QString symbollist;
symbollist = cfg.readEntry("Symbols", "");
symbollist.replace(QRegExp(" "),"+");//seperated by +
// qDebug(symbollist);
getStocks( symbollist.latin1());
stocktickerTicker->setText( output );
}
void StockTickerPluginWidget::getStocks( const char *blah) {
stock *stocks_quotes=NULL;
stock *stocks_tmp;
QString tempString;
output = "";
libstocks_return_code error;
Config cfg( "stockticker");
cfg.setGroup( "Fields" );
bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck;
@@ -227,30 +227,34 @@ void StockTickerPluginWidget::getStocks( const char *blah) {
}
void StockTickerPluginWidget::DefProxy(void) {
char *proxy;
libstocks_return_code error;
/* Proxy support */
/* Checks for "http_proxy" environment variable */
proxy = getenv("http_proxy");
if(proxy) {
/* printf("proxy set\n"); */
error = set_proxy(proxy);
if (error) {
// printf("Proxy error (%d)\n", error);
QString tempString;
tempString.sprintf("Proxy error (%d)\n", error);
output = tempString;
return;
// exit(1);
}
}
}
void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
- qDebug("timer");
killTimer(e->timerId());
doStocks();
+ Config cfg( "stockticker");
+ cfg.setGroup("Timer");
+ timerDelay= cfg.readNumEntry("Delay",0);
if(timerDelay > 0)
startTimer(timerDelay*60000);
+ qDebug("timer set for %d",(timerDelay*60000)/60000);
+
}