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
b5d01e0d
Commit
b5d01e0d
authored
6 years ago
by
Gigg, Martyn Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Fix static analysis and formatting
Refs #0
parent
f27b0dda
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MantidPlot/src/Process.cpp
+8
-12
8 additions, 12 deletions
MantidPlot/src/Process.cpp
MantidPlot/src/ProjectRecovery.cpp
+2
-1
2 additions, 1 deletion
MantidPlot/src/ProjectRecovery.cpp
with
10 additions
and
13 deletions
MantidPlot/src/Process.cpp
+
8
−
12
View file @
b5d01e0d
...
...
@@ -12,20 +12,18 @@ namespace {
class
PyObjectNewReference
{
public:
PyObjectNewReference
(
PyObject
*
object
)
:
m_object
(
object
)
{}
explicit
PyObjectNewReference
(
PyObject
*
object
)
:
m_object
(
object
)
{}
~
PyObjectNewReference
()
{
Py_XDECREF
(
m_object
);
}
PyObjectNewReference
(
const
PyObjectNewReference
&
)
=
delete
;
PyObjectNewReference
&
operator
=
(
const
PyObjectNewReference
&
)
=
delete
;
PyObjectNewReference
(
PyObjectNewReference
&&
o
)
{
*
this
=
std
::
move
(
o
);
}
PyObjectNewReference
(
PyObjectNewReference
&&
o
)
{
*
this
=
std
::
move
(
o
);
}
PyObjectNewReference
&
operator
=
(
PyObjectNewReference
&&
other
)
{
this
->
m_object
=
other
.
m_object
;
other
.
m_object
=
nullptr
;
return
*
this
;
this
->
m_object
=
other
.
m_object
;
other
.
m_object
=
nullptr
;
return
*
this
;
}
inline
PyObject
*
ptr
()
const
{
return
m_object
;
}
...
...
@@ -46,7 +44,7 @@ PyObjectNewReference attr(PyObject *source, const char *name) {
if
(
attr
.
ptr
())
{
return
attr
;
}
else
{
PyErr_Print
();
PyErr_Print
();
throw
std
::
runtime_error
(
std
::
string
(
"Process: No attribute "
)
+
name
+
" found"
);
}
...
...
@@ -65,7 +63,7 @@ PyObjectNewReference call(PyObject *source, const char *name) {
if
(
result
)
return
PyObjectNewReference
(
result
);
else
{
PyErr_Print
();
PyErr_Print
();
throw
std
::
runtime_error
(
std
::
string
(
"Process: Error calling function "
)
+
name
);
}
...
...
@@ -92,9 +90,7 @@ namespace Process {
* @return True if another instance is running
* @throws std::runtime_error if the PID list cannot be determined
*/
bool
isAnotherInstanceRunning
()
{
return
!
otherInstancePIDs
().
empty
();
}
bool
isAnotherInstanceRunning
()
{
return
!
otherInstancePIDs
().
empty
();
}
/**
* @brief Return a list of process IDs for other instances of this process.
...
...
This diff is collapsed.
Click to expand it.
MantidPlot/src/ProjectRecovery.cpp
+
2
−
1
View file @
b5d01e0d
...
...
@@ -64,7 +64,8 @@ boost::optional<bool> getConfigBool(const std::string &key) {
/// Returns a string to the current top level recovery folder
std
::
string
getRecoveryFolder
()
{
static
std
::
string
appData
=
Mantid
::
Kernel
::
ConfigService
::
Instance
().
getAppDataDir
();
static
std
::
string
appData
=
Mantid
::
Kernel
::
ConfigService
::
Instance
().
getAppDataDir
();
static
std
::
string
hostname
=
Poco
::
Environment
::
nodeName
();
static
std
::
string
recoverFolder
=
appData
+
"/recovery/"
+
hostname
+
'/'
;
...
...
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