summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/pppdata.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.cpp54
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
@@ -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
330void PPPData::setModemDevice(const QString &n) { 331bool 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
@@ -1094,31 +1103,31 @@ void PPPData::setScript(QStringList &list) {
1094 1103
1095 1104
1096const 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
1101void 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
1106const 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
1111void 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
1116int PPPData::totalBytes() { 1125// int PPPData::totalBytes() {
1117 return readNumConfig(cgroup, TOTALBYTES_KEY, 0); 1126// return readNumConfig(cgroup, TOTALBYTES_KEY, 0);
1118} 1127// }
1119 1128
1120void 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) {
1212QString PPPData::modemGroup() 1221QString 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