mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-04 14:14:17 -04:00
Use up-to-date controller list in profile manager
This commit is contained in:
@@ -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 |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
class ProfileManager
|
||||
{
|
||||
public:
|
||||
ProfileManager(std::vector<RGBController *>& control, std::string config_dir);
|
||||
ProfileManager(std::string config_dir);
|
||||
~ProfileManager();
|
||||
|
||||
bool SaveProfile(std::string profile_name);
|
||||
@@ -31,9 +31,6 @@ public:
|
||||
|
||||
void SetConfigurationDirectory(std::string directory);
|
||||
|
||||
protected:
|
||||
std::vector<RGBController *>& controllers;
|
||||
|
||||
private:
|
||||
std::string configuration_directory;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ ResourceManager::ResourceManager()
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Load sizes list from file |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
profile_manager = new ProfileManager(rgb_controllers, GetConfigurationDirectory());
|
||||
profile_manager = new ProfileManager(GetConfigurationDirectory());
|
||||
rgb_controllers_sizes = profile_manager->LoadProfileToList("sizes.ors");
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
|
||||
Reference in New Issue
Block a user