summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index 6d53a91..aabb4d2 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -146,101 +146,101 @@ void StockTickerPluginWidget::getStocks( const char *blah) {
146// printf("| Symbol | %-20s |\n",stocks_tmp->Symbol); 146// printf("| Symbol | %-20s |\n",stocks_tmp->Symbol);
147 tempString.sprintf("| Symbol %s ",stocks_tmp->Symbol); 147 tempString.sprintf("| Symbol %s ",stocks_tmp->Symbol);
148 if(dosymbolCheck) 148 if(dosymbolCheck)
149 output +=tempString; 149 output +=tempString;
150 } 150 }
151 151
152 if (stocks_tmp->Name) { 152 if (stocks_tmp->Name) {
153 if ( strlen(stocks_tmp->Name) > 20 ) { 153 if ( strlen(stocks_tmp->Name) > 20 ) {
154// printf("| Name %.20s |\n",stocks_tmp->Name); 154// printf("| Name %.20s |\n",stocks_tmp->Name);
155 tempString.sprintf("| Name %s ",stocks_tmp->Name); 155 tempString.sprintf("| Name %s ",stocks_tmp->Name);
156 tempString.stripWhiteSpace(); 156 tempString.stripWhiteSpace();
157 if(donameCheck) 157 if(donameCheck)
158 output +=tempString; 158 output +=tempString;
159 } else { 159 } else {
160// printf("| Name | %-20s |\n",stocks_tmp->Name); 160// printf("| Name | %-20s |\n",stocks_tmp->Name);
161 tempString.sprintf("| Name %s ",stocks_tmp->Name); 161 tempString.sprintf("| Name %s ",stocks_tmp->Name);
162 tempString.stripWhiteSpace(); 162 tempString.stripWhiteSpace();
163 if(donameCheck) 163 if(donameCheck)
164 output +=tempString; 164 output +=tempString;
165 } 165 }
166 } 166 }
167 else { 167 else {
168// printf("| Name | |\n"); 168// printf("| Name | |\n");
169 tempString.sprintf("| Name | |"); 169 tempString.sprintf("| Name | |");
170 if(donameCheck) 170 if(donameCheck)
171 output +=tempString; 171 output +=tempString;
172 } 172 }
173 173
174// printf("| Price | %-7.2f |\n", stocks_tmp->CurrentPrice); 174// printf("| Price | %-7.2f |\n", stocks_tmp->CurrentPrice);
175 tempString.sprintf("| Price %-7.2f ", stocks_tmp->CurrentPrice); 175 tempString.sprintf("| Price %-7.2f ", stocks_tmp->CurrentPrice);
176 if(docurrentPriceCheck) 176 if(docurrentPriceCheck)
177 output +=tempString; 177 output +=tempString;
178 178
179// printf("| Yesterday | %-7.2f |\n",stocks_tmp->LastPrice); 179// printf("| Yesterday | %-7.2f |\n",stocks_tmp->LastPrice);
180 tempString.sprintf("| Yesterday %-7.2f ",stocks_tmp->LastPrice); 180 tempString.sprintf("| Yesterday %-7.2f ",stocks_tmp->LastPrice);
181 if(dolastPriceCheck) 181 if(dolastPriceCheck)
182 output +=tempString; 182 output +=tempString;
183 183
184// printf("| Open | %-7.2f |\n",stocks_tmp->OpenPrice); 184// printf("| Open | %-7.2f |\n",stocks_tmp->OpenPrice);
185 tempString.sprintf("| Open %-7.2f ",stocks_tmp->OpenPrice); 185 tempString.sprintf("| Open %-7.2f ",stocks_tmp->OpenPrice);
186 if(doopenPriceCheck) 186 if(doopenPriceCheck)
187 output +=tempString; 187 output +=tempString;
188 188
189// printf("| Min | %-7.2f |\n", stocks_tmp->MinPrice); 189// printf("| Min | %-7.2f |\n", stocks_tmp->MinPrice);
190 tempString.sprintf("| Min %-7.2f ", stocks_tmp->MinPrice); 190 tempString.sprintf("| Min %-7.2f ", stocks_tmp->MinPrice);
191 if(dominPriceCheck) 191 if(dominPriceCheck)
192 output +=tempString; 192 output +=tempString;
193 193
194// printf("| Max | %-7.2f |\n",stocks_tmp->MaxPrice); 194// printf("| Max | %-7.2f |\n",stocks_tmp->MaxPrice);
195 tempString.sprintf("| Max %-7.2f ",stocks_tmp->MaxPrice); 195 tempString.sprintf("| Max %-7.2f ",stocks_tmp->MaxPrice);
196 if(domaxPriceCheck) 196 if(domaxPriceCheck)
197 output +=tempString; 197 output +=tempString;
198 198
199// printf("| Var | %-6.2f (%5.2f %%) |\n", stocks_tmp->Variation, stocks_tmp->Pourcentage); 199// printf("| Var | %-6.2f (%5.2f %%) |\n", stocks_tmp->Variation, stocks_tmp->Pourcentage);
200 tempString.sprintf("| Var %-6.2f (%5.2f %%) ", stocks_tmp->Variation, stocks_tmp->Pourcentage); 200 tempString.sprintf("| Var %-6.2f (%5.2f %%) ", stocks_tmp->Variation, stocks_tmp->Pourcentage);
201 if(dovariationCheck) 201 if(dovariationCheck)
202 output +=tempString; 202 output +=tempString;
203 203
204// printf("| Volume | %-9d |\n", stocks_tmp->Volume); 204// printf("| Volume | %-9d |\n", stocks_tmp->Volume);
205 tempString.sprintf("| Volume %-9d ", stocks_tmp->Volume); 205 tempString.sprintf("| Volume %-9d ", stocks_tmp->Volume);
206 if(dovolumeCheck) 206 if(dovolumeCheck)
207 output +=tempString; 207 output +=tempString;
208 208
209// printf("----------------------------------------\n\n"); 209// printf("----------------------------------------\n\n");
210 tempString.sprintf("||==++=="); 210 tempString.sprintf("||==++==|");
211 output +=tempString; 211 output +=tempString;
212 212
213 /* Simple function which help to browse in the stocks list */ 213 /* Simple function which help to browse in the stocks list */
214 stocks_tmp = next_stock(stocks_tmp); 214 stocks_tmp = next_stock(stocks_tmp);
215 } 215 }
216 216
217 /* frees stocks */ 217 /* frees stocks */
218 free_stocks(stocks_quotes); 218 free_stocks(stocks_quotes);
219 219
220} 220}
221 221
222void StockTickerPluginWidget::DefProxy(void) { 222void StockTickerPluginWidget::DefProxy(void) {
223 char *proxy; 223 char *proxy;
224 libstocks_return_code error; 224 libstocks_return_code error;
225 225
226 /* Proxy support */ 226 /* Proxy support */
227 /* Checks for "http_proxy" environment variable */ 227 /* Checks for "http_proxy" environment variable */
228 proxy = getenv("http_proxy"); 228 proxy = getenv("http_proxy");
229 if(proxy) { 229 if(proxy) {
230 /* printf("proxy set\n"); */ 230 /* printf("proxy set\n"); */
231 error = set_proxy(proxy); 231 error = set_proxy(proxy);
232 if (error) { 232 if (error) {
233// printf("Proxy error (%d)\n", error); 233// printf("Proxy error (%d)\n", error);
234 QString tempString; 234 QString tempString;
235 tempString.sprintf("Proxy error (%d)\n", error); 235 tempString.sprintf("Proxy error (%d)\n", error);
236 output = tempString; 236 output = tempString;
237 return; 237 return;
238// exit(1); 238// exit(1);
239 } 239 }
240 } 240 }
241} 241}
242 242
243void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { 243void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
244 killTimer(e->timerId()); 244 killTimer(e->timerId());
245 doStocks(); 245 doStocks();
246} 246}