Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
e84b4745
Commit
e84b4745
authored
Mar 25, 2019
by
Tom Titcombe
Browse files
Fix clang formatting
parent
c714c114
Changes
58
Hide whitespace changes
Inline
Side-by-side
qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.cpp
View file @
e84b4745
...
...
@@ -343,7 +343,7 @@ void EnggDiffFittingPresenter::processShutDown() {
void
EnggDiffFittingPresenter
::
processLogMsg
()
{
std
::
vector
<
std
::
string
>
msgs
=
m_view
->
logMsgs
();
for
(
const
auto
&
msg
:
msgs
)
{
for
(
const
auto
&
msg
:
msgs
)
{
g_log
.
information
()
<<
msg
<<
'\n'
;
}
}
...
...
qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.cpp
View file @
e84b4745
...
...
@@ -597,7 +597,7 @@ void EnggDiffractionPresenter::processRebinMultiperiod() {
void
EnggDiffractionPresenter
::
processLogMsg
()
{
std
::
vector
<
std
::
string
>
msgs
=
m_view
->
logMsgs
();
for
(
const
auto
&
msg
:
msgs
)
{
for
(
const
auto
&
msg
:
msgs
)
{
g_log
.
information
()
<<
msg
<<
'\n'
;
}
}
...
...
@@ -682,7 +682,7 @@ std::string EnggDiffractionPresenter::isValidRunNumber(
std
::
string
filename
=
inputDir
.
getFileName
();
// convert to int or assign it to size_t
for
(
char
&
i
:
filename
)
{
for
(
char
&
i
:
filename
)
{
char
*
str
=
&
i
;
if
(
std
::
isdigit
(
*
str
))
{
run_number
+=
i
;
...
...
@@ -736,7 +736,7 @@ std::vector<std::string> EnggDiffractionPresenter::isValidMultiRunNumber(
std
::
string
filename
=
inputDir
.
getFileName
();
// convert to int or assign it to size_t
for
(
char
&
i
:
filename
)
{
for
(
char
&
i
:
filename
)
{
char
*
str
=
&
i
;
if
(
std
::
isdigit
(
*
str
))
{
run_number
+=
i
;
...
...
qt/scientific_interfaces/General/DataComparison.cpp
View file @
e84b4745
...
...
@@ -580,7 +580,7 @@ void DataComparison::diffSelected() {
QList
<
int
>
selectedRows
;
// Generate a list of selected row numbers
for
(
auto
&
selectedItem
:
selectedItems
)
{
for
(
auto
&
selectedItem
:
selectedItems
)
{
int
row
=
selectedItem
->
row
();
if
(
!
selectedRows
.
contains
(
row
))
selectedRows
<<
selectedItem
->
row
();
...
...
qt/scientific_interfaces/ISISReflectometry/QtReflRunsTabView.cpp
View file @
e84b4745
...
...
@@ -273,7 +273,7 @@ void QtReflRunsTabView::setStopMonitorButtonEnabled(bool enabled) {
*/
void
QtReflRunsTabView
::
setTransferMethods
(
const
std
::
set
<
std
::
string
>
&
methods
)
{
for
(
const
auto
&
method
:
methods
)
{
for
(
const
auto
&
method
:
methods
)
{
ui
.
comboTransferMethod
->
addItem
(
method
.
c_str
());
}
}
...
...
@@ -289,7 +289,7 @@ void QtReflRunsTabView::setInstrumentList(
const
std
::
string
&
defaultInstrument
)
{
ui
.
comboSearchInstrument
->
clear
();
for
(
const
auto
&
it
:
instruments
)
{
for
(
const
auto
&
it
:
instruments
)
{
QString
instrument
=
QString
::
fromStdString
(
it
);
ui
.
comboSearchInstrument
->
addItem
(
instrument
);
}
...
...
@@ -451,7 +451,7 @@ std::set<int> QtReflRunsTabView::getSelectedSearchRows() const {
auto
selectionModel
=
ui
.
tableSearchResults
->
selectionModel
();
if
(
selectionModel
)
{
auto
selectedRows
=
selectionModel
->
selectedRows
();
for
(
auto
&
selectedRow
:
selectedRows
)
for
(
auto
&
selectedRow
:
selectedRows
)
rows
.
insert
(
selectedRow
.
row
());
}
return
rows
;
...
...
qt/scientific_interfaces/ISISReflectometry/QtReflSaveTabView.cpp
View file @
e84b4745
...
...
@@ -139,7 +139,7 @@ std::string QtReflSaveTabView::getCurrentWorkspaceName() const {
std
::
vector
<
std
::
string
>
QtReflSaveTabView
::
getSelectedWorkspaces
()
const
{
std
::
vector
<
std
::
string
>
itemNames
;
auto
items
=
m_ui
.
listOfWorkspaces
->
selectedItems
();
for
(
auto
&
item
:
items
)
{
for
(
auto
&
item
:
items
)
{
itemNames
.
push_back
(
item
->
text
().
toStdString
());
}
return
itemNames
;
...
...
@@ -151,7 +151,7 @@ std::vector<std::string> QtReflSaveTabView::getSelectedWorkspaces() const {
std
::
vector
<
std
::
string
>
QtReflSaveTabView
::
getSelectedParameters
()
const
{
std
::
vector
<
std
::
string
>
paramNames
;
auto
items
=
m_ui
.
listOfLoggedParameters
->
selectedItems
();
for
(
auto
&
item
:
items
)
{
for
(
auto
&
item
:
items
)
{
paramNames
.
push_back
(
item
->
text
().
toStdString
());
}
return
paramNames
;
...
...
@@ -208,7 +208,7 @@ void QtReflSaveTabView::clearParametersList() const {
*/
void
QtReflSaveTabView
::
setWorkspaceList
(
const
std
::
vector
<
std
::
string
>
&
names
)
const
{
for
(
const
auto
&
name
:
names
)
{
for
(
const
auto
&
name
:
names
)
{
m_ui
.
listOfWorkspaces
->
addItem
(
QString
::
fromStdString
(
name
));
}
}
...
...
@@ -218,7 +218,7 @@ void QtReflSaveTabView::setWorkspaceList(
*/
void
QtReflSaveTabView
::
setParametersList
(
const
std
::
vector
<
std
::
string
>
&
logs
)
const
{
for
(
const
auto
&
log
:
logs
)
{
for
(
const
auto
&
log
:
logs
)
{
m_ui
.
listOfLoggedParameters
->
addItem
(
QString
::
fromStdString
(
log
));
}
}
...
...
qt/scientific_interfaces/ISISReflectometry/ReflMeasureTransferStrategy.cpp
View file @
e84b4745
...
...
@@ -67,7 +67,7 @@ MantidQt::CustomInterfaces::ReflMeasureTransferStrategy::transferRuns(
// runs.
TransferResults
results
(
runs
,
errors
);
MapGroupedMeasurement
mapOfMeasurements
;
for
(
auto
&
searchResult
:
searchResults
)
{
for
(
auto
&
searchResult
:
searchResults
)
{
const
auto
location
=
searchResult
.
second
.
location
;
const
auto
fuzzyName
=
searchResult
.
first
;
...
...
@@ -100,7 +100,7 @@ MantidQt::CustomInterfaces::ReflMeasureTransferStrategy::transferRuns(
int
nextGroupId
=
0
;
for
(
auto
&
mapOfMeasurement
:
mapOfMeasurements
)
{
for
(
auto
&
mapOfMeasurement
:
mapOfMeasurements
)
{
std
::
string
groupName
;
...
...
qt/scientific_interfaces/ISISSANS/SANSAddFiles.cpp
View file @
e84b4745
...
...
@@ -199,7 +199,8 @@ void SANSAddFiles::add2Runs2Add() {
"unusedName"
,
m_SANSForm
->
new2Add_edit
->
text
().
toStdString
());
const
std
::
vector
<
std
::
string
>
&
nam
=
commaSep
;
for
(
const
auto
&
i
:
nam
)
{
// each comma separated item could be a range of run numbers
for
(
const
auto
&
i
:
nam
)
{
// each comma separated item could be a range of run numbers
// specified with a ':' or '-'
QStringList
ranges
;
std
::
vector
<
int
>
runNumRanges
;
...
...
qt/scientific_interfaces/ISISSANS/SANSRunWindow.cpp
View file @
e84b4745
...
...
@@ -3015,7 +3015,7 @@ void SANSRunWindow::handleDefSaveClick() {
const
QStringList
algs
(
getSaveAlgs
());
QString
saveCommand
;
for
(
const
auto
&
alg
:
algs
)
{
for
(
const
auto
&
alg
:
algs
)
{
QString
ext
=
SaveWorkspaces
::
getSaveAlgExt
(
alg
);
QString
fname
=
fileBase
.
endsWith
(
ext
)
?
fileBase
:
fileBase
+
ext
;
if
(
alg
==
"SaveRKH"
)
...
...
@@ -3255,7 +3255,7 @@ void SANSRunWindow::handleInstrumentChange() {
QWidget
*
front_center_widgets
[]
=
{
m_uiForm
.
front_beam_x
,
m_uiForm
.
front_beam_y
,
m_uiForm
.
front_radio
};
bool
loq_selected
=
(
instClass
==
"LOQ()"
);
for
(
auto
&
front_center_widget
:
front_center_widgets
)
for
(
auto
&
front_center_widget
:
front_center_widgets
)
front_center_widget
->
setEnabled
(
true
);
// Set the label of the radio buttons according to the
// beamline usage:
...
...
@@ -3482,8 +3482,9 @@ void SANSRunWindow::checkList() {
// split up the comma separated list ignoring spaces
Poco
::
StringTokenizer
in
(
input
,
","
,
Poco
::
StringTokenizer
::
TOK_TRIM
);
try
{
for
(
const
auto
&
i
:
in
)
{
// try a lexical cast, we don't need its result only
// if there was an error
for
(
const
auto
&
i
:
in
)
{
// try a lexical cast, we don't need its result only
// if there was an error
boost
::
lexical_cast
<
double
>
(
i
);
}
// there were no errors
...
...
@@ -3965,7 +3966,7 @@ void SANSRunWindow::transSelectorChanged(int currindex) {
QWidget
*
wid
[]
=
{
m_uiForm
.
trans_can_label
,
m_uiForm
.
transFitOnOff_can
,
m_uiForm
.
transFit_ck_can
,
m_uiForm
.
trans_min_can
,
m_uiForm
.
trans_max_can
,
m_uiForm
.
trans_opt_can
};
for
(
auto
&
i
:
wid
)
for
(
auto
&
i
:
wid
)
i
->
setVisible
(
visible
);
}
...
...
qt/scientific_interfaces/Indirect/DensityOfStates.cpp
View file @
e84b4745
...
...
@@ -128,7 +128,7 @@ void DensityOfStates::run() {
std
::
vector
<
std
::
string
>
selectedIons
;
auto
items
=
m_uiForm
.
lwIons
->
selectedItems
();
for
(
auto
&
item
:
items
)
for
(
auto
&
item
:
items
)
selectedIons
.
push_back
(
item
->
text
().
toStdString
());
dosAlgo
->
setProperty
(
"Ions"
,
selectedIons
);
}
else
if
(
specType
==
"IR"
)
{
...
...
qt/scientific_interfaces/Indirect/Elwin.cpp
View file @
e84b4745
...
...
@@ -204,7 +204,7 @@ void Elwin::run() {
// Load input files
std
::
string
inputWorkspacesString
;
for
(
auto
&
inputFilename
:
inputFilenames
)
{
for
(
auto
&
inputFilename
:
inputFilenames
)
{
QFileInfo
inputFileInfo
(
inputFilename
);
std
::
string
workspaceName
=
inputFileInfo
.
baseName
().
toStdString
();
...
...
qt/scientific_interfaces/Indirect/IndirectDataReduction.cpp
View file @
e84b4745
...
...
@@ -275,7 +275,7 @@ QMap<QString, QString> IndirectDataReduction::getInstrumentDetails() {
auto
component
=
instrument
->
getComponentByName
(
analyser
);
// For each parameter we want to get
for
(
auto
&
ipfElement
:
ipfElements
)
{
for
(
auto
&
ipfElement
:
ipfElements
)
{
try
{
std
::
string
key
=
ipfElement
;
...
...
@@ -289,8 +289,8 @@ QMap<QString, QString> IndirectDataReduction::getInstrumentDetails() {
// In the case that the parameter does not exist
catch
(
Mantid
::
Kernel
::
Exception
::
NotFoundError
&
nfe
)
{
UNUSED_ARG
(
nfe
);
g_log
.
warning
()
<<
"Could not find parameter "
<<
ipfElement
<<
" in instrument "
<<
instrumentName
<<
'\n'
;
g_log
.
warning
()
<<
"Could not find parameter "
<<
ipfElement
<<
" in instrument "
<<
instrumentName
<<
'\n'
;
}
}
...
...
@@ -487,10 +487,10 @@ void IndirectDataReduction::filterUiForFacility(QString facility) {
}
// Add the required tabs
for
(
auto
&
enabledTab
:
enabledTabs
)
{
for
(
auto
&
enabledTab
:
enabledTabs
)
{
// Connect the insturment changed signal
connect
(
this
,
SIGNAL
(
newInstrumentConfiguration
()),
m_tabs
[
enabledTab
].
second
,
SIGNAL
(
newInstrumentConfiguration
()));
connect
(
this
,
SIGNAL
(
newInstrumentConfiguration
()),
m_tabs
[
enabledTab
].
second
,
SIGNAL
(
newInstrumentConfiguration
()));
// Add the tab
m_uiForm
.
twIDRTabs
->
addTab
(
m_tabs
[
enabledTab
].
first
,
enabledTab
);
...
...
qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp
View file @
e84b4745
...
...
@@ -52,7 +52,7 @@ void updateParameters(
void
updateAttributes
(
IFunction_sptr
function
,
std
::
vector
<
std
::
string
>
const
&
attributeNames
,
std
::
unordered_map
<
std
::
string
,
IFunction
::
Attribute
>
const
&
attributes
)
{
for
(
const
auto
&
attributeName
:
attributeNames
)
{
for
(
const
auto
&
attributeName
:
attributeNames
)
{
auto
const
value
=
attributes
.
find
(
attributeName
);
if
(
value
!=
attributes
.
end
())
function
->
setAttribute
(
attributeName
,
value
->
second
);
...
...
qt/scientific_interfaces/MultiDatasetFit/MDFAddWorkspaceDialog.cpp
View file @
e84b4745
...
...
@@ -76,7 +76,7 @@ QStringList AddWorkspaceDialog::availableWorkspaces() const {
auto
&
ADS
=
Mantid
::
API
::
AnalysisDataService
::
Instance
();
QStringList
workspaceNames
;
auto
wsNames
=
ADS
.
getObjectNames
(
Mantid
::
Kernel
::
DataServiceSort
::
Sorted
);
for
(
auto
&
wsName
:
wsNames
)
{
for
(
auto
&
wsName
:
wsNames
)
{
if
(
ADS
.
retrieveWS
<
Mantid
::
API
::
MatrixWorkspace
>
(
wsName
))
{
workspaceNames
<<
QString
::
fromStdString
(
wsName
);
continue
;
...
...
qt/scientific_interfaces/MultiDatasetFit/MDFDataController.cpp
View file @
e84b4745
...
...
@@ -72,7 +72,7 @@ void DataController::addWorkspace() {
}
if
(
!
matrixWorkspaces
.
empty
())
{
for
(
auto
&
matrixWorkspace
:
matrixWorkspaces
)
{
for
(
auto
&
matrixWorkspace
:
matrixWorkspaces
)
{
auto
name
=
QString
::
fromStdString
((
*
matrixWorkspace
).
getName
());
for
(
auto
&
index
:
indices
)
{
addWorkspaceSpectrum
(
name
,
index
,
*
matrixWorkspace
);
...
...
@@ -135,7 +135,7 @@ void DataController::removeSelectedSpectra() {
if
(
ranges
.
isEmpty
())
return
;
QList
<
int
>
rows
;
for
(
auto
&
range
:
ranges
)
{
for
(
auto
&
range
:
ranges
)
{
for
(
int
row
=
range
.
topRow
();
row
<=
range
.
bottomRow
();
++
row
)
{
rows
.
push_back
(
row
);
}
...
...
qt/scientific_interfaces/MultiDatasetFit/MDFEditLocalParameterDialog.cpp
View file @
e84b4745
...
...
@@ -237,7 +237,7 @@ void EditLocalParameterDialog::showContextMenu() {
bool
hasSelection
=
false
;
for
(
auto
&
index
:
selection
)
{
for
(
auto
&
index
:
selection
)
{
if
(
index
.
column
()
==
valueColumn
)
hasSelection
=
true
;
}
...
...
qt/scientific_interfaces/MultiDatasetFit/MDFFunctionPlotData.cpp
View file @
e84b4745
...
...
@@ -108,7 +108,7 @@ void MDFFunctionPlotData::updateFunction(const Mantid::API::IFunction &fun) {
}
// Copy the attributes
auto
attributes
=
fun
.
getAttributeNames
();
for
(
auto
&
attribute
:
attributes
)
{
for
(
auto
&
attribute
:
attributes
)
{
auto
value
=
fun
.
getAttribute
(
attribute
);
m_function
->
setAttribute
(
attribute
,
value
);
}
...
...
qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.cpp
View file @
e84b4745
...
...
@@ -769,8 +769,7 @@ void MultiDatasetFit::setLogNames() {
ws
->
run
().
getLogData
();
QStringList
logNames
;
for
(
auto
log
:
logs
)
{
if
(
dynamic_cast
<
Mantid
::
Kernel
::
TimeSeriesProperty
<
double
>
*>
(
log
))
{
if
(
dynamic_cast
<
Mantid
::
Kernel
::
TimeSeriesProperty
<
double
>
*>
(
log
))
{
logNames
<<
QString
::
fromStdString
(
log
->
name
());
}
}
...
...
qt/scientific_interfaces/Muon/ALCBaselineModellingModel.cpp
View file @
e84b4745
...
...
@@ -90,7 +90,7 @@ void ALCBaselineModellingModel::disableUnwantedPoints(
// Find points which are in at least one section, and exclude them from
// disable list
for
(
size_t
i
=
0
;
i
<
numBins
;
++
i
)
{
for
(
const
auto
&
section
:
sections
)
{
for
(
const
auto
&
section
:
sections
)
{
if
(
ws
->
x
(
0
)[
i
]
>=
section
.
first
&&
ws
->
x
(
0
)[
i
]
<=
section
.
second
)
{
toDisable
[
i
]
=
false
;
break
;
// No need to check other sections
...
...
qt/scientific_interfaces/Muon/ALCInterface.cpp
View file @
e84b4745
...
...
@@ -181,7 +181,7 @@ void ALCInterface::exportResults() {
// Check if any of the above is not empty
bool
nothingToExport
=
true
;
for
(
auto
&
result
:
results
)
{
for
(
auto
&
result
:
results
)
{
if
(
result
.
second
)
{
nothingToExport
=
false
;
...
...
@@ -196,7 +196,7 @@ void ALCInterface::exportResults() {
AnalysisDataService
::
Instance
().
addOrReplace
(
groupName
,
boost
::
make_shared
<
WorkspaceGroup
>
());
for
(
auto
&
result
:
results
)
{
for
(
auto
&
result
:
results
)
{
if
(
result
.
second
)
{
std
::
string
wsName
=
groupName
+
"_"
+
result
.
first
;
AnalysisDataService
::
Instance
().
addOrReplace
(
wsName
,
result
.
second
);
...
...
qt/scientific_interfaces/Muon/MuonAnalysisHelper.cpp
View file @
e84b4745
...
...
@@ -665,7 +665,7 @@ void groupWorkspaces(const std::string &groupName,
if
(
group
)
{
// Exists and is a group -> add missing workspaces to it
for
(
const
auto
&
inputWorkspace
:
inputWorkspaces
)
{
for
(
const
auto
&
inputWorkspace
:
inputWorkspaces
)
{
if
(
!
group
->
contains
(
inputWorkspace
))
{
group
->
add
(
inputWorkspace
);
}
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment