MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / savePreferences

Method savePreferences

src/openms_gui/source/VISUAL/APPLICATIONS/TOPPViewBase.cpp:1572–1605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1570 }
1571
1572 void TOPPViewBase::savePreferences()
1573 {
1574 // replace recent files
1575 param_.removeAll("preferences:RecentFiles");
1576 param_.insert("preferences:RecentFiles:", recent_files_.getAsParam());
1577
1578 // set version
1579 param_.setValue("preferences:version", VersionInfo::getVersion());
1580 // Make sure TOPP tool/util params have been inserted
1581 if (!param_.hasSection("tool_params:") && scan_mode_ != TOOL_SCAN::SKIP_SCAN)
1582 {
1583 tool_scanner_.waitForToolParams();
1584 param_.insert("tool_params:", tool_scanner_.getToolParams());
1585 }
1586 // check if the plugin path exists
1587 if (!tool_scanner_.setPluginPath(param_.getValue(user_section + "plugins_path").toString()))
1588 {
1589 // reset if it does not
1590 param_.setValue(user_section + "plugins_path", tool_scanner_.getPluginPath());
1591 }
1592
1593 // save only the subsection that begins with "preferences:" and all tool params ("tool_params:")
1594 try
1595 {
1596 Param p;
1597 p.insert("preferences:", param_.copy("preferences:", true));
1598 p.insert("tool_params:", param_.copy("tool_params:", true));
1599 ParamXMLFile().store(string(param_.getValue("PreferencesFile")), p);
1600 }
1601 catch (Exception::UnableToCreateFile& /*e*/)
1602 {
1603 cerr << "Unable to create INI File: '" << string(param_.getValue("PreferencesFile")) << "'" << endl;
1604 }
1605 }
1606
1607 QStringList TOPPViewBase::chooseFilesDialog_(const String& path_overwrite)
1608 {

Callers

nothing calls this directly

Calls 14

ParamXMLFileClass · 0.85
stringClass · 0.85
getAsParamMethod · 0.80
hasSectionMethod · 0.80
waitForToolParamsMethod · 0.80
setPluginPathMethod · 0.80
getPluginPathMethod · 0.80
removeAllMethod · 0.45
insertMethod · 0.45
setValueMethod · 0.45
toStringMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected