@@ -78,9 +78,8 @@ using sofa::helper::logging::RichConsoleStyleMessageFormatter ;
78
78
using sofa::helper::logging::MainPerComponentLoggingMessageHandler ;
79
79
80
80
#include < sofa/helper/AdvancedTimer.h>
81
+ #include < sofa/helper/system/FileRepository.h>
81
82
82
- #include < sofa/gui/common/GuiDataRepository.h>
83
- using sofa::gui::common::GuiDataRepository ;
84
83
85
84
using sofa::helper::system::DataRepository;
86
85
using sofa::helper::system::PluginRepository;
@@ -115,18 +114,15 @@ static std::string appName { "runSofa" };
115
114
// ---------------------------------------------------------------------
116
115
int main (int argc, char ** argv)
117
116
{
118
- // Add resources dir to GuiDataRepository
119
- const std::string runSofaIniFilePath = Utils::getSofaPathTo (" /etc/runSofa.ini" );
120
- std::map<std::string, std::string> iniFileValues = Utils::readBasicIniFile (runSofaIniFilePath);
121
- if (iniFileValues.find (" RESOURCES_DIR" ) != iniFileValues.end ())
122
- {
123
- std::string dir = iniFileValues[" RESOURCES_DIR" ];
124
- dir = SetDirectory::GetRelativeFromProcess (dir.c_str ());
125
- if (FileSystem::isDirectory (dir))
126
- {
127
- sofa::gui::common::GuiDataRepository.addFirstPath (dir);
128
- }
129
- }
117
+ sofa::helper::system::FileRepository runSofaDataRepository (
118
+ " RUNSOFA_DATA_PATH" ,
119
+ {
120
+ Utils::getSofaPathTo (" share/sofa/gui/runSofa" )
121
+ },
122
+ {
123
+ { Utils::getSofaPathTo (" etc/runSofa.ini" ).c_str (), {" RESOURCES_DIR" } }
124
+ }
125
+ );
130
126
131
127
sofa::helper::BackTrace::autodump ();
132
128
@@ -371,7 +367,7 @@ int main(int argc, char** argv)
371
367
// Output FileRepositories
372
368
msg_info (appName) << " PluginRepository paths = " << PluginRepository.getPathsJoined ();
373
369
msg_info (appName) << " DataRepository paths = " << DataRepository.getPathsJoined ();
374
- msg_info (appName) << " GuiDataRepository paths = " << GuiDataRepository .getPathsJoined ();
370
+ msg_info (appName) << " runSofaDataRepository paths = " << runSofaDataRepository .getPathsJoined ();
375
371
376
372
// Initialise paths
377
373
BaseGUI::setConfigDirectoryPath (Utils::getSofaPathPrefix () + " /config" , true );
0 commit comments