Commit 2be7abb5 authored by Łukasz Matysiak's avatar Łukasz Matysiak
Browse files

Remove Data::fillConfig

parent 0ac635ad
......@@ -30,13 +30,8 @@
Config::Config(std::string configPath, std::string type)
: type_(type), basePath_(configPath.substr(0, configPath.find_last_of('/'))),
configPath_(configPath)
configPath_(configPath), hwdIDs_(1)
{
if (hwdIDs_.empty())
{
Config::HardwareID hwdID;
hwdIDs_.push_back(hwdID);
}
}
bool Config::readConfigFile(std::string configPath)
......
......@@ -493,23 +493,6 @@ void Data::fillAllConfigs(std::string type)
}
}
bool Data::fillConfig(std::shared_ptr<Config> config, std::string configPath, std::string type)
{
config->type_ = type;
config->priority_ = 0;
config->freedriver_ = true;
config->basePath_ = configPath.substr(0, configPath.find_last_of('/'));
config->configPath_ = configPath;
// Add new HardwareIDs group to vector if vector is empty
if (config->hwdIDs_.empty())
{
config->hwdIDs_.emplace_back();
}
return config->readConfigFile(config->configPath_);
}
std::vector<std::string> Data::getRecursiveDirectoryFileList(const std::string& directoryPath,
std::string onlyFilename)
{
......
......@@ -61,7 +61,6 @@ public:
void updateInstalledConfigData();
void getAllDevicesOfConfig(std::shared_ptr<Config> config, std::vector<std::shared_ptr<Device>>& foundDevices);
bool fillConfig(std::shared_ptr<Config> config, std::string configPath, std::string type);
std::vector<std::shared_ptr<Config>> getAllDependenciesToInstall(std::shared_ptr<Config> config);
void getAllDependenciesToInstall(std::shared_ptr<Config> config,
......
......@@ -1248,7 +1248,7 @@ int Mhwd::launch(int argc, char *argv[])
else
{
config_.reset(new Config(filepath, operationType));
if (!data_.fillConfig(config_, filepath, operationType))
if (!config_->readConfigFile(filepath))
{
printer_.printError("failed to read custom config '" + filepath + "'!");
return 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment