mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 04:31:58 +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
|
void
|
||||||
ConfigBase::setenv_()
|
ConfigBase::setenv_()
|
||||||
{
|
{
|
||||||
t_config_option_keys opt_keys = this->keys();
|
for (auto &opt_key : this->keys()) {
|
||||||
for (t_config_option_keys::const_iterator it = opt_keys.begin(); it != opt_keys.end(); ++it) {
|
std::string envname = "SLIC3R_" + opt_key;
|
||||||
// prepend the SLIC3R_ prefix
|
boost::to_upper(envname);
|
||||||
std::ostringstream ss;
|
boost::nowide::setenv(envname.c_str(), this->serialize(opt_key).c_str(), 1);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user