fix profile reading

This commit is contained in:
arcan1s 2014-07-14 14:03:38 +04:00
parent f7e39c7834
commit 341a19a955
2 changed files with 3 additions and 2 deletions

View File

@ -64,7 +64,6 @@ Additional information
TODO (wish list)
----------------
* test profile reading
* man pages
Links

View File

@ -132,10 +132,12 @@ QMap<QString, QString> NetctlProfile::getSettingsFromProfile(const QString profi
keys.append(output[i].split(QChar('='))[0]);
for (int i=0; i<keys.count(); i++){
cmd = QString("env -i bash -c \"source ") + profileUrl +
QString(" && printf -- '%s\n' \"${") + keys[i] + ("[@]}\"");
QString("; for i in ${!") + keys[i] + QString("[@]}; do echo ${") +
keys[i] + QString("[$i]}; done\"");
shell.start(cmd);
shell.waitForFinished(-1);
settings[keys[i]] = shell.readAllStandardOutput().trimmed();
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << keys[i] << "=" << settings[keys[i]];
}
return settings;