summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/connect.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/ppp/connect.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/connect.cpp180
1 files changed, 90 insertions, 90 deletions
diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp
index b7e229e..a3eda9d 100644
--- a/noncore/settings/networksettings/ppp/connect.cpp
+++ b/noncore/settings/networksettings/ppp/connect.cpp
@@ -181,3 +181,3 @@ void ConnectWidget::preinit() {
void ConnectWidget::init() {
- gpppdata.setpppdError(0);
+ PPPData::data()->setpppdError(0);
inittimer->stop();
@@ -198,8 +198,8 @@ void ConnectWidget::init() {
-// p_kppp->setQuitOnDisconnect (p_kppp->quitOnDisconnect() || gpppdata.quit_on_disconnect());
+// p_kppp->setQuitOnDisconnect (p_kppp->quitOnDisconnect() || PPPData::data()->quit_on_disconnect());
- comlist = &gpppdata.scriptType();
- arglist = &gpppdata.script();
+ comlist = &PPPData::data()->scriptType();
+ arglist = &PPPData::data()->script();
- QString tit = i18n("Connecting to: %1").arg(gpppdata.accname());
+ QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname());
setCaption(tit);
@@ -209,3 +209,3 @@ void ConnectWidget::init() {
// run the "before-connect" command
- if (!gpppdata.command_before_connect().isEmpty()) {
+ if (!PPPData::data()->command_before_connect().isEmpty()) {
messg->setText(i18n("Running pre-startup command..."));
@@ -215,3 +215,3 @@ void ConnectWidget::init() {
QApplication::flushX();
- pid_t id = execute_command(gpppdata.command_before_connect());
+ pid_t id = execute_command(PPPData::data()->command_before_connect());
// int i, status;
@@ -252,3 +252,3 @@ void ConnectWidget::init() {
// if we are stuck anywhere we will time out
- timeout_timer->start(gpppdata.modemTimeout()*1000);
+ timeout_timer->start(PPPData::data()->modemTimeout()*1000);
@@ -286,3 +286,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- QString initStr = gpppdata.modemInitStr(substate);
+ QString initStr = PPPData::data()->modemInitStr(substate);
if (!initStr.isEmpty()) {
@@ -290,10 +290,10 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
// let us issue commands.
- if(gpppdata.modemPreInitDelay() > 0) {
- usleep(gpppdata.modemPreInitDelay() * 5000);
+ if(PPPData::data()->modemPreInitDelay() > 0) {
+ usleep(PPPData::data()->modemPreInitDelay() * 5000);
writeline("");
- usleep(gpppdata.modemPreInitDelay() * 5000);
+ usleep(PPPData::data()->modemPreInitDelay() * 5000);
}
- setExpect(gpppdata.modemInitResp());
+ setExpect(PPPData::data()->modemInitResp());
writeline(initStr);
- usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec
+ usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec
}
@@ -308,3 +308,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
*/
- if (MODEM_TONEDURATION != gpppdata.modemToneDuration())
+ if (MODEM_TONEDURATION != PPPData::data()->modemToneDuration())
vmain = 5;
@@ -318,3 +318,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if(!expecting) {
- QString sToneDuration = "ATS11=" + QString::number(gpppdata.modemToneDuration());
+ QString sToneDuration = "ATS11=" + QString::number(PPPData::data()->modemToneDuration());
QString msg = i18n("Setting ") + sToneDuration;
@@ -322,3 +322,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
emit debugMessage(msg);
- setExpect(gpppdata.modemInitResp());
+ setExpect(PPPData::data()->modemInitResp());
writeline(sToneDuration);
@@ -338,3 +338,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
// skip setting the volume if command is empty
- if(gpppdata.volumeInitString().isEmpty()) {
+ if(PPPData::data()->volumeInitString().isEmpty()) {
vmain = 4;
@@ -345,7 +345,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- setExpect(gpppdata.modemInitResp());
+ setExpect(PPPData::data()->modemInitResp());
QString vol("AT");
- vol += gpppdata.volumeInitString();
+ vol += PPPData::data()->volumeInitString();
writeline(vol);
- usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec
+ usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec
vmain = 4;
@@ -357,3 +357,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if(!expecting) {
- if(!gpppdata.waitForDialTone()) {
+ if(!PPPData::data()->waitForDialTone()) {
QString msg = i18n("Turning off dial tone waiting...");
@@ -361,4 +361,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
emit debugMessage(msg);
- setExpect(gpppdata.modemInitResp());
- writeline(gpppdata.modemNoDialToneDetectionStr());
+ setExpect(PPPData::data()->modemInitResp());
+ writeline(PPPData::data()->modemNoDialToneDetectionStr());
}
@@ -374,6 +374,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
timeout_timer->stop();
- timeout_timer->start(gpppdata.modemTimeout()*1000);
+ timeout_timer->start(PPPData::data()->modemTimeout()*1000);
- QStringList &plist = gpppdata.phonenumbers();
- QString bmarg= gpppdata.dialPrefix();
+ QStringList &plist = PPPData::data()->phonenumbers();
+ QString bmarg= PPPData::data()->dialPrefix();
bmarg += *plist.at(dialnumber);
@@ -383,4 +383,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- QString pn = gpppdata.modemDialStr();
- pn += gpppdata.dialPrefix();
+ QString pn = PPPData::data()->modemDialStr();
+ pn += PPPData::data()->dialPrefix();
pn += *plist.at(dialnumber);
@@ -390,3 +390,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- setExpect(gpppdata.modemConnectResp());
+ setExpect(PPPData::data()->modemConnectResp());
vmain = 100;
@@ -400,3 +400,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if(!expecting) {
- myreadbuffer = gpppdata.modemConnectResp();
+ myreadbuffer = PPPData::data()->modemConnectResp();
setExpect("\n");
@@ -406,5 +406,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- if(readbuffer.contains(gpppdata.modemBusyResp())) {
+ if(readbuffer.contains(PPPData::data()->modemBusyResp())) {
timeout_timer->stop();
- timeout_timer->start(gpppdata.modemTimeout()*1000);
+ timeout_timer->start(PPPData::data()->modemTimeout()*1000);
@@ -414,4 +414,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- if(gpppdata.busyWait() > 0) {
- QString bm = i18n("Line busy. Waiting: %1 seconds").arg(gpppdata.busyWait());
+ if(PPPData::data()->busyWait() > 0) {
+ QString bm = i18n("Line busy. Waiting: %1 seconds").arg(PPPData::data()->busyWait());
messg->setText(bm);
@@ -421,3 +421,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- pausetimer->start(gpppdata.busyWait()*1000, true);
+ pausetimer->start(PPPData::data()->busyWait()*1000, true);
timeout_timer->stop();
@@ -431,3 +431,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- if(readbuffer.contains(gpppdata.modemNoDialtoneResp())) {
+ if(readbuffer.contains(PPPData::data()->modemNoDialtoneResp())) {
timeout_timer->stop();
@@ -440,3 +440,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- if(readbuffer.contains(gpppdata.modemNoCarrierResp())) {
+ if(readbuffer.contains(PPPData::data()->modemNoCarrierResp())) {
timeout_timer->stop();
@@ -459,3 +459,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
vmain = 2;
- scriptTimeout=gpppdata.modemTimeout()*1000;
+ scriptTimeout=PPPData::data()->modemTimeout()*1000;
return;
@@ -496,6 +496,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if (scriptArgument.lower() == "password") {
- gpppdata.setPassword(scanvar);
+ PPPData::data()->setPassword(scanvar);
p_kppp->setPW_Edit(scanvar);
- if(gpppdata.storePassword())
- gpppdata.setStoredPassword(scanvar);
+ if(PPPData::data()->storePassword())
+ PPPData::data()->setStoredPassword(scanvar);
firstrunPW = true;
@@ -515,4 +515,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
QRegExp re2("%PASSWORD%");
- arg = arg.replace(re1, gpppdata.storedUsername());
- arg = arg.replace(re2, gpppdata.storedPassword());
+ arg = arg.replace(re1, PPPData::data()->storedUsername());
+ arg = arg.replace(re2, PPPData::data()->storedPassword());
@@ -580,4 +580,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- writeline(gpppdata.modemHangupStr());
- setExpect(gpppdata.modemHangupResp());
+ writeline(PPPData::data()->modemHangupStr());
+ setExpect(PPPData::data()->modemHangupResp());
@@ -594,3 +594,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- setExpect(gpppdata.modemRingResp());
+ setExpect(PPPData::data()->modemRingResp());
vmain = 150;
@@ -604,3 +604,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- QString idstring = gpppdata.storedUsername();
+ QString idstring = PPPData::data()->storedUsername();
@@ -640,3 +640,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- QString pwstring = gpppdata.password();
+ QString pwstring = PPPData::data()->password();
@@ -787,4 +787,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if(!expecting) {
- writeline(gpppdata.modemAnswerStr());
- setExpect(gpppdata.modemAnswerResp());
+ writeline(PPPData::data()->modemAnswerStr());
+ setExpect(PPPData::data()->modemAnswerResp());
@@ -816,3 +816,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- if(gpppdata.authMethod() == AUTH_TERMINAL) {
+ if(PPPData::data()->authMethod() == AUTH_TERMINAL) {
// if (termwindow) {
@@ -837,4 +837,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
- if_timeout_timer->start(gpppdata.pppdTimeout()*1000);
- qDebug( "started if timeout timer with %i", gpppdata.pppdTimeout()*1000);
+ if_timeout_timer->start(PPPData::data()->pppdTimeout()*1000);
+ qDebug( "started if timeout timer with %i", PPPData::data()->pppdTimeout()*1000);
@@ -851,3 +851,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
if(result) {
- if(!gpppdata.autoDNS())
+ if(!PPPData::data()->autoDNS())
adddns();
@@ -1065,3 +1065,3 @@ void ConnectWidget::if_waiting_timed_out() {
- gpppdata.setpppdError(E_IF_TIMEOUT);
+ PPPData::data()->setpppdError(E_IF_TIMEOUT);
@@ -1090,3 +1090,3 @@ void ConnectWidget::if_waiting_slot() {
-// if(gpppdata.pppdError() != 0) {
+// if(PPPData::data()->pppdError() != 0) {
// // we are here if pppd died immediately after starting it.
@@ -1107,3 +1107,3 @@ void ConnectWidget::if_waiting_slot() {
- if(gpppdata.autoDNS())
+ if(PPPData::data()->autoDNS())
addpeerdns();
@@ -1116,3 +1116,3 @@ void ConnectWidget::if_waiting_slot() {
- if(!gpppdata.command_on_connect().isEmpty()) {
+ if(!PPPData::data()->command_on_connect().isEmpty()) {
messg->setText(i18n("Running startup command..."));
@@ -1121,3 +1121,3 @@ void ConnectWidget::if_waiting_slot() {
qApp->flushX();
- execute_command(gpppdata.command_on_connect());
+ execute_command(PPPData::data()->command_on_connect());
messg->setText(i18n("Done"));
@@ -1143,3 +1143,3 @@ void ConnectWidget::if_waiting_slot() {
- if (gpppdata.get_dock_into_panel()) {
+ if (PPPData::data()->get_dock_into_panel()) {
// DockWidget::dock_widget->show();
@@ -1151,3 +1151,3 @@ void ConnectWidget::if_waiting_slot() {
- if(gpppdata.get_iconify_on_connect()) {
+ if(PPPData::data()->get_iconify_on_connect()) {
// p_kppp->con_win->showMinimized();
@@ -1170,5 +1170,5 @@ bool ConnectWidget::execppp() {
// command += " ";
- // command += gpppdata.modemDevice();
+ // command += PPPData::data()->modemDevice();
- command += " " + gpppdata.speed();
+ command += " " + PPPData::data()->speed();
@@ -1176,7 +1176,7 @@ bool ConnectWidget::execppp() {
- if(gpppdata.ipaddr() != "0.0.0.0" ||
- gpppdata.gateway() != "0.0.0.0") {
- if(gpppdata.ipaddr() != "0.0.0.0") {
+ if(PPPData::data()->ipaddr() != "0.0.0.0" ||
+ PPPData::data()->gateway() != "0.0.0.0") {
+ if(PPPData::data()->ipaddr() != "0.0.0.0") {
command += " ";
- command += gpppdata.ipaddr();
+ command += PPPData::data()->ipaddr();
command += ":";
@@ -1188,11 +1188,11 @@ bool ConnectWidget::execppp() {
- if(gpppdata.gateway() != "0.0.0.0")
- command += gpppdata.gateway();
+ if(PPPData::data()->gateway() != "0.0.0.0")
+ command += PPPData::data()->gateway();
}
- if(gpppdata.subnetmask() != "0.0.0.0")
- command += " netmask " + gpppdata.subnetmask();
+ if(PPPData::data()->subnetmask() != "0.0.0.0")
+ command += " netmask " + PPPData::data()->subnetmask();
- if(gpppdata.flowcontrol() != "None") {
- if(gpppdata.flowcontrol() == "CRTSCTS")
+ if(PPPData::data()->flowcontrol() != "None") {
+ if(PPPData::data()->flowcontrol() == "CRTSCTS")
command += " crtscts";
@@ -1202,9 +1202,9 @@ bool ConnectWidget::execppp() {
- if(gpppdata.defaultroute())
+ if(PPPData::data()->defaultroute())
command += " defaultroute";
- if(gpppdata.autoDNS())
+ if(PPPData::data()->autoDNS())
command += " usepeerdns";
- QStringList &arglist = gpppdata.pppdArgument();
+ QStringList &arglist = PPPData::data()->pppdArgument();
for ( QStringList::Iterator it = arglist.begin();
@@ -1217,5 +1217,5 @@ bool ConnectWidget::execppp() {
// PAP settings
- if(gpppdata.authMethod() == AUTH_PAP) {
+ if(PPPData::data()->authMethod() == AUTH_PAP) {
command += " -chap user ";
- command = command + "\"" + gpppdata.storedUsername() + "\"";
+ command = command + "\"" + PPPData::data()->storedUsername() + "\"";
}
@@ -1223,5 +1223,5 @@ bool ConnectWidget::execppp() {
// CHAP settings
- if(gpppdata.authMethod() == AUTH_CHAP) {
+ if(PPPData::data()->authMethod() == AUTH_CHAP) {
command += " -pap user ";
- command = command + "\"" + gpppdata.storedUsername() + "\"";
+ command = command + "\"" + PPPData::data()->storedUsername() + "\"";
}
@@ -1229,5 +1229,5 @@ bool ConnectWidget::execppp() {
// PAP/CHAP settings
- if(gpppdata.authMethod() == AUTH_PAPCHAP) {
+ if(PPPData::data()->authMethod() == AUTH_PAPCHAP) {
command += " user ";
- command = command + "\"" + gpppdata.storedUsername() + "\"";
+ command = command + "\"" + PPPData::data()->storedUsername() + "\"";
}
@@ -1235,3 +1235,3 @@ bool ConnectWidget::execppp() {
// check for debug
- if(gpppdata.getPPPDebug())
+ if(PPPData::data()->getPPPDebug())
command += " debug";
@@ -1279,4 +1279,4 @@ void auto_hostname() {
- // if (!p_kppp->stats->local_ip_address.isEmpty() && gpppdata.autoname()) {
- if ( gpppdata.autoname()) {
+ // if (!p_kppp->stats->local_ip_address.isEmpty() && PPPData::data()->autoname()) {
+ if ( PPPData::data()->autoname()) {
// local_ip.s_addr=inet_addr(p_kppp->stats->local_ip_address.ascii());
@@ -1334,3 +1334,3 @@ void add_domain(const QString &domain) {
&& !resolv[j].contains("#kppp temp entry")
- && gpppdata.exDNSDisabled()))
+ && PPPData::data()->exDNSDisabled()))
&& !resolv[j].contains("#entry disabled by kppp")) {
@@ -1357,3 +1357,3 @@ void adddns()
if ((fd = Modem::modem->openResolv(O_WRONLY|O_APPEND)) >= 0) {
- QStringList &dnslist = gpppdata.dns();
+ QStringList &dnslist = PPPData::data()->dns();
for ( QStringList::Iterator it = dnslist.begin();
@@ -1368,3 +1368,3 @@ void adddns()
}
- add_domain(gpppdata.domain());
+ add_domain(PPPData::data()->domain());
}
@@ -1389,3 +1389,3 @@ void addpeerdns() {
}
- add_domain(gpppdata.domain());
+ add_domain(PPPData::data()->domain());
}