StelApp.cpp   StelApp.cpp 
skipping to change at line 17 skipping to change at line 17
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelLoadingBar.hpp" #include "StelLoadingBar.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
skipping to change at line 161 skipping to change at line 161
httpProxyEnv = std::getenv("http_proxy"); httpProxyEnv = std::getenv("http_proxy");
if (!httpProxyEnv) if (!httpProxyEnv)
{ {
httpProxyEnv = std::getenv("HTTP_PROXY"); httpProxyEnv = std::getenv("HTTP_PROXY");
} }
if (httpProxyEnv) if (httpProxyEnv)
{ {
QString proxyString = QString(httpProxyEnv); QString proxyString = QString(httpProxyEnv);
if (!proxyString.isEmpty()) if (!proxyString.isEmpty())
{ {
// Regular expressions with multiple optiona // Handle http_proxy of the form
l sub-expressions are so unreadable --MNG // proto://username:password@fqdn:port
QRegExp pre("^http://((([^:]+):([^@]+))@)?([ // e.g.:
^:]+)(:(\\d+))?"); // http://usr:pass@proxy.loc:3128/
if (pre.exactMatch(proxyString)) // http://proxy.loc:3128/
// http://2001:62a:4:203:6ab5:99ff:fef2:560b
:3128/
// http://foo:bar@2001:62a:4:203:6ab5:99ff:f
ef2:560b:3128/
QRegExp pre("^([^:]+://)?(?:([^:]+):([^@]*)@
)?(.+):([\\d]+)");
if (pre.indexIn(proxyString) >= 0)
{ {
proxyUser = pre.capturedTexts().at(3 proxyUser = pre.cap(2);
); proxyPass = pre.cap(3);
proxyPass = pre.capturedTexts().at(4 proxyHost = pre.cap(4);
); proxyPort = pre.cap(5);
proxyHost = pre.capturedTexts().at(5
);
proxyPort = pre.capturedTexts().at(7
);
} }
else else
{ {
qDebug() << "indecipherable environm ent variable http_proxy:" << proxyString; qDebug() << "indecipherable environm ent variable http_proxy:" << proxyString;
return; return;
} }
} }
} }
} }
skipping to change at line 194 skipping to change at line 200
if (!proxyPort.isEmpty()) if (!proxyPort.isEmpty())
proxy.setPort(proxyPort.toUShort()); proxy.setPort(proxyPort.toUShort());
if (!proxyUser.isEmpty()) if (!proxyUser.isEmpty())
proxy.setUser(proxyUser); proxy.setUser(proxyUser);
if (!proxyPass.isEmpty()) if (!proxyPass.isEmpty())
proxy.setPassword(proxyPass); proxy.setPassword(proxyPass);
QString ppDisp = proxyPass; QString ppDisp = proxyPass;
ppDisp.replace(QRegExp("."), "x"); ppDisp.fill('*');
qDebug() << "Using HTTP proxy:" << proxyUser << ppDisp << pr oxyHost << proxyPort; qDebug() << "Using HTTP proxy:" << proxyUser << ppDisp << pr oxyHost << proxyPort;
QNetworkProxy::setApplicationProxy(proxy); QNetworkProxy::setApplicationProxy(proxy);
} }
} }
void StelApp::init(QSettings* conf) void StelApp::init(QSettings* conf)
{ {
confSettings = conf; confSettings = conf;
core = new StelCore(); core = new StelCore();
 End of changes. 4 change blocks. 
15 lines changed or deleted 18 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/