Skip to content

Commit

Permalink
[Fix] Adduct settings load and reset fail
Browse files Browse the repository at this point in the history
Loading settings from previously saved settings file (XML) is
often used to share common analysis parameters. It can also help
reproduce analysis from GUI in the CLI (because CLI allows much
less control than the GUI). Due to some missing calls, parameters
for adduct detection behaviour was not being set as they should be.
This has been fixed.
  • Loading branch information
saif-el committed Feb 27, 2021
1 parent 99ac14e commit aa3a284
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/core/libmaven/mavenparameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,11 @@ bool MavenParameters::loadSettings(const char* data)

pugi::xml_node pnode = xmlDoc.child("Settings");

for(pugi::xml_node_iterator it = pnode.begin(); it != pnode.end(); ++it) {

setIsotopeDialogSettings(it->name(), it->text().get());
setPeakDetectionSettings(it->name(), it->text().get());
setOptionsDialogSettings(it->name(), it->text().get());
for (pugi::xml_node_iterator it = pnode.begin(); it != pnode.end(); ++it) {
setIsotopeDialogSettings(it->name(), it->text().get());
setAdductsDialogSettings(it->name(), it->text().get());
setPeakDetectionSettings(it->name(), it->text().get());
setOptionsDialogSettings(it->name(), it->text().get());
}

return true;
Expand All @@ -696,12 +696,12 @@ void MavenParameters::reset(const std::list<string>& keys)

pugi::xml_node pnode = xmlDoc.child("Settings");

for(pugi::xml_node_iterator it = pnode.begin(); it != pnode.end(); ++it) {

if( std::find(keys.begin(), keys.end(), it->name()) != keys.end() ) {
for (pugi::xml_node_iterator it = pnode.begin(); it != pnode.end(); ++it) {
if (std::find(keys.begin(), keys.end(), it->name()) != keys.end()) {
setOptionsDialogSettings(it->name(), it->text().get());
setPeakDetectionSettings(it->name(), it->text().get());
setIsotopeDialogSettings(it->name(), it->text().get());
setAdductsDialogSettings(it->name(), it->text().get());
}
}
}
Expand Down

0 comments on commit aa3a284

Please sign in to comment.