mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-31 06:42:02 +08:00
Clean setenv_() code
This commit is contained in:
parent
a1464a737e
commit
fac31616c8
@ -407,19 +407,10 @@ ConfigBase::getStrings(const t_config_option_key &opt_key, std::vector<std::stri
|
||||
void
|
||||
ConfigBase::setenv_()
|
||||
{
|
||||
t_config_option_keys opt_keys = this->keys();
|
||||
for (t_config_option_keys::const_iterator it = opt_keys.begin(); it != opt_keys.end(); ++it) {
|
||||
// prepend the SLIC3R_ prefix
|
||||
std::ostringstream ss;
|
||||
ss << "SLIC3R_";
|
||||
ss << *it;
|
||||
std::string envname = ss.str();
|
||||
|
||||
// capitalize environment variable name
|
||||
for (size_t i = 0; i < envname.size(); ++i)
|
||||
envname[i] = (envname[i] <= 'z' && envname[i] >= 'a') ? envname[i]-('a'-'A') : envname[i];
|
||||
|
||||
boost::nowide::setenv(envname.c_str(), this->serialize(*it).c_str(), 1);
|
||||
for (auto &opt_key : this->keys()) {
|
||||
std::string envname = "SLIC3R_" + opt_key;
|
||||
boost::to_upper(envname);
|
||||
boost::nowide::setenv(envname.c_str(), this->serialize(opt_key).c_str(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user