diff --git a/mainwindow.cpp b/mainwindow.cpp
index b3f89946b32fb590f3b516a4f3141907c1f42b70..6e34655c543150cbe6b95a6f58b3994659668ea2 100644 (file)
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
MainWindow::MainWindow(QWidget *parent) :\r
QWidget(parent)\r
{\r
+\r
+ QString http_proxy = QString::fromLatin1(qgetenv("qt_http_proxy"));\r
+\r
// the MainWindow provides the container for the ThermostatWidget, WeatherWidget, and OptionsWidget\r
// it is also provides much of the interface between WebData and the widgets that require web updates\r
// it is set to initial hard-coded values first, and only updated from the web if internet options\r
//get a handle to the global settings singleton\r
m_globalSettings = GlobalSettings::getInstance();\r
\r
+ // Initialize the proxy setting from http_proxy if defined\r
+ if(!http_proxy.isEmpty())\r
+ {\r
+ QUrl url(http_proxy);\r
+ m_globalSettings->setProxyInfo(url.host(), url.port());\r
+ }\r
+\r
// sets initial weather background\r
setStyleSheet("mainwindow {border-image: url(:/Images/background-sunny-very-few-clouds.JPG)}");\r
\r
setBackground(weatherData->icon(), weatherData->localTime().time());\r
\r
//now iterate through the forecast days and do the same thing\r
- QList<ForecastData* >::iterator i;\r
- for(i=weatherData->forecastData().begin();i!=weatherData->forecastData().end();i++)\r
+ int i;\r
+ for(i = 0; i < weatherData->forecastData().size(); i++)\r
{\r
+ ForecastData* forecast = weatherData->forecastData().at(i);\r
\r
- (*i)->setLowTemp(75+(qrand()%10*qrand()%2*(-1)));\r
- (*i)->setHighTemp((*i)->lowTemp()+qrand()%10);\r
- (*i)->setIcon(icons[qrand()%icons.size()]);\r
+ forecast->setLowTemp(75+(qrand()%10*qrand()%2*(-1)));\r
+ forecast->setHighTemp(forecast->lowTemp()+qrand()%10);\r
+ forecast->setIcon(icons[qrand()%icons.size()]);\r
}\r
\r
//set the data just to trigger an update of the widgets\r