summaryrefslogtreecommitdiffstats
path: root/kppp/connect.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
commit69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch)
tree073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kppp/connect.cpp
parent3467e6464beac3a162839bf7078e22e3a74d73e7 (diff)
downloadtdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz
tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kppp/connect.cpp')
-rw-r--r--kppp/connect.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/kppp/connect.cpp b/kppp/connect.cpp
index 0ab7f662..bb2c17a2 100644
--- a/kppp/connect.cpp
+++ b/kppp/connect.cpp
@@ -78,8 +78,8 @@ TQString old_hostname;
bool modified_hostname;
-ConnectWidget::ConnectWidget(TQWidget *parent, const char *name, PPPStats *st)
- : TQWidget(parent, name),
+ConnectWidget::ConnectWidget(TQWidget *tqparent, const char *name, PPPStats *st)
+ : TQWidget(tqparent, name),
// initialize some important variables
myreadbuffer(""),
main_timer_ID(0),
@@ -109,11 +109,11 @@ ConnectWidget::ConnectWidget(TQWidget *parent, const char *name, PPPStats *st)
l0->addSpacing(10);
messg = new TQLabel(this, "messg");
messg->setFrameStyle(TQFrame::Panel|TQFrame::Sunken);
- messg->setAlignment(AlignCenter);
+ messg->tqsetAlignment(AlignCenter);
messg->setText(i18n("Unable to create modem lock file."));
- messg->setMinimumHeight(messg->sizeHint().height() + 5);
- int messw = (messg->sizeHint().width() * 12) / 10;
- messw = QMAX(messw,280);
+ messg->setMinimumHeight(messg->tqsizeHint().height() + 5);
+ int messw = (messg->tqsizeHint().width() * 12) / 10;
+ messw = TQMAX(messw,280);
messg->setMinimumWidth(messw);
messg->setText(i18n("Looking for modem..."));
l0->addWidget(messg);
@@ -131,16 +131,16 @@ ConnectWidget::ConnectWidget(TQWidget *parent, const char *name, PPPStats *st)
cancel->setFocus();
connect(cancel, TQT_SIGNAL(clicked()), TQT_SLOT(cancelbutton()));
- int maxw = QMAX(cancel->sizeHint().width(),
- debug->sizeHint().width());
- maxw = QMAX(maxw,65);
+ int maxw = TQMAX(cancel->tqsizeHint().width(),
+ debug->tqsizeHint().width());
+ maxw = TQMAX(maxw,65);
debug->setFixedWidth(maxw);
cancel->setFixedWidth(maxw);
l1->addWidget(debug);
l1->addWidget(cancel);
l1->addSpacing(10);
- setFixedSize(sizeHint());
+ setFixedSize(tqsizeHint());
pausetimer = new TQTimer(this);
connect(pausetimer, TQT_SIGNAL(timeout()), TQT_SLOT(pause()));
@@ -210,7 +210,7 @@ void ConnectWidget::init() {
comlist = &gpppdata.scriptType();
arglist = &gpppdata.script();
- TQString tit = i18n("Connecting to: %1").arg(gpppdata.accname());
+ TQString tit = i18n("Connecting to: %1").tqarg(gpppdata.accname());
setCaption(tit);
kapp->processEvents();
@@ -259,7 +259,7 @@ void ConnectWidget::init() {
semaphore = false;
Modem::modem->stop();
- Modem::modem->notify(this, TQT_SLOT(readChar(unsigned char)));
+ Modem::modem->notify(TQT_TQOBJECT(this), TQT_SLOT(readChar(unsigned char)));
// if we are stuck anywhere we will time out
timeout_timer->start(gpppdata.modemTimeout()*1000);
@@ -398,7 +398,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
TQStringList &plist = gpppdata.phonenumbers();
TQString bmarg= gpppdata.dialPrefix();
bmarg += *plist.at(dialnumber);
- TQString bm = i18n("Dialing %1").arg(bmarg);
+ TQString bm = i18n("Dialing %1").tqarg(bmarg);
messg->setText(bm);
emit debugMessage(bm);
@@ -425,7 +425,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
return;
}
- if(readbuffer.contains(gpppdata.modemBusyResp())) {
+ if(readbuffer.tqcontains(gpppdata.modemBusyResp())) {
timeout_timer->stop();
timeout_timer->start(gpppdata.modemTimeout()*1000);
@@ -434,7 +434,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
Modem::modem->hangup();
if(gpppdata.busyWait() > 0) {
- TQString bm = i18n("Line busy. Waiting: %1 seconds").arg(gpppdata.busyWait());
+ TQString bm = i18n("Line busy. Waiting: %1 seconds").tqarg(gpppdata.busyWait());
messg->setText(bm);
emit debugMessage(bm);
@@ -451,7 +451,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
return;
}
- if(readbuffer.contains(gpppdata.modemNoDialtoneResp())) {
+ if(readbuffer.tqcontains(gpppdata.modemNoDialtoneResp())) {
timeout_timer->stop();
messg->setText(i18n("No Dial Tone"));
@@ -461,13 +461,13 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
return;
}
- if(readbuffer.contains(gpppdata.modemNoCarrierResp())) {
+ if(readbuffer.tqcontains(gpppdata.modemNoCarrierResp())) {
if (gpppdata.get_redial_on_nocarrier()) {
timeout_timer->stop();
timeout_timer->start(gpppdata.modemTimeout()*1000);
if(gpppdata.busyWait() > 0) {
- TQString bm = i18n("No carrier. Waiting: %1 seconds").arg(gpppdata.busyWait());
+ TQString bm = i18n("No carrier. Waiting: %1 seconds").tqarg(gpppdata.busyWait());
messg->setText(bm);
emit debugMessage(bm);
@@ -492,7 +492,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
return;
}
- if(readbuffer.contains(gpppdata.modemDLPResp())) {
+ if(readbuffer.tqcontains(gpppdata.modemDLPResp())) {
timeout_timer->stop();
messg->setText(i18n("Digital Line Protection Detected."));
@@ -553,7 +553,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
}
if (scriptCommand == "Scan") {
- TQString bm = i18n("Scanning %1").arg(scriptArgument);
+ TQString bm = i18n("Scanning %1").tqarg(scriptArgument);
messg->setText(bm);
emit debugMessage(bm);
@@ -563,7 +563,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
}
if (scriptCommand == "Save") {
- TQString bm = i18n("Saving %1").arg(scriptArgument);
+ TQString bm = i18n("Saving %1").tqarg(scriptArgument);
messg->setText(bm);
emit debugMessage(bm);
@@ -583,18 +583,18 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
if (scriptCommand == "Send" || scriptCommand == "SendNoEcho") {
TQString bm = i18n("Sending %1");
- // replace %USERNAME% and %PASSWORD%
+ // tqreplace %USERNAME% and %PASSWORD%
TQString arg = scriptArgument;
TQRegExp re1("%USERNAME%");
TQRegExp re2("%PASSWORD%");
- arg = arg.replace(re1, gpppdata.storedUsername());
- arg = arg.replace(re2, gpppdata.storedPassword());
+ arg = arg.tqreplace(re1, gpppdata.storedUsername());
+ arg = arg.tqreplace(re2, gpppdata.storedPassword());
if (scriptCommand == "Send")
- bm = bm.arg(scriptArgument);
+ bm = bm.tqarg(scriptArgument);
else {
for(uint i = 0; i < scriptArgument.length(); i++)
- bm = bm.arg("*");
+ bm = bm.tqarg("*");
}
messg->setText(bm);
@@ -606,7 +606,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
}
if (scriptCommand == "Expect") {
- TQString bm = i18n("Expecting %1").arg(scriptArgument);
+ TQString bm = i18n("Expecting %1").tqarg(scriptArgument);
messg->setText(bm);
emit debugMessage(bm);
@@ -620,7 +620,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
if (scriptCommand == "Pause") {
- TQString bm = i18n("Pause %1 seconds").arg(scriptArgument);
+ TQString bm = i18n("Pause %1 seconds").tqarg(scriptArgument);
messg->setText(bm);
emit debugMessage(bm);
@@ -637,7 +637,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
timeout_timer->stop();
- TQString bm = i18n("Timeout %1 seconds").arg(scriptArgument);
+ TQString bm = i18n("Timeout %1 seconds").tqarg(scriptArgument);
messg->setText(bm);
emit debugMessage(bm);
@@ -672,7 +672,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
}
if (scriptCommand == "ID") {
- TQString bm = i18n("ID %1").arg(scriptArgument);
+ TQString bm = i18n("ID %1").tqarg(scriptArgument);
messg->setText(bm);
emit debugMessage(bm);
@@ -708,7 +708,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
}
if (scriptCommand == "Password") {
- TQString bm = i18n("Password %1").arg(scriptArgument);
+ TQString bm = i18n("Password %1").tqarg(scriptArgument);
messg->setText(bm);
emit debugMessage(bm);
@@ -752,13 +752,13 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
// variable (from the subsequent scan).
TQString ts = scriptArgument;
- int vstart = ts.find( "##" );
+ int vstart = ts.tqfind( "##" );
if( vstart != -1 ) {
ts.remove( vstart, 2 );
ts.insert( vstart, scanvar );
}
- bm = bm.arg(ts);
+ bm = bm.tqarg(ts);
messg->setText(bm);
emit debugMessage(bm);
@@ -782,7 +782,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
}
if (scriptCommand == "PWPrompt") {
- TQString bm = i18n("PW Prompt %1").arg(scriptArgument);
+ TQString bm = i18n("PW Prompt %1").tqarg(scriptArgument);
messg->setText(bm);
emit debugMessage(bm);
@@ -807,7 +807,7 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
if (scriptCommand == "LoopStart") {
- TQString bm = i18n("Loop Start %1").arg(scriptArgument);
+ TQString bm = i18n("Loop Start %1").tqarg(scriptArgument);
// The incrementing of the scriptindex MUST be before the
// call to setExpect otherwise the expect will miss a string that is
@@ -832,9 +832,9 @@ void ConnectWidget::timerEvent(TQTimerEvent *) {
}
if (scriptCommand == "LoopEnd") {
- TQString bm = i18n("Loop End %1").arg(scriptArgument);
+ TQString bm = i18n("Loop End %1").tqarg(scriptArgument);
if ( loopnest <= 0 ) {
- bm = i18n("LoopEnd without matching Start. Line: %1").arg(bm);
+ bm = i18n("LoopEnd without matching Start. Line: %1").tqarg(bm);
vmain=20;
cancelbutton();
KMessageBox::error(0, bm);
@@ -994,26 +994,26 @@ void ConnectWidget::checkBuffers() {
// Let's check if we are finished with scanning:
// The scanstring have to be in the buffer and the latest character
// was a carriage return or an linefeed (depending on modem setup)
- if( scanning && scanbuffer.contains(scanstr) &&
+ if( scanning && scanbuffer.tqcontains(scanstr) &&
( scanbuffer.right(1) == "\n" || scanbuffer.right(1) == "\r") ) {
scanning = false;
- int vstart = scanbuffer.find( scanstr ) + scanstr.length();
+ int vstart = scanbuffer.tqfind( scanstr ) + scanstr.length();
scanvar = scanbuffer.mid( vstart, scanbuffer.length() - vstart);
scanvar = scanvar.stripWhiteSpace();
// Show the Variabel content in the debug window
- TQString sv = i18n("Scan Var: %1").arg(scanvar);
+ TQString sv = i18n("Scan Var: %1").tqarg(scanvar);
emit debugMessage(sv);
}
if(expecting) {
- if(readbuffer.contains(expectstr)) {
+ if(readbuffer.tqcontains(expectstr)) {
expecting = false;
// keep everything after the expected string
- readbuffer.remove(0, readbuffer.find(expectstr) + expectstr.length());
+ readbuffer.remove(0, readbuffer.tqfind(expectstr) + expectstr.length());
- TQString ts = i18n("Found: %1").arg(expectstr);
+ TQString ts = i18n("Found: %1").tqarg(expectstr);
emit debugMessage(ts);
if (loopend) {
@@ -1021,10 +1021,10 @@ void ConnectWidget::checkBuffers() {
}
}
- if (loopend && readbuffer.contains(loopstr[loopnest])) {
+ if (loopend && readbuffer.tqcontains(loopstr[loopnest])) {
expecting = false;
readbuffer = "";
- TQString ts = i18n("Looping: %1").arg(loopstr[loopnest]);
+ TQString ts = i18n("Looping: %1").tqarg(loopstr[loopnest]);
emit debugMessage(ts);
scriptindex = loopstartindex[loopnest];
loopend = false;
@@ -1117,7 +1117,7 @@ void ConnectWidget::setScan(const TQString &n) {
scanstr = n;
scanbuffer = "";
- TQString ts = i18n("Scanning: %1").arg(n);
+ TQString ts = i18n("Scanning: %1").tqarg(n);
emit debugMessage(ts);
}
@@ -1126,8 +1126,8 @@ void ConnectWidget::setExpect(const TQString &n) {
expecting = true;
expectstr = n;
- TQString ts = i18n("Expecting: %1").arg(n);
- ts.replace(TQRegExp("\n"), "<LF>");
+ TQString ts = i18n("Expecting: %1").tqarg(n);
+ ts.tqreplace(TQRegExp("\n"), "<LF>");
emit debugMessage(ts);
// check if the expected string is in the read buffer already.
@@ -1271,8 +1271,8 @@ bool ConnectWidget::execppp() {
command += gpppdata.gateway();
}
- if(gpppdata.subnetmask() != "0.0.0.0")
- command += " netmask " + gpppdata.subnetmask();
+ if(gpppdata.subnettqmask() != "0.0.0.0")
+ command += " nettqmask " + gpppdata.subnettqmask();
// the english/i18n mix below is ugly but we want to keep working
// after someone changed the code to use i18n'ed config values
@@ -1374,7 +1374,7 @@ void auto_hostname() {
gethostname(tmp_str, sizeof(tmp_str));
tmp_str[sizeof(tmp_str)-1]=0; // panic
- old_hostname=tmp_str; // copy to QString
+ old_hostname=tmp_str; // copy to TQString
if (!p_kppp->stats->local_ip_address.isEmpty() && gpppdata.autoname()) {
local_ip.s_addr=inet_addr(p_kppp->stats->local_ip_address.ascii());
@@ -1382,7 +1382,7 @@ void auto_hostname() {
if (hostname_entry != 0L) {
new_hostname=hostname_entry->h_name;
- dot=new_hostname.find('.');
+ dot=new_hostname.tqfind('.');
new_hostname=new_hostname.remove(dot,new_hostname.length()-dot);
Requester::rq->setHostname(new_hostname);
modified_hostname = TRUE;
@@ -1427,11 +1427,11 @@ void add_domain(const TQString &domain) {
write(fd, tmp.data(), tmp.length());
for(int j=0; j < i; j++) {
- if((resolv[j].contains("domain") ||
- ( resolv[j].contains("nameserver")
- && !resolv[j].contains("#kppp temp entry")
+ if((resolv[j].tqcontains("domain") ||
+ ( resolv[j].tqcontains("nameserver")
+ && !resolv[j].tqcontains("#kppp temp entry")
&& gpppdata.exDNSDisabled()))
- && !resolv[j].contains("#entry disabled by kppp")) {
+ && !resolv[j].tqcontains("#entry disabled by kppp")) {
TQCString tmp = "# " + resolv[j].local8Bit() +
" \t#entry disabled by kppp\n";
write(fd, tmp, tmp.length());
@@ -1510,8 +1510,8 @@ void removedns() {
if((fd = Requester::rq->openResolv(O_WRONLY|O_TRUNC)) >= 0) {
for(int j=0; j < i; j++) {
- if(resolv[j].contains("#kppp temp entry")) continue;
- if(resolv[j].contains("#entry disabled by kppp")) {
+ if(resolv[j].tqcontains("#kppp temp entry")) continue;
+ if(resolv[j].tqcontains("#entry disabled by kppp")) {
TQCString tmp = resolv[j].local8Bit();
write(fd, tmp.data()+2, tmp.length() - 27);
write(fd, "\n", 1);