summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/pppdata.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.cpp52
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
@@ -57,13 +57,14 @@ PPPData* PPPData::data()
PPPData::PPPData()
: //config(0L),
highcount(-1), // start out with no entries
caccount(-1), // set the current account index also
suidprocessid(-1), // process ID of setuid child
pppdisrunning(false),
- pppderror(0)
+ pppderror(0),
+ modemDeviceGroup(-1)
{
}
//
// open configuration file
@@ -324,14 +325,22 @@ void PPPData::setpppdTimeout(int n) {
const QString PPPData::modemDevice() {
return readConfig (modemGroup(), MODEMDEV_KEY, devices[DEV_DEFAULT]);
}
-void PPPData::setModemDevice(const QString &n) {
+bool PPPData::setModemDevice(const QString &n) {
+ //FIXME: change modem group
+ bool ret = false;
+ for (int i = 0; devices[i]; i++)
+ if (devices[i] == n){
+ modemDeviceGroup = i;
writeConfig(modemGroup(), MODEMDEV_KEY, n);
+ ret = true;
+ }
+ return ret;
}
const QString PPPData::flowcontrol() {
return readConfig(modemGroup(), FLOWCONTROL_KEY, "CRTSCTS");
}
@@ -1090,39 +1099,39 @@ QStringList &PPPData::script() {
void PPPData::setScript(QStringList &list) {
writeListConfig(cgroup, SCRIPTARG_KEY, list);
}
-const QString PPPData::accountingFile() {
- return readConfig(cgroup, ACCTFILE_KEY);
-}
+// const QString PPPData::accountingFile() {
+// return readConfig(cgroup, ACCTFILE_KEY);
+// }
-void PPPData::setAccountingFile(const QString &n) {
- writeConfig(cgroup, ACCTFILE_KEY, n);
-}
+// void PPPData::setAccountingFile(const QString &n) {
+// writeConfig(cgroup, ACCTFILE_KEY, n);
+// }
-const QString PPPData::totalCosts() {
- return readConfig(cgroup, TOTALCOSTS_KEY);
-}
+// const QString PPPData::totalCosts() {
+// return readConfig(cgroup, TOTALCOSTS_KEY);
+// }
-void PPPData::setTotalCosts(const QString &n) {
- writeConfig(cgroup, TOTALCOSTS_KEY, n);
-}
+// void PPPData::setTotalCosts(const QString &n) {
+// writeConfig(cgroup, TOTALCOSTS_KEY, n);
+// }
-int PPPData::totalBytes() {
- return readNumConfig(cgroup, TOTALBYTES_KEY, 0);
-}
+// int PPPData::totalBytes() {
+// return readNumConfig(cgroup, TOTALBYTES_KEY, 0);
+// }
-void PPPData::setTotalBytes(int n) {
- writeConfig(cgroup, TOTALBYTES_KEY, n);
-}
+// void PPPData::setTotalBytes(int n) {
+// writeConfig(cgroup, TOTALBYTES_KEY, n);
+// }
QStringList &PPPData::pppdArgument() {
static QStringList arglist;
while(arglist.count() > MAX_PPPD_ARGUMENTS)
@@ -1208,13 +1217,14 @@ int PPPData::pppdError() const {
void PPPData::setpppdError(int err) {
pppderror = err;
}
QString PPPData::modemGroup()
{
- return MODEM_GRP;
+ if (modemDeviceGroup<0)qFatal("wrong modem %i",modemDeviceGroup);
+ return QString("MODEM_GRP_%1").arg(modemDeviceGroup);
}
// //
// // window position
// //
// void PPPData::winPosConWin(int& p_x, int& p_y) {