summaryrefslogtreecommitdiff
authorsandman <sandman>2002-12-18 18:59:05 (UTC)
committer sandman <sandman>2002-12-18 18:59:05 (UTC)
commit7f98b97ff4b112ddc7025b34649a4ed331b37548 (patch) (side-by-side diff)
tree8deb6016e20ad84b99b5bf2a65cbac332e4b9e1c
parent25dfde78e47780c3357f8e25d8c873131fbf446d (diff)
downloadopie-7f98b97ff4b112ddc7025b34649a4ed331b37548.zip
opie-7f98b97ff4b112ddc7025b34649a4ed331b37548.tar.gz
opie-7f98b97ff4b112ddc7025b34649a4ed331b37548.tar.bz2
Parameter passing to the thread reworked a bit
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp13
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
@@ -43,16 +43,17 @@ extern "C" {
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;
@@ -99,9 +100,9 @@ void getStocks( const char *blah) {
}
}
// 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);
@@ -251,10 +252,10 @@ void StockTickerPluginWidget::doStocks() {
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 ) {