Added support for multiple --login url username password entries to osgviewer
This commit is contained in:
parent
d75564c7e3
commit
ddf8c68d26
@ -74,14 +74,10 @@ int main(int argc, char** argv)
|
||||
std::string url, username, password;
|
||||
while(arguments.read("--login",url, username, password))
|
||||
{
|
||||
if (!osgDB::Registry::instance()->getAuthenticationMap())
|
||||
{
|
||||
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
|
||||
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
|
||||
url,
|
||||
new osgDB::AuthenticationDetails(username, password)
|
||||
);
|
||||
}
|
||||
osgDB::Registry::instance()->getOrCreateAuthenticationMap()->addAuthenticationDetails(
|
||||
url,
|
||||
new osgDB::AuthenticationDetails(username, password)
|
||||
);
|
||||
}
|
||||
|
||||
std::string device;
|
||||
|
@ -366,6 +366,13 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
/** Set the password map to be used by plugins when access files from secure locations.*/
|
||||
void setAuthenticationMap(AuthenticationMap* authenticationMap) { _authenticationMap = authenticationMap; }
|
||||
|
||||
/** Get the password map to be used by plugins when access files from secure locations. Create a AuthenticationMap if one isn't already assigned.*/
|
||||
AuthenticationMap* getOrCreateAuthenticationMap()
|
||||
{
|
||||
if (!_authenticationMap) _authenticationMap = new AuthenticationMap;
|
||||
return _authenticationMap.get();
|
||||
}
|
||||
|
||||
/** Get the password map to be used by plugins when access files from secure locations.*/
|
||||
AuthenticationMap* getAuthenticationMap() { return _authenticationMap.get(); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user