Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
4decc569
Commit
4decc569
authored
10 years ago
by
Peterson, Peter
Browse files
Options
Downloads
Patches
Plain Diff
Refs #10558. Windoze threw an exception during execution.
parent
1cb9c706
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/Kernel/src/ConfigService.cpp
+17
-9
17 additions, 9 deletions
Code/Mantid/Framework/Kernel/src/ConfigService.cpp
with
17 additions
and
9 deletions
Code/Mantid/Framework/Kernel/src/ConfigService.cpp
+
17
−
9
View file @
4decc569
...
...
@@ -1243,20 +1243,28 @@ std::string ConfigServiceImpl::getOSVersion()
/// @returns The name of the current user as reported by the environment.
std
::
string
ConfigServiceImpl
::
getUsername
()
{
std
::
string
username
;
// mac and favorite way to get username on linux
std
::
string
username
=
m_pSysConfig
->
getString
(
"system.env.USER"
);
if
(
!
username
.
empty
())
{
return
username
;
try
{
username
=
m_pSysConfig
->
getString
(
"system.env.USER"
);
if
(
!
username
.
empty
())
{
return
username
;
}
}
catch
(
Poco
::
NotFoundException
&
e
)
{
UNUSED_ARG
(
e
);
// let it drop on the floor
}
// windoze and alternate linux username variable
username
=
m_pSysConfig
->
getString
(
"system.env.USERNAME"
);
if
(
!
username
.
empty
())
{
return
username
;
try
{
username
=
m_pSysConfig
->
getString
(
"system.env.USERNAME"
);
if
(
!
username
.
empty
())
{
return
username
;
}
}
username
=
m_pSysConfig
->
getString
(
"system.env.username"
);
if
(
!
username
.
empty
())
{
return
username
;
catch
(
Poco
::
NotFoundException
&
e
)
{
UNUSED_ARG
(
e
);
// let it drop on the floor
}
// give up and return an empty string
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment