summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-11-01 17:09:20 (UTC)
committer llornkcor <llornkcor>2002-11-01 17:09:20 (UTC)
commit47d6a3119a7b46d25ce35fb2abda9c2bf3fa3f69 (patch) (unidiff)
tree5218237e5668bac0e6c60f098f40d24e1784594d
parent800932401b86a43cd52f9cbc2833b2795d1c955b (diff)
downloadopie-47d6a3119a7b46d25ce35fb2abda9c2bf3fa3f69.zip
opie-47d6a3119a7b46d25ce35fb2abda9c2bf3fa3f69.tar.gz
opie-47d6a3119a7b46d25ce35fb2abda9c2bf3fa3f69.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index e178338..cc1bbbb 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -155,101 +155,102 @@ void StockTickerPluginWidget::getStocks( const char *blah) {
155 if(dosymbolCheck) 155 if(dosymbolCheck)
156 output +=tempString; 156 output +=tempString;
157 } 157 }
158 158
159 if (stocks_tmp->Name) { 159 if (stocks_tmp->Name) {
160 if ( strlen(stocks_tmp->Name) > 20 ) { 160 if ( strlen(stocks_tmp->Name) > 20 ) {
161// printf("| Name %.20s |\n",stocks_tmp->Name); 161// printf("| Name %.20s |\n",stocks_tmp->Name);
162 tempString.sprintf("| Name %s ",stocks_tmp->Name); 162 tempString.sprintf("| Name %s ",stocks_tmp->Name);
163 tempString.stripWhiteSpace(); 163 tempString.stripWhiteSpace();
164 if(donameCheck) 164 if(donameCheck)
165 output +=tempString; 165 output +=tempString;
166 } else { 166 } else {
167// printf("| Name | %-20s |\n",stocks_tmp->Name); 167// printf("| Name | %-20s |\n",stocks_tmp->Name);
168 tempString.sprintf("| Name %s ",stocks_tmp->Name); 168 tempString.sprintf("| Name %s ",stocks_tmp->Name);
169 tempString.stripWhiteSpace(); 169 tempString.stripWhiteSpace();
170 if(donameCheck) 170 if(donameCheck)
171 output +=tempString; 171 output +=tempString;
172 } 172 }
173 } 173 }
174 else { 174 else {
175// printf("| Name | |\n"); 175// printf("| Name | |\n");
176 tempString.sprintf("| Name | |"); 176 tempString.sprintf("| Name | |");
177 if(donameCheck) 177 if(donameCheck)
178 output +=tempString; 178 output +=tempString;
179 } 179 }
180 180
181// printf("| Price | %-7.2f |\n", stocks_tmp->CurrentPrice); 181// printf("| Price | %-7.2f |\n", stocks_tmp->CurrentPrice);
182 tempString.sprintf("| Price %-7.2f ", stocks_tmp->CurrentPrice); 182 tempString.sprintf("| Price %-7.2f ", stocks_tmp->CurrentPrice);
183 if(docurrentPriceCheck) 183 if(docurrentPriceCheck)
184 output +=tempString; 184 output +=tempString;
185 185
186// printf("| Yesterday | %-7.2f |\n",stocks_tmp->LastPrice); 186// printf("| Yesterday | %-7.2f |\n",stocks_tmp->LastPrice);
187 tempString.sprintf("| Yesterday %-7.2f ",stocks_tmp->LastPrice); 187 tempString.sprintf("| Yesterday %-7.2f ",stocks_tmp->LastPrice);
188 if(dolastPriceCheck) 188 if(dolastPriceCheck)
189 output +=tempString; 189 output +=tempString;
190 190
191// printf("| Open | %-7.2f |\n",stocks_tmp->OpenPrice); 191// printf("| Open | %-7.2f |\n",stocks_tmp->OpenPrice);
192 tempString.sprintf("| Open %-7.2f ",stocks_tmp->OpenPrice); 192 tempString.sprintf("| Open %-7.2f ",stocks_tmp->OpenPrice);
193 if(doopenPriceCheck) 193 if(doopenPriceCheck)
194 output +=tempString; 194 output +=tempString;
195 195
196// printf("| Min | %-7.2f |\n", stocks_tmp->MinPrice); 196// printf("| Min | %-7.2f |\n", stocks_tmp->MinPrice);
197 tempString.sprintf("| Min %-7.2f ", stocks_tmp->MinPrice); 197 tempString.sprintf("| Min %-7.2f ", stocks_tmp->MinPrice);
198 if(dominPriceCheck) 198 if(dominPriceCheck)
199 output +=tempString; 199 output +=tempString;
200 200
201// printf("| Max | %-7.2f |\n",stocks_tmp->MaxPrice); 201// printf("| Max | %-7.2f |\n",stocks_tmp->MaxPrice);
202 tempString.sprintf("| Max %-7.2f ",stocks_tmp->MaxPrice); 202 tempString.sprintf("| Max %-7.2f ",stocks_tmp->MaxPrice);
203 if(domaxPriceCheck) 203 if(domaxPriceCheck)
204 output +=tempString; 204 output +=tempString;
205 205
206// printf("| Var | %-6.2f (%5.2f %%) |\n", stocks_tmp->Variation, stocks_tmp->Pourcentage); 206// printf("| Var | %-6.2f (%5.2f %%) |\n", stocks_tmp->Variation, stocks_tmp->Pourcentage);
207 tempString.sprintf("| Var %-6.2f (%5.2f %%) ", stocks_tmp->Variation, stocks_tmp->Pourcentage); 207 tempString.sprintf("| Var %-6.2f (%5.2f %%) ", stocks_tmp->Variation, stocks_tmp->Pourcentage);
208 if(dovariationCheck) 208 if(dovariationCheck)
209 output +=tempString; 209 output +=tempString;
210 210
211// printf("| Volume | %-9d |\n", stocks_tmp->Volume); 211// printf("| Volume | %-9d |\n", stocks_tmp->Volume);
212 tempString.sprintf("| Volume %-9d ", stocks_tmp->Volume); 212 tempString.sprintf("| Volume %-9d ", stocks_tmp->Volume);
213 if(dovolumeCheck) 213 if(dovolumeCheck)
214 output +=tempString; 214 output +=tempString;
215 215
216// printf("----------------------------------------\n\n"); 216// printf("----------------------------------------\n\n");
217 tempString.sprintf("||==++==|"); 217 tempString.sprintf("||==++==|");
218 output +=tempString; 218 output +=tempString;
219 219
220 /* Simple function which help to browse in the stocks list */ 220 /* Simple function which help to browse in the stocks list */
221 stocks_tmp = next_stock(stocks_tmp); 221 stocks_tmp = next_stock(stocks_tmp);
222 } 222 }
223 223
224 /* frees stocks */ 224 /* frees stocks */
225 free_stocks(stocks_quotes); 225 free_stocks(stocks_quotes);
226 226
227} 227}
228 228
229void StockTickerPluginWidget::DefProxy(void) { 229void StockTickerPluginWidget::DefProxy(void) {
230 char *proxy; 230 char *proxy;
231 libstocks_return_code error; 231 libstocks_return_code error;
232 232
233 /* Proxy support */ 233 /* Proxy support */
234 /* Checks for "http_proxy" environment variable */ 234 /* Checks for "http_proxy" environment variable */
235 proxy = getenv("http_proxy"); 235 proxy = getenv("http_proxy");
236 if(proxy) { 236 if(proxy) {
237 /* printf("proxy set\n"); */ 237 /* printf("proxy set\n"); */
238 error = set_proxy(proxy); 238 error = set_proxy(proxy);
239 if (error) { 239 if (error) {
240// printf("Proxy error (%d)\n", error); 240// printf("Proxy error (%d)\n", error);
241 QString tempString; 241 QString tempString;
242 tempString.sprintf("Proxy error (%d)\n", error); 242 tempString.sprintf("Proxy error (%d)\n", error);
243 output = tempString; 243 output = tempString;
244 return; 244 return;
245// exit(1); 245// exit(1);
246 } 246 }
247 } 247 }
248} 248}
249 249
250void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { 250void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
251 qDebug("timer");
251 killTimer(e->timerId()); 252 killTimer(e->timerId());
252 doStocks(); 253 doStocks();
253 if(timerDelay > 0) 254 if(timerDelay > 0)
254 startTimer(timerDelay*1000); 255 startTimer(timerDelay*60000);
255} 256}