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 | |||
@@ -59,9 +59,10 @@ PPPData::PPPData() | |||
59 | highcount(-1), // start out with no entries | 59 | highcount(-1), // start out with no entries |
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 | ||
67 | 68 | ||
@@ -326,10 +327,18 @@ const QString PPPData::modemDevice() { | |||
326 | return readConfig (modemGroup(), MODEMDEV_KEY, devices[DEV_DEFAULT]); | 327 | return readConfig (modemGroup(), MODEMDEV_KEY, devices[DEV_DEFAULT]); |
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 | ||
335 | const QString PPPData::flowcontrol() { | 344 | const QString PPPData::flowcontrol() { |
@@ -1092,35 +1101,35 @@ void PPPData::setScript(QStringList &list) { | |||
1092 | writeListConfig(cgroup, SCRIPTARG_KEY, list); | 1101 | writeListConfig(cgroup, SCRIPTARG_KEY, 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() { |
1126 | static QStringList arglist; | 1135 | static QStringList arglist; |
@@ -1210,9 +1219,10 @@ void PPPData::setpppdError(int err) { | |||
1210 | } | 1219 | } |
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 | // // |
1218 | // // window position | 1228 | // // window position |