summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
Unidiff
Diffstat (limited to 'noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index aabb4d2..e178338 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -51,12 +51,19 @@ void StockTickerPluginWidget::init() {
51 51
52 stocktickerTicker = new Ticker(this); 52 stocktickerTicker = new Ticker(this);
53 stocktickerTicker->setMinimumHeight(15); 53 stocktickerTicker->setMinimumHeight(15);
54 connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( doStocks() )); 54 connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( doStocks() ));
55 55
56 layout->addWidget( stocktickerTicker); 56 layout->addWidget( stocktickerTicker);
57
58 Config cfg( "stockticker");
59 cfg.setGroup("Timer");
60 timerDelay= cfg.readNumEntry("Delay",0);
61 if(timerDelay > 0)
62 startTimer(timerDelay*60000);
63
57} 64}
58 65
59void StockTickerPluginWidget::doStocks() { 66void StockTickerPluginWidget::doStocks() {
60 67
61 Config cfg( "stockticker"); 68 Config cfg( "stockticker");
62 cfg.setGroup( "Symbols" ); 69 cfg.setGroup( "Symbols" );
@@ -117,13 +124,13 @@ void StockTickerPluginWidget::getStocks( const char *blah) {
117 124
118 /* Displays the stocks */ 125 /* Displays the stocks */
119 while(stocks_tmp!=0){ 126 while(stocks_tmp!=0){
120 127
121 if (stocks_tmp->Time) { 128 if (stocks_tmp->Time) {
122// printf("%s ", stocks_tmp->Time); 129// printf("%s ", stocks_tmp->Time);
123 tempString.sprintf("|| %s ", stocks_tmp->Time); 130 tempString.sprintf("| %s ", stocks_tmp->Time);
124 tempString.replace(QRegExp("\""),""); 131 tempString.replace(QRegExp("\""),"");
125 if( dotimeCheck) 132 if( dotimeCheck)
126 output +=tempString; 133 output +=tempString;
127 } 134 }
128 if (stocks_tmp->Date) { 135 if (stocks_tmp->Date) {
129// printf("%s ", stocks_tmp->Date); 136// printf("%s ", stocks_tmp->Date);
@@ -240,7 +247,9 @@ void StockTickerPluginWidget::DefProxy(void) {
240 } 247 }
241} 248}
242 249
243void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { 250void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
244 killTimer(e->timerId()); 251 killTimer(e->timerId());
245 doStocks(); 252 doStocks();
253 if(timerDelay > 0)
254 startTimer(timerDelay*1000);
246} 255}