diff --git a/Controllers/LEDStripController/LEDStripControllerDetect.cpp b/Controllers/LEDStripController/LEDStripControllerDetect.cpp index 3276bc92..21ff4338 100644 --- a/Controllers/LEDStripController/LEDStripControllerDetect.cpp +++ b/Controllers/LEDStripController/LEDStripControllerDetect.cpp @@ -30,24 +30,11 @@ void DetectLEDStripControllers(std::vector &rgb_controllers) LEDStripController* new_ledstrip; RGBController_LEDStrip* new_controller; - //Get file path in executable directory std::ifstream infile; - char filename[2048]; char arg1[64]; -#ifdef WIN32 - GetModuleFileName(NULL, filename, 2048); - strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str()); - strcat(filename, "\\ledstrip.txt"); -#else - snprintf(arg1, 64, "/proc/%d/exe", getpid()); - readlink(arg1, filename, 1024); - strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str()); - strcat(filename, "/ledstrip.txt"); -#endif - //Open settings file - infile.open(filename); + infile.open("ledstrip.txt"); if (infile.good()) { diff --git a/RGBController/E131ControllerDetect.cpp b/RGBController/E131ControllerDetect.cpp index c22c24c6..d288f5c4 100644 --- a/RGBController/E131ControllerDetect.cpp +++ b/RGBController/E131ControllerDetect.cpp @@ -35,22 +35,9 @@ void DetectE131Controllers(std::vector &rgb_controllers) { RGBController_E131* new_controller; - //Get file path in executable directory std::ifstream infile; - char filename[2048]; char arg1[64]; -#ifdef WIN32 - GetModuleFileName(NULL, filename, 2048); - strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str()); - strcat(filename, "\\e131.txt"); -#else - snprintf(arg1, 64, "/proc/%d/exe", getpid()); - readlink(arg1, filename, 1024); - strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str()); - strcat(filename, "/e131.txt"); -#endif - E131Device dev; std::vector devices; @@ -66,7 +53,7 @@ void DetectE131Controllers(std::vector &rgb_controllers) dev.matrix_height = 0; //Open settings file - infile.open(filename); + infile.open("e131.txt"); if (infile.good()) {