author | tille <tille> | 2003-05-25 14:25:23 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-25 14:25:23 (UTC) |
commit | 61c6231cdcde59f8a3ecff31b9fab37f7e9d8852 (patch) (unidiff) | |
tree | 4724031209e2263c872ad6160ea61a793f09ed1e /noncore/settings/networksettings/ppp/pppdata.cpp | |
parent | efa6dfa3428746451dd5a9b5e1ba57806ae96dba (diff) | |
download | opie-61c6231cdcde59f8a3ecff31b9fab37f7e9d8852.zip opie-61c6231cdcde59f8a3ecff31b9fab37f7e9d8852.tar.gz opie-61c6231cdcde59f8a3ecff31b9fab37f7e9d8852.tar.bz2 |
save device specific settings
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.cpp | 54 |
1 files changed, 32 insertions, 22 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 | |||
@@ -60,7 +60,8 @@ PPPData::PPPData() | |||
60 | caccount(-1), // set the current account index also | 60 | caccount(-1), // set the current account index also |
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 | } |
66 | 67 | ||
@@ -327,8 +328,16 @@ const QString PPPData::modemDevice() { | |||
327 | } | 328 | } |
328 | 329 | ||
329 | 330 | ||
330 | void PPPData::setModemDevice(const QString &n) { | 331 | bool PPPData::setModemDevice(const QString &n) { |
331 | writeConfig(modemGroup(), MODEMDEV_KEY, 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; | ||
337 | writeConfig(modemGroup(), MODEMDEV_KEY, n); | ||
338 | ret = true; | ||
339 | } | ||
340 | return ret; | ||
332 | } | 341 | } |
333 | 342 | ||
334 | 343 | ||
@@ -1093,33 +1102,33 @@ void PPPData::setScript(QStringList &list) { | |||
1093 | } | 1102 | } |
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 | ||
1125 | QStringList &PPPData::pppdArgument() { | 1134 | QStringList &PPPData::pppdArgument() { |
@@ -1211,7 +1220,8 @@ void PPPData::setpppdError(int err) { | |||
1211 | 1220 | ||
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 | ||
1217 | // // | 1227 | // // |