@ -481,13 +481,6 @@ void ResourceManager::SetupConfigurationDirectory()
| Create OpenRGB configuration directory if it doesn ' t exist |
\ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
filesystem : : create_directories ( config_dir ) ;
/*-------------------------------------------------------------------------*\
| Create OpenRGB plugins directory |
\ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
std : : string plugins_dir = config_dir + " plugins " ;
filesystem : : create_directories ( plugins_dir ) ;
}
else
{
@ -500,6 +493,26 @@ std::string ResourceManager::GetConfigurationDirectory()
return ( config_dir ) ;
}
void ResourceManager : : SetConfigurationDirectory ( std : : string directory )
{
/*-----------------------------------------------------*\
| Ensure the directory string has a trailing slash |
\ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
const char separator = filesystem : : path : : preferred_separator ;
if ( directory [ directory . size ( ) - 1 ] ! = separator )
{
directory + = separator ;
}
config_dir = directory ;
settings_manager - > LoadSettings ( directory + " OpenRGB.json " ) ;
profile_manager - > SetConfigurationDirectory ( directory ) ;
rgb_controllers_sizes . clear ( ) ;
rgb_controllers_sizes = profile_manager - > LoadProfileToList ( " sizes " , true ) ;
}
NetworkServer * ResourceManager : : GetServer ( )
{
return ( server ) ;
@ -579,15 +592,6 @@ const char *ResourceManager::GetDetectionString()
return ( detection_string ) ;
}
void ResourceManager : : SetConfigurationDirectory ( std : : string directory )
{
settings_manager - > LoadSettings ( directory + " OpenRGB.json " ) ;
profile_manager - > SetConfigurationDirectory ( directory ) ;
rgb_controllers_sizes . clear ( ) ;
rgb_controllers_sizes = profile_manager - > LoadProfileToList ( " sizes " , true ) ;
}
void ResourceManager : : Cleanup ( )
{
ResourceManager : : get ( ) - > WaitForDeviceDetection ( ) ;