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

Method savePreferences

src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp:1037–1060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1035 }
1036
1037 void TOPPASBase::savePreferences()
1038 {
1039 // replace recent files
1040 param_.removeAll("preferences:RecentFiles");
1041 param_.insert("preferences:RecentFiles:", recent_files_menu_.getAsParam());
1042
1043 //set version
1044 param_.setValue("preferences:version", VersionInfo::getVersion());
1045
1046 Param save_param = param_.copy("preferences:");
1047
1048 try
1049 {
1050 ParamXMLFile paramFile;
1051 // TODO: if closing multiple TOPPAS instances simultaneously, we might write to this file concurrently
1052 // thus destroying its integrity. Think about using boost filelocks
1053 // and also implement in TOPPView (and other GUI's which write to user directory)
1054 paramFile.store(string(param_.getValue("PreferencesFile")), save_param);
1055 }
1056 catch (Exception::UnableToCreateFile& /*e*/)
1057 {
1058 cerr << "Unable to create INI File: '" << string(param_.getValue("PreferencesFile")) << "'" << endl;
1059 }
1060 }
1061
1062 void TOPPASBase::showAboutDialog()
1063 {

Callers

nothing calls this directly

Calls 8

stringClass · 0.85
getAsParamMethod · 0.80
removeAllMethod · 0.45
insertMethod · 0.45
setValueMethod · 0.45
copyMethod · 0.45
storeMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected