-rw-r--r-- | noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp index 2f35f7f..18c9e51 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp | |||
@@ -217,75 +217,54 @@ void getStocks( const QString *blah) { | |||
217 | } | 217 | } |
218 | 218 | ||
219 | StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char* name) | 219 | StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char* name) |
220 | : QWidget(parent, name ) { | 220 | : QWidget(parent, name ) { |
221 | init(); | 221 | init(); |
222 | startTimer(1000); | 222 | startTimer(1000); |
223 | // checkConnection(); | 223 | // checkConnection(); |
224 | } | 224 | } |
225 | 225 | ||
226 | StockTickerPluginWidget::~StockTickerPluginWidget() { | 226 | StockTickerPluginWidget::~StockTickerPluginWidget() { |
227 | } | 227 | } |
228 | 228 | ||
229 | void StockTickerPluginWidget::init() { | 229 | void StockTickerPluginWidget::init() { |
230 | 230 | ||
231 | QHBoxLayout* layout = new QHBoxLayout( this ); | 231 | QHBoxLayout* layout = new QHBoxLayout( this ); |
232 | stocktickerTicker = new OTicker(this); | 232 | stocktickerTicker = new OTicker(this); |
233 | stocktickerTicker->setMinimumHeight(15); | 233 | // stocktickerTicker->setMinimumHeight(15); |
234 | connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( checkConnection() )); | 234 | connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( checkConnection() )); |
235 | layout->addWidget( stocktickerTicker); | 235 | layout->addWidget( stocktickerTicker); |
236 | wasError = true; | 236 | wasError = true; |
237 | } | 237 | } |
238 | 238 | ||
239 | void StockTickerPluginWidget::doStocks() { | 239 | void StockTickerPluginWidget::doStocks() { |
240 | Config cfg( "stockticker"); | 240 | Config cfg( "stockticker"); |
241 | cfg.setGroup( "Symbols" ); | 241 | cfg.setGroup( "Symbols" ); |
242 | symbollist=""; | 242 | symbollist=""; |
243 | symbollist = cfg.readEntry("Symbols", ""); | 243 | symbollist = cfg.readEntry("Symbols", ""); |
244 | symbollist.replace(QRegExp(" "),"+");//seperated by + | 244 | symbollist.replace(QRegExp(" "),"+");//seperated by + |
245 | 245 | ||
246 | // qDebug(symbollist); | 246 | // qDebug(symbollist); |
247 | if (!symbollist.isEmpty()) { | 247 | if (!symbollist.isEmpty()) { |
248 | pthread_t thread1; | 248 | pthread_t thread1; |
249 | pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, &symbollist); | 249 | pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, &symbollist); |
250 | } | 250 | } |
251 | // pthread_join(thread1,NULL); | 251 | // pthread_join(thread1,NULL); |
252 | // getStocks( symbollist.latin1() ); | 252 | // getStocks( symbollist.latin1() ); |
253 | } | 253 | } |
254 | 254 | ||
255 | //void StockTickerPluginWidget::DefProxy(void) { | ||
256 | // char *proxy; | ||
257 | // libstocks_return_code error; | ||
258 | |||
259 | // /* Proxy support */ | ||
260 | // /* Checks for "http_proxy" environment variable */ | ||
261 | // proxy = getenv("http_proxy"); | ||
262 | // if(proxy) { | ||
263 | // /* printf("proxy set\n"); */ | ||
264 | // error = set_proxy(proxy); | ||
265 | // if (error) { | ||
266 | // // printf("Proxy error (%d)\n", error); | ||
267 | // QString tempString; | ||
268 | // tempString.sprintf("Proxy error (%d)\n", error); | ||
269 | // output = tempString; | ||
270 | // return; | ||
271 | // // exit(1); | ||
272 | // } | ||
273 | // } | ||
274 | //} | ||
275 | |||
276 | void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { | 255 | void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { |
277 | killTimer(e->timerId()); | 256 | killTimer(e->timerId()); |
278 | checkConnection(); | 257 | checkConnection(); |
279 | } | 258 | } |
280 | 259 | ||
281 | void StockTickerPluginWidget::checkConnection() { | 260 | void StockTickerPluginWidget::checkConnection() { |
282 | // qDebug("checking connection"); | 261 | // qDebug("checking connection"); |
283 | // Sock = new QSocket( this ); | 262 | // Sock = new QSocket( this ); |
284 | 263 | ||
285 | // if( wasError) | 264 | // if( wasError) |
286 | // stocktickerTicker->setText("Checking connection"); | 265 | // stocktickerTicker->setText("Checking connection"); |
287 | 266 | ||
288 | // if(Sock->state() == QSocket::Idle) { | 267 | // if(Sock->state() == QSocket::Idle) { |
289 | // Sock->connectToHost("finance.yahoo.com", 80); | 268 | // Sock->connectToHost("finance.yahoo.com", 80); |
290 | // connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) ); | 269 | // connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) ); |
291 | // connect( Sock, SIGNAL( hostFound() ), SLOT(isConnected()) ); | 270 | // connect( Sock, SIGNAL( hostFound() ), SLOT(isConnected()) ); |