summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/smpppdcs/libsmpppdclient
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/libsmpppdclient
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/libsmpppdclient')
-rw-r--r--kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.cpp22
-rw-r--r--kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.h24
-rw-r--r--kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.cpp24
-rw-r--r--kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.h4
-rw-r--r--kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.cpp18
-rw-r--r--kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.h18
-rw-r--r--kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp36
-rw-r--r--kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.h4
8 files changed, 75 insertions, 75 deletions
diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.cpp b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.cpp
index d386b669..5ff1654b 100644
--- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.cpp
+++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.cpp
@@ -22,7 +22,7 @@
using namespace SMPPPD;
Client::Client()
- : m_state(NULL), m_sock(NULL), m_serverID(QString::null), m_serverVer(QString::null), m_password(QString::null) {
+ : m_state(NULL), m_sock(NULL), m_serverID(TQString::null), m_serverVer(TQString::null), m_password(TQString::null) {
changeState(Unsettled::instance());
}
@@ -30,7 +30,7 @@ Client::~Client() {
disconnect();
}
-bool Client::connect(const QString& server, uint port) {
+bool Client::connect(const TQString& server, uint port) {
return m_state->connect(this, server, port);
}
@@ -38,27 +38,27 @@ void Client::disconnect() {
m_state->disconnect(this);
}
-QStringList Client::getInterfaceConfigurations() {
+TQStringList Client::getInterfaceConfigurations() {
return m_state->getInterfaceConfigurations(this);
}
-bool Client::statusInterface(const QString& ifcfg) {
+bool Client::statusInterface(const TQString& ifcfg) {
return m_state->statusInterface(this, ifcfg);
}
-QString Client::serverID() const {
+TQString Client::serverID() const {
return m_serverID;
}
-QString Client::serverVersion() const {
+TQString Client::serverVersion() const {
return m_serverVer;
}
-QStringList Client::read() const {
- QStringList qsl;
+TQStringList Client::read() const {
+ TQStringList qsl;
if(isReady()) {
- QDataStream stream(m_sock);
+ TQDataStream stream(m_sock);
char s[1024];
stream.readRawBytes(s, 1023);
@@ -78,7 +78,7 @@ QStringList Client::read() const {
void Client::write(const char * cmd) {
if(isReady()) {
- QDataStream stream(m_sock);
+ TQDataStream stream(m_sock);
stream.writeRawBytes(cmd, strlen(cmd));
stream.writeRawBytes("\n", strlen("\n"));
m_sock->flush();
@@ -92,7 +92,7 @@ bool Client::isReady() const {
bool Client::isOnline() {
if(isReady()) {
- QStringList ifcfgs = getInterfaceConfigurations();
+ TQStringList ifcfgs = getInterfaceConfigurations();
for(uint i = 0; i < ifcfgs.count(); i++) {
if(statusInterface(ifcfgs[i])) {
return true;
diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.h b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.h
index a123cd4c..badda45c 100644
--- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.h
+++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdclient.h
@@ -17,7 +17,7 @@
#ifndef SMPPPDCLIENT_H
#define SMPPPDCLIENT_H
-#include <qstringlist.h>
+#include <tqstringlist.h>
namespace KNetwork {
class KStreamSocket;
@@ -40,38 +40,38 @@ public:
bool isReady() const;
- bool connect(const QString& server, uint port = 3185);
+ bool connect(const TQString& server, uint port = 3185);
void disconnect();
- QStringList getInterfaceConfigurations();
- bool statusInterface(const QString& ifcfg);
+ TQStringList getInterfaceConfigurations();
+ bool statusInterface(const TQString& ifcfg);
bool isOnline();
- QString serverID() const;
- QString serverVersion() const;
+ TQString serverID() const;
+ TQString serverVersion() const;
- void setPassword(const QString& password);
+ void setPassword(const TQString& password);
private:
friend class State;
void changeState(State * newState);
- QStringList read() const;
+ TQStringList read() const;
void write(const char * cmd);
private:
State * m_state;
KNetwork::KStreamSocket * m_sock;
- QString m_serverID;
- QString m_serverVer;
- QString m_password;
+ TQString m_serverID;
+ TQString m_serverVer;
+ TQString m_password;
};
inline void Client::changeState(State * newState) {
m_state = newState;
}
-inline void Client::setPassword(const QString& password) {
+inline void Client::setPassword(const TQString& password) {
m_password = password;
}
diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.cpp b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.cpp
index 421914bb..f51aa301 100644
--- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.cpp
+++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.cpp
@@ -14,7 +14,7 @@
*************************************************************************
*/
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kdebug.h>
#include <kstreamsocket.h>
@@ -48,33 +48,33 @@ void Ready::disconnect(Client * client) {
delete socket(client);
setSocket(client, NULL);
- setServerID(client, QString::null);
- setServerVersion(client, QString::null);
+ setServerID(client, TQString::null);
+ setServerVersion(client, TQString::null);
}
changeState(client, Unsettled::instance());
}
-QStringList Ready::getInterfaceConfigurations(Client * client) {
+TQStringList Ready::getInterfaceConfigurations(Client * client) {
- QStringList ifcfgs;
+ TQStringList ifcfgs;
// we want all ifcfgs
kdDebug(14312) << k_funcinfo << "smpppd req: list-ifcfgs" << endl;
write(client, "list-ifcfgs");
- QStringList stream = read(client);
+ TQStringList stream = read(client);
kdDebug(14312) << k_funcinfo << "smpppd ack: " << stream[0] << endl;
if(stream[0].startsWith("ok")) {
- // we have now a QStringList with all ifcfgs
+ // we have now a TQStringList with all ifcfgs
// we extract them and put them in the global ifcfgs-list
// stream[1] tells us how many ifcfgs are coming next
- QRegExp numIfcfgsRex("^BEGIN IFCFGS ([0-9]+).*");
+ TQRegExp numIfcfgsRex("^BEGIN IFCFGS ([0-9]+).*");
if(numIfcfgsRex.exactMatch(stream[1])) {
int count_ifcfgs = numIfcfgsRex.cap(1).toInt();
kdDebug(14312) << k_funcinfo << "ifcfgs: " << count_ifcfgs << endl;
for(int i = 0; i < count_ifcfgs; i++) {
- QRegExp ifcfgRex("^i \"(ifcfg-[a-zA-Z]+[0-9]+)\".*");
+ TQRegExp ifcfgRex("^i \"(ifcfg-[a-zA-Z]+[0-9]+)\".*");
if(ifcfgRex.exactMatch(stream[i+2])) {
ifcfgs.push_back(ifcfgRex.cap(1));
}
@@ -85,14 +85,14 @@ QStringList Ready::getInterfaceConfigurations(Client * client) {
return ifcfgs;
}
-bool Ready::statusInterface(Client * client, const QString& ifcfg) {
+bool Ready::statusInterface(Client * client, const TQString& ifcfg) {
- QString cmd = "list-status " + ifcfg;
+ TQString cmd = "list-status " + ifcfg;
write(client, cmd.latin1());
socket(client)->waitForMore(0);
- QStringList stream = read(client);
+ TQStringList stream = read(client);
if(stream[0].startsWith("ok")) {
if(stream[2].startsWith("status connected")) {
diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.h b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.h
index 9ec3ab93..f3be8667 100644
--- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.h
+++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdready.h
@@ -37,8 +37,8 @@ public:
static Ready * instance();
virtual void disconnect(Client * client);
- virtual QStringList getInterfaceConfigurations(Client * client);
- virtual bool statusInterface(Client * client, const QString& ifcfg);
+ virtual TQStringList getInterfaceConfigurations(Client * client);
+ virtual bool statusInterface(Client * client, const TQString& ifcfg);
private:
static Ready * m_instance;
diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.cpp b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.cpp
index 9e4bd508..8ae0f1d4 100644
--- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.cpp
+++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.cpp
@@ -25,7 +25,7 @@ State::State() {}
State::~State() {}
-QStringList State::read(Client * client) const {
+TQStringList State::read(Client * client) const {
return client->read();
}
@@ -41,19 +41,19 @@ KNetwork::KStreamSocket * State::socket(Client * client) const {
return client->m_sock;
}
-QString State::password(Client * client) const {
+TQString State::password(Client * client) const {
return client->m_password;
}
-void State::setPassword(Client * client, const QString& pass) {
+void State::setPassword(Client * client, const TQString& pass) {
client->m_password = pass;
}
-void State::setServerID(Client * client, const QString& id) {
+void State::setServerID(Client * client, const TQString& id) {
client->m_serverID = id;
}
-void State::setServerVersion(Client * client, const QString& ver) {
+void State::setServerVersion(Client * client, const TQString& ver) {
client->m_serverVer = ver;
}
@@ -61,16 +61,16 @@ void State::setSocket(Client * client, KNetwork::KStreamSocket * sock) {
client->m_sock = sock;
}
-bool State::connect(Client * /* client */, const QString& /* server */, uint /* port */) {
+bool State::connect(Client * /* client */, const TQString& /* server */, uint /* port */) {
return false;
}
void State::disconnect(Client * /* client */) {}
-QStringList State::getInterfaceConfigurations(Client * /* client */) {
- return QStringList();
+TQStringList State::getInterfaceConfigurations(Client * /* client */) {
+ return TQStringList();
}
-bool State::statusInterface(Client * /* client */, const QString& /* ifcfg */) {
+bool State::statusInterface(Client * /* client */, const TQString& /* ifcfg */) {
return false;
}
diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.h b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.h
index 0e7d393b..8f1ac32e 100644
--- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.h
+++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdstate.h
@@ -17,7 +17,7 @@
#ifndef SMPPPDSTATE_H
#define SMPPPDSTATE_H
-#include <qstringlist.h>
+#include <tqstringlist.h>
namespace SMPPPD {
@@ -34,22 +34,22 @@ public:
State();
virtual ~State();
- virtual bool connect(Client * client, const QString& server, uint port = 3185);
+ virtual bool connect(Client * client, const TQString& server, uint port = 3185);
virtual void disconnect(Client * client);
- virtual QStringList getInterfaceConfigurations(Client * client);
- virtual bool statusInterface(Client * client, const QString& ifcfg);
+ virtual TQStringList getInterfaceConfigurations(Client * client);
+ virtual bool statusInterface(Client * client, const TQString& ifcfg);
protected:
- QStringList read(Client * client) const;
+ TQStringList read(Client * client) const;
void write(Client * client, const char * cmd);
void changeState(Client * client, State * state);
KNetwork::KStreamSocket * socket(Client * client) const;
void setSocket(Client * client, KNetwork::KStreamSocket * sock);
- QString password(Client * client) const;
- void setPassword(Client * client, const QString& pass);
- void setServerID(Client * client, const QString& id);
- void setServerVersion(Client * client, const QString& ver);
+ TQString password(Client * client) const;
+ void setPassword(Client * client, const TQString& pass);
+ void setServerID(Client * client, const TQString& id);
+ void setServerVersion(Client * client, const TQString& ver);
};
diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp
index 7ed5f516..3d1f8a79 100644
--- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp
+++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp
@@ -17,7 +17,7 @@
#include <cstdlib>
#include <openssl/md5.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kdebug.h>
#include <kstreamsocket.h>
@@ -41,12 +41,12 @@ Unsettled * Unsettled::instance() {
return m_instance;
}
-bool Unsettled::connect(Client * client, const QString& server, uint port) {
+bool Unsettled::connect(Client * client, const TQString& server, uint port) {
if(!socket(client) ||
socket(client)->state() != KNetwork::KStreamSocket::Connected ||
socket(client)->state() != KNetwork::KStreamSocket::Connecting) {
- QString resolvedServer = server;
+ TQString resolvedServer = server;
changeState(client, Ready::instance());
disconnect(client);
@@ -58,7 +58,7 @@ bool Unsettled::connect(Client * client, const QString& server, uint port) {
if(resolver.wait(500)) {
KNetwork::KResolverResults results = resolver.results();
if(!results.empty()) {
- QString ip = results[0].address().asInet().ipAddress().toString();
+ TQString ip = results[0].address().asInet().ipAddress().toString();
kdDebug(14312) << k_funcinfo << "Found IP-Address for " << server << ": " << ip << endl;
resolvedServer = ip;
} else {
@@ -70,7 +70,7 @@ bool Unsettled::connect(Client * client, const QString& server, uint port) {
return false;
}
- setSocket(client, new KNetwork::KStreamSocket(resolvedServer, QString::number(port)));
+ setSocket(client, new KNetwork::KStreamSocket(resolvedServer, TQString::number(port)));
socket(client)->setBlocking(TRUE);
if(!socket(client)->connect()) {
@@ -78,25 +78,25 @@ bool Unsettled::connect(Client * client, const QString& server, uint port) {
} else {
kdDebug(14312) << k_funcinfo << "Successfully connected to smpppd \"" << server << ":" << port << "\"" << endl;
- static QString verRex = "^SuSE Meta pppd \\(smpppd\\), Version (.*)$";
- static QString clgRex = "^challenge = (.*)$";
+ static TQString verRex = "^SuSE Meta pppd \\(smpppd\\), Version (.*)$";
+ static TQString clgRex = "^challenge = (.*)$";
- QRegExp ver(verRex);
- QRegExp clg(clgRex);
+ TQRegExp ver(verRex);
+ TQRegExp clg(clgRex);
- QString response = read(client)[0];
+ TQString response = read(client)[0];
- if(response != QString::null &&
+ if(response != TQString::null &&
ver.exactMatch(response)) {
setServerID(client, response);
setServerVersion(client, ver.cap(1));
changeState(client, Ready::instance());
return true;
- } else if(response != QString::null &&
+ } else if(response != TQString::null &&
clg.exactMatch(response)) {
- if(password(client) != QString::null) {
+ if(password(client) != TQString::null) {
// we are challenged, ok, respond
- write(client, QString("response = %1\n").arg(make_response(clg.cap(1).stripWhiteSpace(), password(client))).latin1());
+ write(client, TQString("response = %1\n").arg(make_response(clg.cap(1).stripWhiteSpace(), password(client))).latin1());
response = read(client)[0];
if(ver.exactMatch(response)) {
setServerID(client, response);
@@ -119,7 +119,7 @@ bool Unsettled::connect(Client * client, const QString& server, uint port) {
return false;
}
-QString Unsettled::make_response(const QString& chex, const QString& password) const {
+TQString Unsettled::make_response(const TQString& chex, const TQString& password) const {
int size = chex.length ();
if (size & 1)
@@ -127,9 +127,9 @@ QString Unsettled::make_response(const QString& chex, const QString& password) c
size >>= 1;
// convert challenge from hex to bin
- QString cbin;
+ TQString cbin;
for (int i = 0; i < size; i++) {
- QString tmp = chex.mid (2 * i, 2);
+ TQString tmp = chex.mid (2 * i, 2);
cbin.append ((char) strtol (tmp.ascii (), 0, 16));
}
@@ -142,7 +142,7 @@ QString Unsettled::make_response(const QString& chex, const QString& password) c
MD5_Final (rbin, &md5);
// convert response from bin to hex
- QString rhex;
+ TQString rhex;
for (int i = 0; i < MD5_DIGEST_LENGTH; i++) {
char buffer[3];
snprintf (buffer, 3, "%02x", rbin[i]);
diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.h b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.h
index 57a83752..bf19035e 100644
--- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.h
+++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.h
@@ -35,10 +35,10 @@ public:
static Unsettled * instance();
- virtual bool connect(Client * client, const QString& server, uint port = 3185);
+ virtual bool connect(Client * client, const TQString& server, uint port = 3185);
private:
- QString make_response(const QString& chex, const QString& password) const;
+ TQString make_response(const TQString& chex, const TQString& password) const;
private:
static Unsettled * m_instance;