summaryrefslogtreecommitdiffstats
path: root/kppp/modem.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kppp/modem.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kppp/modem.cpp')
-rw-r--r--kppp/modem.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kppp/modem.cpp b/kppp/modem.cpp
index 86ac3169..4d31fe59 100644
--- a/kppp/modem.cpp
+++ b/kppp/modem.cpp
@@ -30,7 +30,7 @@
#include <signal.h>
#include <sys/ioctl.h>
#include <setjmp.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <assert.h>
#include "modem.h"
@@ -120,7 +120,7 @@ speed_t Modem::modemspeed() {
bool Modem::opentty() {
// int flags;
- QString device = "";
+ TQString device = "";
if (args->isSet("dev"))
device = args->getOption("dev");
else
@@ -183,7 +183,7 @@ bool Modem::opentty() {
// the english/i18n mix below is ugly but we want to keep working
// after someone changed the code to use i18n'ed config values
- QString flowCtrl = gpppdata.flowcontrol();
+ TQString flowCtrl = gpppdata.flowcontrol();
if(flowCtrl != "None" && flowCtrl != i18n("None")) {
if(flowCtrl == "CRTSCTS" || flowCtrl == i18n("Hardware [CRTSCTS]")) {
tty.c_cflag |= CRTSCTS;
@@ -252,14 +252,14 @@ void Modem::readtty(int) {
}
-void Modem::notify(const QObject *receiver, const char *member) {
- connect(this, SIGNAL(charWaiting(unsigned char)), receiver, member);
+void Modem::notify(const TQObject *receiver, const char *member) {
+ connect(this, TQT_SIGNAL(charWaiting(unsigned char)), receiver, member);
startNotifier();
}
void Modem::stop() {
- disconnect(SIGNAL(charWaiting(unsigned char)));
+ disconnect(TQT_SIGNAL(charWaiting(unsigned char)));
stopNotifier();
}
@@ -267,11 +267,11 @@ void Modem::stop() {
void Modem::startNotifier() {
if(modemfd >= 0) {
if(sn == 0) {
- sn = new QSocketNotifier(modemfd, QSocketNotifier::Read, this);
- connect(sn, SIGNAL(activated(int)), SLOT(readtty(int)));
- kdDebug(5002) << "QSocketNotifier started!" << endl;
+ sn = new TQSocketNotifier(modemfd, TQSocketNotifier::Read, this);
+ connect(sn, TQT_SIGNAL(activated(int)), TQT_SLOT(readtty(int)));
+ kdDebug(5002) << "TQSocketNotifier started!" << endl;
} else {
- // Debug("QSocketNotifier re-enabled!");
+ // Debug("TQSocketNotifier re-enabled!");
sn->setEnabled(true);
}
}
@@ -284,7 +284,7 @@ void Modem::stopNotifier() {
disconnect(sn);
delete sn;
sn = 0;
- kdDebug(5002) << "QSocketNotifier stopped!" << endl;
+ kdDebug(5002) << "TQSocketNotifier stopped!" << endl;
}
}
@@ -314,7 +314,7 @@ bool Modem::writeLine(const char *buf) {
char *b = new char[len+2];
memcpy(b, buf, len);
// different modems seem to need different line terminations
- QString term = gpppdata.enter();
+ TQString term = gpppdata.enter();
if(term == "LF")
b[len++]='\n';
else if(term == "CR")
@@ -422,7 +422,7 @@ void Modem::escape_to_command_mode() {
// +3 because quiet time must be greater than guard time.
usleep((gpppdata.modemEscapeGuardTime()+3)*20000);
- QCString tmp = gpppdata.modemEscapeStr().local8Bit();
+ TQCString tmp = gpppdata.modemEscapeStr().local8Bit();
write(modemfd, tmp.data(), tmp.length());
tcflush(modemfd, TCIOFLUSH);
usleep((gpppdata.modemEscapeGuardTime()+3)*20000);
@@ -431,35 +431,35 @@ void Modem::escape_to_command_mode() {
}
-const QString Modem::modemMessage() {
+const TQString Modem::modemMessage() {
return errmsg;
}
-QString Modem::parseModemSpeed(const QString &s) {
+TQString Modem::parseModemSpeed(const TQString &s) {
// this is a small (and bad) parser for modem speeds
int rx = -1;
int tx = -1;
int i;
- QString result;
+ TQString result;
kdDebug(5002) << "Modem reported result string: " << s << endl;
const int RXMAX = 7;
const int TXMAX = 2;
- QRegExp rrx[RXMAX] = {
- QRegExp("[0-9]+[:/ ]RX", false),
- QRegExp("[0-9]+RX", false),
- QRegExp("[/: -][0-9]+[/: ]", false),
- QRegExp("[/: -][0-9]+$", false),
- QRegExp("CARRIER [^0-9]*[0-9]+", false),
- QRegExp("CONNECT [^0-9]*[0-9]+", false),
- QRegExp("[0-9]+") // panic mode
+ TQRegExp rrx[RXMAX] = {
+ TQRegExp("[0-9]+[:/ ]RX", false),
+ TQRegExp("[0-9]+RX", false),
+ TQRegExp("[/: -][0-9]+[/: ]", false),
+ TQRegExp("[/: -][0-9]+$", false),
+ TQRegExp("CARRIER [^0-9]*[0-9]+", false),
+ TQRegExp("CONNECT [^0-9]*[0-9]+", false),
+ TQRegExp("[0-9]+") // panic mode
};
- QRegExp trx[TXMAX] = {
- QRegExp("[0-9]+[:/ ]TX", false),
- QRegExp("[0-9]+TX", false)
+ TQRegExp trx[TXMAX] = {
+ TQRegExp("[0-9]+[:/ ]TX", false),
+ TQRegExp("[0-9]+TX", false)
};
for(i = 0; i < RXMAX; i++) {
@@ -471,7 +471,7 @@ QString Modem::parseModemSpeed(const QString &s) {
// rrx[i] has been matched, idx contains the start of the match
// and len contains how long the match is. Extract the match.
//
- QString sub = s.mid(idx, len);
+ TQString sub = s.mid(idx, len);
//
// Now extract the digits only from the match, which will
@@ -498,7 +498,7 @@ QString Modem::parseModemSpeed(const QString &s) {
// trx[i] has been matched, idx contains the start of the match
// and len contains how long the match is. Extract the match.
//
- QString sub = s.mid(idx, len);
+ TQString sub = s.mid(idx, len);
//
// Now extract the digits only from the match, which will then
@@ -545,17 +545,17 @@ int Modem::lockdevice() {
if (modem_is_locked)
return 1;
- QString device = "";
+ TQString device = "";
if (args->isSet("dev"))
device = args->getOption("dev");
else
device = gpppdata.modemDevice();
- QString lockfile = LOCK_DIR"/LCK..";
+ TQString lockfile = LOCK_DIR"/LCK..";
lockfile += device.mid(5); // append everything after /dev/
- if(access(QFile::encodeName(lockfile), F_OK) == 0) {
- if ((fd = Requester::rq->openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) {
+ if(access(TQFile::encodeName(lockfile), F_OK) == 0) {
+ if ((fd = Requester::rq->openLockfile(TQFile::encodeName(lockfile), O_RDONLY)) >= 0) {
// Mario: it's not necessary to read more than lets say 32 bytes. If
// file has more than 32 bytes, skip the rest
char oldlock[33]; // safe