summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index 0d90d0f..5ddf03c 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -35,30 +35,32 @@
extern "C" {
#include "libstocks/stocks.h"
}
#include <pthread.h>
#include "stocktickerpluginwidget.h"
QString output;
OTicker *stocktickerTicker;
-void getStocks( const QString *blah) {
+void getStocks( const char *blah) {
// stocktickerTicker->setText( "Downloading stock data.");
stock *stocks_quotes=NULL;
stock *stocks_tmp;
- qDebug("%s", blah->latin1());
+ char *stock_liste = blah;
+ // char *stock_liste = (char *)blah->latin1();
+ qDebug("%s", stock_liste );
QString tempString;
output = "";
libstocks_return_code error;
Config cfg( "stockticker");
cfg.setGroup( "Fields" );
bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck;
bool docurrentPriceCheck, dolastPriceCheck, doopenPriceCheck;
bool dominPriceCheck, domaxPriceCheck, dovariationCheck, dovolumeCheck;
dotimeCheck=dodateCheck=dosymbolCheck=donameCheck= docurrentPriceCheck=dolastPriceCheck=doopenPriceCheck=dominPriceCheck=domaxPriceCheck=dovariationCheck=dovolumeCheck=false;
@@ -87,25 +89,24 @@ void getStocks( const QString *blah) {
/* 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);
}
}
}
- char *stock_liste = (char *)blah->latin1();
// char *stock_liste = (char *)blah;
/* Get the stocks and process errors */
error = get_stocks( stock_liste, &stocks_quotes);
if (error) {
printf("Error in getting stocks (%d)\n", error);
tempString.sprintf("Error in getting stocks (%d)\n", error);
output =tempString;
return;
// exit(1);
}
@@ -242,25 +243,26 @@ void StockTickerPluginWidget::doStocks() {
Config cfg( "stockticker");
cfg.setGroup( "Symbols" );
symbollist="";
symbollist = cfg.readEntry("Symbols", "");
symbollist.replace(QRegExp(" "),"+");//seperated by +
cfg.setGroup("Timer");
stocktickerTicker->setUpdateTime( cfg.readNumEntry("ScrollSpeed",50));
stocktickerTicker->setScrollLength( cfg.readNumEntry("ScrollLength",10));
if (!symbollist.isEmpty()) {
pthread_t thread1;
- pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, &symbollist);
+ char *blah = symbollist.latin1();
+ pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, blah);
}
}
void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
killTimer(e->timerId());
checkConnection();
}
void StockTickerPluginWidget::checkConnection() {
// qDebug("checking connection");
// Sock = new QSocket( this );