mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-28 09:27:18 +00:00
fix profile reading
This commit is contained in:
parent
f7e39c7834
commit
341a19a955
@ -64,7 +64,6 @@ Additional information
|
|||||||
TODO (wish list)
|
TODO (wish list)
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
* test profile reading
|
|
||||||
* man pages
|
* man pages
|
||||||
|
|
||||||
Links
|
Links
|
||||||
|
@ -132,10 +132,12 @@ QMap<QString, QString> NetctlProfile::getSettingsFromProfile(const QString profi
|
|||||||
keys.append(output[i].split(QChar('='))[0]);
|
keys.append(output[i].split(QChar('='))[0]);
|
||||||
for (int i=0; i<keys.count(); i++){
|
for (int i=0; i<keys.count(); i++){
|
||||||
cmd = QString("env -i bash -c \"source ") + profileUrl +
|
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.start(cmd);
|
||||||
shell.waitForFinished(-1);
|
shell.waitForFinished(-1);
|
||||||
settings[keys[i]] = shell.readAllStandardOutput().trimmed();
|
settings[keys[i]] = shell.readAllStandardOutput().trimmed();
|
||||||
|
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << keys[i] << "=" << settings[keys[i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
|
Loading…
Reference in New Issue
Block a user