diff --git a/Controllers/DreamCheekyController/DreamCheekyController.cpp b/Controllers/DreamCheekyController/DreamCheekyController.cpp index 203c4ed08..c7dea61cf 100644 --- a/Controllers/DreamCheekyController/DreamCheekyController.cpp +++ b/Controllers/DreamCheekyController/DreamCheekyController.cpp @@ -13,10 +13,11 @@ #include "DreamCheekyController.h" #include "StringUtils.h" -DreamCheekyController::DreamCheekyController(hid_device* dev_handle, const char* path) +DreamCheekyController::DreamCheekyController(hid_device* dev_handle, const char* path, std::string dev_name) { dev = dev_handle; location = path; + name = dev_name; /*-----------------------------------------------------*\ | The Dream Cheeky Webmail Notifier requires four | @@ -43,6 +44,11 @@ std::string DreamCheekyController::GetDeviceLocation() return("HID: " + location); } +std::string DreamCheekyController::GetNameString() +{ + return(name); +} + std::string DreamCheekyController::GetSerialString() { wchar_t serial_string[128]; diff --git a/Controllers/DreamCheekyController/DreamCheekyController.h b/Controllers/DreamCheekyController/DreamCheekyController.h index b3ac48529..840da7575 100644 --- a/Controllers/DreamCheekyController/DreamCheekyController.h +++ b/Controllers/DreamCheekyController/DreamCheekyController.h @@ -17,10 +17,11 @@ class DreamCheekyController { public: - DreamCheekyController(hid_device* dev_handle, const char* path); + DreamCheekyController(hid_device* dev_handle, const char* path, std::string dev_name); ~DreamCheekyController(); std::string GetDeviceLocation(); + std::string GetNameString(); std::string GetSerialString(); void SetColor(unsigned char red, unsigned char grn, unsigned char blu); @@ -28,4 +29,5 @@ public: private: hid_device* dev; std::string location; + std::string name; }; diff --git a/Controllers/DreamCheekyController/DreamCheekyControllerDetect.cpp b/Controllers/DreamCheekyController/DreamCheekyControllerDetect.cpp index 122e9de22..71f175e15 100644 --- a/Controllers/DreamCheekyController/DreamCheekyControllerDetect.cpp +++ b/Controllers/DreamCheekyController/DreamCheekyControllerDetect.cpp @@ -29,9 +29,8 @@ void DetectDreamCheekyControllers(hid_device_info* info, const std::string& name if(dev) { - DreamCheekyController* controller = new DreamCheekyController(dev, info->path); + DreamCheekyController* controller = new DreamCheekyController(dev, info->path, name); RGBController_DreamCheeky* rgb_controller = new RGBController_DreamCheeky(controller); - rgb_controller->name = name; ResourceManager::get()->RegisterRGBController(rgb_controller); } diff --git a/Controllers/DreamCheekyController/RGBController_DreamCheeky.cpp b/Controllers/DreamCheekyController/RGBController_DreamCheeky.cpp index b4e728976..cdb86fb79 100644 --- a/Controllers/DreamCheekyController/RGBController_DreamCheeky.cpp +++ b/Controllers/DreamCheekyController/RGBController_DreamCheeky.cpp @@ -15,7 +15,7 @@ RGBController_DreamCheeky::RGBController_DreamCheeky(DreamCheekyController* cont { controller = controller_ptr; - name = "Dream Cheeky Device"; + name = controller->GetNameString(); type = DEVICE_TYPE_ACCESSORY; vendor = "Dream Cheeky"; description = "Dream Cheeky Device";