Use up-to-date controller list in profile manager

This commit is contained in:
Adam Honse 2020-12-02 21:53:14 -06:00
parent 7a305b1440
commit 3f7c981ba2
3 changed files with 13 additions and 6 deletions

View file

@ -9,7 +9,7 @@
namespace fs = std::experimental::filesystem;
ProfileManager::ProfileManager(std::vector<RGBController *>& control, std::string config_dir) : controllers(control)
ProfileManager::ProfileManager(std::string config_dir)
{
configuration_directory = config_dir;
UpdateProfileList();
@ -22,6 +22,11 @@ ProfileManager::~ProfileManager()
bool ProfileManager::SaveProfile(std::string profile_name)
{
/*---------------------------------------------------------*\
| Get the list of controllers from the resource manager |
\*---------------------------------------------------------*/
std::vector<RGBController *> controllers = ResourceManager::get()->GetRGBControllers();
/*---------------------------------------------------------*\
| If a name was entered, save the profile file |
\*---------------------------------------------------------*/
@ -269,6 +274,11 @@ bool ProfileManager::LoadProfileWithOptions
std::string filename = configuration_directory + profile_name;
/*---------------------------------------------------------*\
| Get the list of controllers from the resource manager |
\*---------------------------------------------------------*/
std::vector<RGBController *> controllers = ResourceManager::get()->GetRGBControllers();
/*---------------------------------------------------------*\
| Open input file in binary mode |
\*---------------------------------------------------------*/