summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/smpppdcs/smpppdsearcher.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 /kopete/plugins/smpppdcs/smpppdsearcher.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 'kopete/plugins/smpppdcs/smpppdsearcher.cpp')
-rw-r--r--kopete/plugins/smpppdcs/smpppdsearcher.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/kopete/plugins/smpppdcs/smpppdsearcher.cpp b/kopete/plugins/smpppdcs/smpppdsearcher.cpp
index 6ee9c878..a06e30a9 100644
--- a/kopete/plugins/smpppdcs/smpppdsearcher.cpp
+++ b/kopete/plugins/smpppdcs/smpppdsearcher.cpp
@@ -14,8 +14,8 @@
*************************************************************************
*/
-#include <qregexp.h>
-#include <qfile.h>
+#include <tqregexp.h>
+#include <tqfile.h>
#include <kprocess.h>
#include <kdebug.h>
@@ -46,7 +46,7 @@ void SMPPPDSearcher::searchNetwork() {
m_procNetstat->setEnvironment("LANG", "C"); // we want to force english output
*m_procNetstat << "/bin/netstat" << "-rn";
- connect(m_procNetstat, SIGNAL(receivedStdout(KProcess *,char *,int)), this, SLOT(slotStdoutReceivedNetstat(KProcess *,char *,int)));
+ connect(m_procNetstat, TQT_SIGNAL(receivedStdout(KProcess *,char *,int)), this, TQT_SLOT(slotStdoutReceivedNetstat(KProcess *,char *,int)));
if(!m_procNetstat->start(KProcess::Block, KProcess::Stdout)) {
kdDebug(14312) << k_funcinfo << "Couldn't execute /sbin/netstat -rn" << endl << "Perhaps the package net-tools isn't installed." << endl;
@@ -64,11 +64,11 @@ void SMPPPDSearcher::searchNetwork() {
void SMPPPDSearcher::slotStdoutReceivedIfconfig(KProcess * /* proc */, char * buf, int len) {
kdDebug(14312) << k_funcinfo << endl;
- QString myBuf = QString::fromLatin1(buf,len);
- QRegExp rex("^[ ]{10}.*inet addr:([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}).*Mask:([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})");
+ TQString myBuf = TQString::fromLatin1(buf,len);
+ TQRegExp rex("^[ ]{10}.*inet addr:([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}).*Mask:([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})");
// tokenize the string into lines
- QStringList toks = QStringList::split("\n", myBuf);
- for(QStringList::size_type i = 0; i < toks.count(); i++) {
+ TQStringList toks = TQStringList::split("\n", myBuf);
+ for(TQStringList::size_type i = 0; i < toks.count(); i++) {
if(rex.exactMatch(toks[i])) {
if(scan(rex.cap(1), rex.cap(2))) {
return;
@@ -81,8 +81,8 @@ void SMPPPDSearcher::slotStdoutReceivedIfconfig(KProcess * /* proc */, char * bu
void SMPPPDSearcher::slotStdoutReceivedNetstat(KProcess * /* proc */, char * buf, int len) {
kdDebug(14312) << k_funcinfo << endl;
- QRegExp rexGW(".*\\n0.0.0.0[ ]*([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}).*");
- QString myBuf = QString::fromLatin1(buf,len);
+ TQRegExp rexGW(".*\\n0.0.0.0[ ]*([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}).*");
+ TQString myBuf = TQString::fromLatin1(buf,len);
if(!(rexGW.exactMatch(myBuf) && scan(rexGW.cap(1), "255.255.255.255"))) {
// if netstat -r found no gateway we search the network
@@ -90,7 +90,7 @@ void SMPPPDSearcher::slotStdoutReceivedNetstat(KProcess * /* proc */, char * buf
m_procIfconfig->setEnvironment("LANG", "C"); // we want to force english output
*m_procIfconfig << "/sbin/ifconfig";
- connect(m_procIfconfig, SIGNAL(receivedStdout(KProcess *,char *,int)), this, SLOT(slotStdoutReceivedIfconfig(KProcess *,char *,int)));
+ connect(m_procIfconfig, TQT_SIGNAL(receivedStdout(KProcess *,char *,int)), this, TQT_SLOT(slotStdoutReceivedIfconfig(KProcess *,char *,int)));
if(!m_procIfconfig->start(KProcess::Block, KProcess::Stdout)) {
kdDebug(14312) << k_funcinfo << "Couldn't execute /sbin/ifconfig" << endl << "Perhaps the package net-tools isn't installed." << endl;
@@ -105,7 +105,7 @@ void SMPPPDSearcher::slotStdoutReceivedNetstat(KProcess * /* proc */, char * buf
/*!
\fn SMPPPDSearcher::scan() const
*/
-bool SMPPPDSearcher::scan(const QString& ip, const QString& mask) {
+bool SMPPPDSearcher::scan(const TQString& ip, const TQString& mask) {
kdDebug(14312) << k_funcinfo << "Scanning " << ip << "/" << mask << "..." << endl;
SMPPPD::Client client;
@@ -124,12 +124,12 @@ bool SMPPPDSearcher::scan(const QString& ip, const QString& mask) {
uint max_range = 255;
// calculate ip range (only last mask entry)
- QRegExp lastRex("([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})");
+ TQRegExp lastRex("([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})");
if(lastRex.exactMatch(ip)) {
uint lastWordIP = lastRex.cap(4).toUInt();
- QStringList ipToks;
+ TQStringList ipToks;
for(int i = 1; i < 5; i++) {
ipToks.push_back(lastRex.cap(i));
}
@@ -164,7 +164,7 @@ bool SMPPPDSearcher::scan(const QString& ip, const QString& mask) {
emit scanProgress(i);
}
- if(client.connect(QString(ipToks[0] + "." + ipToks[1] + "." + ipToks[2] + "." + QString::number(i)), 3185)) {
+ if(client.connect(TQString(ipToks[0] + "." + ipToks[1] + "." + ipToks[2] + "." + TQString::number(i)), 3185)) {
client.disconnect();
emit smpppdFound(ip);
if(range > 1) {
@@ -174,7 +174,7 @@ bool SMPPPDSearcher::scan(const QString& ip, const QString& mask) {
}
#ifndef NDEBUG
else {
- kdDebug(14312) << k_funcinfo << "No smpppd found at " << QString(ipToks[0] + "." + ipToks[1] + "." + ipToks[2] + "." + QString::number(i)) << endl;
+ kdDebug(14312) << k_funcinfo << "No smpppd found at " << TQString(ipToks[0] + "." + ipToks[1] + "." + ipToks[2] + "." + TQString::number(i)) << endl;
}
#endif
}