Rockbox Utility: fix proxy password getting lost (FS#12166).

The proxy settings are stored as string representation in the configuration
file. If username / password contains characters used as separators parsing the
string again will cause wrong results. Percent-encode them before storing, and
parse it as percent-encoded string when reading it back.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30071 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2011-06-25 17:21:06 +00:00
parent dfd4183a7d
commit a3875d7dfe
2 changed files with 16 additions and 5 deletions

View file

@ -1240,11 +1240,13 @@ void RbUtilQt::updateInfo()
QUrl RbUtilQt::proxy()
{
QUrl proxy;
if(RbSettings::value(RbSettings::ProxyType) == "manual")
return QUrl(RbSettings::value(RbSettings::Proxy).toString());
proxy.setEncodedUrl(RbSettings::value(RbSettings::Proxy).toByteArray());
else if(RbSettings::value(RbSettings::ProxyType) == "system")
return System::systemProxy();
return QUrl("");
proxy = System::systemProxy();
qDebug() << proxy.userName() << proxy.password() << proxy.host() << proxy.port();
return proxy;
}