-rw-r--r-- | noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp index 5ddf03c..a740b58 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp @@ -39,24 +39,25 @@ extern "C" { #include <pthread.h> #include "stocktickerpluginwidget.h" QString output; OTicker *stocktickerTicker; -void getStocks( const char *blah) { +void getStocks(char *blah) { // stocktickerTicker->setText( "Downloading stock data."); stock *stocks_quotes=NULL; stock *stocks_tmp; - char *stock_liste = blah; + QCString stock_liste = blah; + ::free ( blah ); // char *stock_liste = (char *)blah->latin1(); - qDebug("%s", stock_liste ); + qDebug("%s", stock_liste.data() ); QString tempString; output = ""; libstocks_return_code error; Config cfg( "stockticker"); cfg.setGroup( "Fields" ); bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck; @@ -95,17 +96,17 @@ void getStocks( const char *blah) { output = tempString; return; // exit(1); } } } // char *stock_liste = (char *)blah; /* Get the stocks and process errors */ - error = get_stocks( stock_liste, &stocks_quotes); + error = get_stocks( stock_liste.data(), &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); } @@ -247,18 +248,18 @@ void StockTickerPluginWidget::doStocks() { 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; - char *blah = symbollist.latin1(); - pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, blah); + char *blah = ::strdup(symbollist.latin1()); + pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, (void *) blah); } } void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { killTimer(e->timerId()); checkConnection(); } |