From 042a357278411b7c5c2ee91fd0f3089080499d3d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 5 Oct 2017 15:59:26 +0100 Subject: [PATCH] Fixed spacing to make it consistent with the rest of the OSG and make it easier to read. --- src/osgPlugins/vnc/ReaderWriterVNC.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/vnc/ReaderWriterVNC.cpp b/src/osgPlugins/vnc/ReaderWriterVNC.cpp index 926ab930e..ce68fd688 100644 --- a/src/osgPlugins/vnc/ReaderWriterVNC.cpp +++ b/src/osgPlugins/vnc/ReaderWriterVNC.cpp @@ -397,14 +397,19 @@ class ReaderWriterVNC : public osgDB::ReaderWriter const osgDB::AuthenticationMap* authenticationMap = (options && options->getAuthenticationMap()) ? options->getAuthenticationMap() : osgDB::Registry::instance()->getAuthenticationMap(); - if (authenticationMap != NULL) { + + if (authenticationMap != NULL) + { const osgDB::AuthenticationDetails* details = authenticationMap->getAuthenticationDetails(hostname); - if (details == NULL) { + if (details == NULL) + { size_t pos = hostname.find(":"); - if (pos != std::string::npos) { + if (pos != std::string::npos) + { details = authenticationMap->getAuthenticationDetails(hostname.substr(0, pos)); } } + // configure authentication if required. if (details != NULL) { @@ -414,6 +419,7 @@ class ReaderWriterVNC : public osgDB::ReaderWriter image->_password = details->password; } } + if (options && !options->getOptionString().empty()) { image->_optionString = options->getOptionString();