summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/stockticker/stocktickerlib
Unidiff
Diffstat (limited to 'noncore/todayplugins/stockticker/stocktickerlib') (more/less context) (show whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/config.in2
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro5
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp10
3 files changed, 8 insertions, 9 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/config.in b/noncore/todayplugins/stockticker/stocktickerlib/config.in
index 4d589f9..7dbe03a 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/config.in
+++ b/noncore/todayplugins/stockticker/stocktickerlib/config.in
@@ -1,4 +1,4 @@
1config TODAY_STOCKTICKERLIB 1config TODAY_STOCKTICKERLIB
2 boolean 2 boolean
3 default "y" if TODAY_STOCKTICKER 3 default "y" if TODAY_STOCKTICKER
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LIBOPIE2PIM && TODAY 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBOPIE2PIM && TODAY
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro
index e70d1c0..6dcf945 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro
@@ -1,29 +1,28 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG -= moc
3CONFIG += qt plugin 2CONFIG += qt plugin
4 3
5HEADERS = stocktickerplugin.h stocktickerpluginimpl.h stocktickerpluginwidget.h stocktickerconfig.h \ 4HEADERS = stocktickerplugin.h stocktickerpluginimpl.h stocktickerpluginwidget.h stocktickerconfig.h \
6 ../libstocks/csv.h \ 5 ../libstocks/csv.h \
7 ../libstocks/http.h \ 6 ../libstocks/http.h \
8 ../libstocks/lists.h \ 7 ../libstocks/lists.h \
9 ../libstocks/stocks.h 8 ../libstocks/stocks.h
10SOURCES = stocktickerplugin.cpp stocktickerpluginimpl.cpp stocktickerpluginwidget.cpp stocktickerconfig.cpp \ 9SOURCES = stocktickerplugin.cpp stocktickerpluginimpl.cpp stocktickerpluginwidget.cpp stocktickerconfig.cpp \
11 ../libstocks/csv.c \ 10 ../libstocks/csv.c \
12 ../libstocks/currency.c \ 11 ../libstocks/currency.c \
13 ../libstocks/history.c \ 12 ../libstocks/history.c \
14 ../libstocks/http.c \ 13 ../libstocks/http.c \
15 ../libstocks/lists.c \ 14 ../libstocks/lists.c \
16 ../libstocks/stocks.c 15 ../libstocks/stocks.c
17 16
18INCLUDEPATH += $(OPIEDIR)/include \ 17INCLUDEPATH += $(OPIEDIR)/include \
19 ../ ../library 18 ../ ../library
20DEPENDPATH += $(OPIEDIR)/include \ 19DEPENDPATH += $(OPIEDIR)/include \
21 ../ ../library 20 ../ ../library
22 21
23LIBS+= -lqpe -lopieui2 -lopiepim2 -lpthread 22LIBS += -lqpe -lopiecore2 -lopieui2 -lopiepim2 -lpthread
24TMAKE_CFLAGS += -D__UNIX__ 23DEFINES += __UNIX__
25 24
26DESTDIR = $(OPIEDIR)/plugins/today 25DESTDIR = $(OPIEDIR)/plugins/today
27TARGET = todaystocktickerplugin 26TARGET = todaystocktickerplugin
28 27
29include ( $(OPIEDIR)/include.pro ) 28include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index aaeb5ee..4855ac6 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -36,25 +36,25 @@ extern "C" {
36 bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck; 36 bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck;
37 bool docurrentPriceCheck, dolastPriceCheck, doopenPriceCheck; 37 bool docurrentPriceCheck, dolastPriceCheck, doopenPriceCheck;
38 bool dominPriceCheck, domaxPriceCheck, dovariationCheck, dovolumeCheck; 38 bool dominPriceCheck, domaxPriceCheck, dovariationCheck, dovolumeCheck;
39 39
40void getStocks(char *blah) { 40void getStocks(char *blah) {
41 41
42 // stocktickerTicker->setText( "Downloading stock data."); 42 // stocktickerTicker->setText( "Downloading stock data.");
43 stock *stocks_quotes=NULL; 43 stock *stocks_quotes=NULL;
44 stock *stocks_tmp; 44 stock *stocks_tmp;
45 stock_liste = blah; 45 stock_liste = blah;
46 ::free ( blah ); 46 ::free ( blah );
47 // char *stock_liste = (char *)blah->latin1(); 47 // char *stock_liste = (char *)blah->latin1();
48 // qDebug("%s", stock_liste.data() ); 48 // odebug << "" << stock_liste.data() << "" << oendl;
49 output = ""; 49 output = "";
50 QString tempString; 50 QString tempString;
51 libstocks_return_code error; 51 libstocks_return_code error;
52 52
53// Config cfg( "stockticker"); 53// Config cfg( "stockticker");
54// cfg.setGroup( "Fields" ); 54// cfg.setGroup( "Fields" );
55// bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck; 55// bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck;
56// bool docurrentPriceCheck, dolastPriceCheck, doopenPriceCheck; 56// bool docurrentPriceCheck, dolastPriceCheck, doopenPriceCheck;
57// bool dominPriceCheck, domaxPriceCheck, dovariationCheck, dovolumeCheck; 57// bool dominPriceCheck, domaxPriceCheck, dovariationCheck, dovolumeCheck;
58 58
59 dotimeCheck=dodateCheck=dosymbolCheck=donameCheck= docurrentPriceCheck=dolastPriceCheck=doopenPriceCheck=dominPriceCheck=domaxPriceCheck=dovariationCheck=dovolumeCheck=false; 59 dotimeCheck=dodateCheck=dosymbolCheck=donameCheck= docurrentPriceCheck=dolastPriceCheck=doopenPriceCheck=dominPriceCheck=domaxPriceCheck=dovariationCheck=dovolumeCheck=false;
60 60
@@ -269,51 +269,51 @@ void getStocks(char *blah) {
269 269
270 //::free((void*)thread1); 270 //::free((void*)thread1);
271 //getStocks(blah); 271 //getStocks(blah);
272 } 272 }
273 } 273 }
274 274
275 void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { 275 void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
276 killTimer(e->timerId()); 276 killTimer(e->timerId());
277 checkConnection(); 277 checkConnection();
278 } 278 }
279 279
280 void StockTickerPluginWidget::checkConnection() { 280 void StockTickerPluginWidget::checkConnection() {
281 // qDebug("checking connection"); 281 // odebug << "checking connection" << oendl;
282 // Sock = new QSocket( this ); 282 // Sock = new QSocket( this );
283 283
284 // if( wasError) 284 // if( wasError)
285 // stocktickerTicker->setText("Checking connection"); 285 // stocktickerTicker->setText("Checking connection");
286 286
287 // if(Sock->state() == QSocket::Idle) { 287 // if(Sock->state() == QSocket::Idle) {
288 // Sock->connectToHost("finance.yahoo.com", 80); 288 // Sock->connectToHost("finance.yahoo.com", 80);
289 // connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) ); 289 // connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) );
290 // connect( Sock, SIGNAL( hostFound() ), SLOT(isConnected()) ); 290 // connect( Sock, SIGNAL( hostFound() ), SLOT(isConnected()) );
291 // } else { 291 // } else {
292 // qDebug("State is not Idle"); 292 // odebug << "State is not Idle" << oendl;
293 isConnected(); 293 isConnected();
294 // } 294 // }
295 } 295 }
296 296
297 void StockTickerPluginWidget::isConnected() { 297 void StockTickerPluginWidget::isConnected() {
298 // qDebug("We connect, so ok to grab stocks"); 298 // odebug << "We connect, so ok to grab stocks" << oendl;
299 if(this->isVisible()) 299 if(this->isVisible())
300 doStocks(); 300 doStocks();
301 301
302 Config cfg( "stockticker"); 302 Config cfg( "stockticker");
303 cfg.setGroup("Timer"); 303 cfg.setGroup("Timer");
304 timerDelay= cfg.readNumEntry("Delay",0); 304 timerDelay= cfg.readNumEntry("Delay",0);
305 if(timerDelay > 0) 305 if(timerDelay > 0)
306 startTimer(timerDelay*60000); 306 startTimer(timerDelay*60000);
307 // qDebug("timer set for %d",(timerDelay*60000)/60000); 307 // odebug << "timer set for " << (timerDelay*60000)/60000 << "" << oendl;
308 wasError = false; 308 wasError = false;
309 309
310 // Sock->close(); 310 // Sock->close();
311 } 311 }
312 312
313 void StockTickerPluginWidget::socketError(int errcode) { 313 void StockTickerPluginWidget::socketError(int errcode) {
314 switch(errcode) { 314 switch(errcode) {
315 case QSocket::ErrConnectionRefused: 315 case QSocket::ErrConnectionRefused:
316 output = tr("Connection refused."); 316 output = tr("Connection refused.");
317 break; 317 break;
318 case QSocket::ErrHostNotFound: 318 case QSocket::ErrHostNotFound:
319 output = tr("Could not find server."); 319 output = tr("Could not find server.");