summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index 45c5c53..2f35f7f 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -194,98 +194,97 @@ void getStocks( const QString *blah) {
// printf("| Var | %-6.2f (%5.2f %%) |\n", stocks_tmp->Variation, stocks_tmp->Pourcentage);
tempString.sprintf("| Var %-6.2f (%5.2f %%) ", stocks_tmp->Variation, stocks_tmp->Pourcentage);
if(dovariationCheck)
output +=tempString;
// printf("| Volume | %-9d |\n", stocks_tmp->Volume);
tempString.sprintf("| Volume %-9d ", stocks_tmp->Volume);
if(dovolumeCheck)
output +=tempString;
// printf("----------------------------------------\n\n");
tempString.sprintf("||==++==|");
output +=tempString;
/* Simple function which help to browse in the stocks list */
stocks_tmp = next_stock(stocks_tmp);
}
/* frees stocks */
free_stocks(stocks_quotes);
stocktickerTicker->setText( output );
}
StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char* name)
: QWidget(parent, name ) {
init();
startTimer(1000);
// checkConnection();
}
StockTickerPluginWidget::~StockTickerPluginWidget() {
}
void StockTickerPluginWidget::init() {
QHBoxLayout* layout = new QHBoxLayout( this );
stocktickerTicker = new OTicker(this);
stocktickerTicker->setMinimumHeight(15);
connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( checkConnection() ));
layout->addWidget( stocktickerTicker);
wasError = true;
}
void StockTickerPluginWidget::doStocks() {
Config cfg( "stockticker");
cfg.setGroup( "Symbols" );
- QString symbollist;
- symbollist = cfg.readEntry("Symbols", "");
+ symbollist="";
symbollist = cfg.readEntry("Symbols", "");
symbollist.replace(QRegExp(" "),"+");//seperated by +
// qDebug(symbollist);
if (!symbollist.isEmpty()) {
pthread_t thread1;
pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, &symbollist);
}
// pthread_join(thread1,NULL);
// getStocks( symbollist.latin1() );
}
//void StockTickerPluginWidget::DefProxy(void) {
// char *proxy;
// libstocks_return_code error;
// /* Proxy support */
// /* Checks for "http_proxy" environment variable */
// proxy = getenv("http_proxy");
// if(proxy) {
// /* 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);
// }
// }
//}
void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
killTimer(e->timerId());
checkConnection();
}
void StockTickerPluginWidget::checkConnection() {
// qDebug("checking connection");
// Sock = new QSocket( this );
// if( wasError)
// stocktickerTicker->setText("Checking connection");
// if(Sock->state() == QSocket::Idle) {
// Sock->connectToHost("finance.yahoo.com", 80);
// connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) );