Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.cpp | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp index bb1c8ed..109e3b7 100644 --- a/noncore/settings/networksettings/ppp/pppdata.cpp +++ b/noncore/settings/networksettings/ppp/pppdata.cpp | |||
@@ -61,5 +61,6 @@ PPPData::PPPData() | |||
61 | suidprocessid(-1), // process ID of setuid child | 61 | suidprocessid(-1), // process ID of setuid child |
62 | pppdisrunning(false), | 62 | pppdisrunning(false), |
63 | pppderror(0) | 63 | pppderror(0), |
64 | modemDeviceGroup(-1) | ||
64 | { | 65 | { |
65 | } | 66 | } |
@@ -328,6 +329,14 @@ const QString PPPData::modemDevice() { | |||
328 | 329 | ||
329 | 330 | ||
330 | void PPPData::setModemDevice(const QString &n) { | 331 | bool PPPData::setModemDevice(const QString &n) { |
332 | //FIXME: change modem group | ||
333 | bool ret = false; | ||
334 | for (int i = 0; devices[i]; i++) | ||
335 | if (devices[i] == n){ | ||
336 | modemDeviceGroup = i; | ||
331 | writeConfig(modemGroup(), MODEMDEV_KEY, n); | 337 | writeConfig(modemGroup(), MODEMDEV_KEY, n); |
338 | ret = true; | ||
339 | } | ||
340 | return ret; | ||
332 | } | 341 | } |
333 | 342 | ||
@@ -1094,31 +1103,31 @@ void PPPData::setScript(QStringList &list) { | |||
1094 | 1103 | ||
1095 | 1104 | ||
1096 | const QString PPPData::accountingFile() { | 1105 | // const QString PPPData::accountingFile() { |
1097 | return readConfig(cgroup, ACCTFILE_KEY); | 1106 | // return readConfig(cgroup, ACCTFILE_KEY); |
1098 | } | 1107 | // } |
1099 | 1108 | ||
1100 | 1109 | ||
1101 | void PPPData::setAccountingFile(const QString &n) { | 1110 | // void PPPData::setAccountingFile(const QString &n) { |
1102 | writeConfig(cgroup, ACCTFILE_KEY, n); | 1111 | // writeConfig(cgroup, ACCTFILE_KEY, n); |
1103 | } | 1112 | // } |
1104 | 1113 | ||
1105 | 1114 | ||
1106 | const QString PPPData::totalCosts() { | 1115 | // const QString PPPData::totalCosts() { |
1107 | return readConfig(cgroup, TOTALCOSTS_KEY); | 1116 | // return readConfig(cgroup, TOTALCOSTS_KEY); |
1108 | } | 1117 | // } |
1109 | 1118 | ||
1110 | 1119 | ||
1111 | void PPPData::setTotalCosts(const QString &n) { | 1120 | // void PPPData::setTotalCosts(const QString &n) { |
1112 | writeConfig(cgroup, TOTALCOSTS_KEY, n); | 1121 | // writeConfig(cgroup, TOTALCOSTS_KEY, n); |
1113 | } | 1122 | // } |
1114 | 1123 | ||
1115 | 1124 | ||
1116 | int PPPData::totalBytes() { | 1125 | // int PPPData::totalBytes() { |
1117 | return readNumConfig(cgroup, TOTALBYTES_KEY, 0); | 1126 | // return readNumConfig(cgroup, TOTALBYTES_KEY, 0); |
1118 | } | 1127 | // } |
1119 | 1128 | ||
1120 | void PPPData::setTotalBytes(int n) { | 1129 | // void PPPData::setTotalBytes(int n) { |
1121 | writeConfig(cgroup, TOTALBYTES_KEY, n); | 1130 | // writeConfig(cgroup, TOTALBYTES_KEY, n); |
1122 | } | 1131 | // } |
1123 | 1132 | ||
1124 | 1133 | ||
@@ -1212,5 +1221,6 @@ void PPPData::setpppdError(int err) { | |||
1212 | QString PPPData::modemGroup() | 1221 | QString PPPData::modemGroup() |
1213 | { | 1222 | { |
1214 | return MODEM_GRP; | 1223 | if (modemDeviceGroup<0)qFatal("wrong modem %i",modemDeviceGroup); |
1224 | return QString("MODEM_GRP_%1").arg(modemDeviceGroup); | ||
1215 | } | 1225 | } |
1216 | 1226 | ||