summaryrefslogtreecommitdiffstats
path: root/src/kvilib/net/kvi_netutils.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvilib/net/kvi_netutils.cpp
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvilib/net/kvi_netutils.cpp')
-rw-r--r--src/kvilib/net/kvi_netutils.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/kvilib/net/kvi_netutils.cpp b/src/kvilib/net/kvi_netutils.cpp
index 0cdb8b02..3ff5d9b0 100644
--- a/src/kvilib/net/kvi_netutils.cpp
+++ b/src/kvilib/net/kvi_netutils.cpp
@@ -61,7 +61,7 @@
#include "kvi_netutils.h"
#include "kvi_memmove.h"
-#include <qstringlist.h>
+#include <tqstringlist.h>
#ifndef COMPILE_ON_WINDOWS
@@ -318,7 +318,7 @@ bool kvi_stringIpToBinaryIp(const char *szIp,struct in_addr *address)
-bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer)
+bool kvi_binaryIpToStringIp(struct in_addr in,TQString &szBuffer)
{
@@ -346,7 +346,7 @@ bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer)
-bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer)
+bool kvi_binaryIpToStringIp(struct in_addr in,TQString &szBuffer)
{
@@ -886,7 +886,7 @@ bool kvi_isValidStringIp_V6(const char *szIp)
-bool kvi_binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer)
+bool kvi_binaryIpToStringIp_V6(struct in6_addr in,TQString &szBuffer)
{
@@ -952,12 +952,12 @@ namespace KviNetUtils
{
- bool stringIpToBinaryIp(const QString &szStringIp,struct in_addr * address)
+ bool stringIpToBinaryIp(const TQString &szStringIp,struct in_addr * address)
{
#ifndef HAVE_INET_ATON
- QString szAddr = szStringIp.simplifyWhiteSpace();
- Q_UINT32 iAddr=0;
- QStringList ipv4 = QStringList::split(".", szAddr, FALSE);
+ TQString szAddr = szStringIp.simplifyWhiteSpace();
+ TQ_UINT32 iAddr=0;
+ TQStringList ipv4 = TQStringList::split(".", szAddr, FALSE);
if (ipv4.count() == 4) {
int i = 0;
bool ok = TRUE;
@@ -978,12 +978,12 @@ namespace KviNetUtils
return FALSE;
#else //HAVE_INET_ATON
if(szStringIp.isEmpty())return false;
- return (inet_aton(KviQString::toUtf8(szStringIp).data(),address) != 0);
+ return (inet_aton(KviTQString::toUtf8(szStringIp).data(),address) != 0);
#endif //HAVE_INET_ATON
}
- bool isValidStringIp(const QString &szIp)
+ bool isValidStringIp(const TQString &szIp)
{
@@ -1001,17 +1001,17 @@ namespace KviNetUtils
#ifdef COMPILE_IPV6_SUPPORT
- bool stringIpToBinaryIp_V6(const QString &szStringIp,struct in6_addr * address)
+ bool stringIpToBinaryIp_V6(const TQString &szStringIp,struct in6_addr * address)
{
- return (inet_pton(AF_INET6,KviQString::toUtf8(szStringIp).data(),(void *)address) == 1);
+ return (inet_pton(AF_INET6,KviTQString::toUtf8(szStringIp).data(),(void *)address) == 1);
}
- bool isValidStringIp_V6(const QString &szIp)
+ bool isValidStringIp_V6(const TQString &szIp)
{
@@ -1023,7 +1023,7 @@ namespace KviNetUtils
}
- bool binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer)
+ bool binaryIpToStringIp_V6(struct in6_addr in,TQString &szBuffer)
{
char buf[46];
bool bRet = inet_ntop(AF_INET6,(void *)&in,buf,46);
@@ -1036,7 +1036,7 @@ namespace KviNetUtils
- bool binaryIpToStringIp(struct in_addr in,QString &szBuffer)
+ bool binaryIpToStringIp(struct in_addr in,TQString &szBuffer)
{
@@ -1052,7 +1052,7 @@ namespace KviNetUtils
- bool isRoutableIpString(const QString &szIpString)
+ bool isRoutableIpString(const TQString &szIpString)
{
@@ -1100,7 +1100,7 @@ namespace KviNetUtils
- bool getInterfaceAddress(const QString &szInterfaceName,QString &szBuffer)
+ bool getInterfaceAddress(const TQString &szInterfaceName,TQString &szBuffer)
{
@@ -1118,7 +1118,7 @@ namespace KviNetUtils
- kvi_memmove(ifr.ifr_name,KviQString::toUtf8(szInterfaceName).data(),len + 1);
+ kvi_memmove(ifr.ifr_name,KviTQString::toUtf8(szInterfaceName).data(),len + 1);
@@ -1158,7 +1158,7 @@ namespace KviNetUtils
- void formatNetworkBandwidthString(QString &szBuffer,unsigned int uBytesPerSec)
+ void formatNetworkBandwidthString(TQString &szBuffer,unsigned int uBytesPerSec)
{
@@ -1170,7 +1170,7 @@ namespace KviNetUtils
unsigned int uRem = ((uBytesPerSec % (1024 * 1024)) * 100) / (1024 * 1024);
- KviQString::sprintf(szBuffer,"%u.%u%u MB/s",uMB,uRem / 10,uRem % 10);
+ KviTQString::sprintf(szBuffer,"%u.%u%u MB/s",uMB,uRem / 10,uRem % 10);
return;
@@ -1184,13 +1184,13 @@ namespace KviNetUtils
unsigned int uRem = ((uBytesPerSec % 1024) * 100) / 1024;
- KviQString::sprintf(szBuffer,"%u.%u%u KB/s",uKB,uRem / 10,uRem % 10);
+ KviTQString::sprintf(szBuffer,"%u.%u%u KB/s",uKB,uRem / 10,uRem % 10);
return;
}
- KviQString::sprintf(szBuffer,"%u B/s",uBytesPerSec);
+ KviTQString::sprintf(szBuffer,"%u B/s",uBytesPerSec);
}
@@ -1202,15 +1202,15 @@ namespace KviNetUtils
-bool kvi_getInterfaceAddress(const char * ifname,QString &buffer)
+bool kvi_getInterfaceAddress(const char * ifname,TQString &buffer)
{
debug("kvi_getInterfaceAddress is deprecated: use KviNetUtils::getInterfaceAddress");
- QString szRet;
+ TQString szRet;
- bool bRes = KviNetUtils::getInterfaceAddress(QString(ifname),szRet);
+ bool bRes = KviNetUtils::getInterfaceAddress(TQString(ifname),szRet);
buffer = szRet;
@@ -1268,7 +1268,7 @@ bool kvi_isRoutableIp(const char * ipaddr)
-bool kvi_getLocalHostAddress(QString &buffer)
+bool kvi_getLocalHostAddress(TQString &buffer)
{
@@ -1282,7 +1282,7 @@ bool kvi_getLocalHostAddress(QString &buffer)
if(!h)return false;
- QString tmp;
+ TQString tmp;
int i=0;
@@ -1466,7 +1466,7 @@ kvi_u32_t KviSockaddr::port()
-bool KviSockaddr::getStringAddress(QString &szBuffer)
+bool KviSockaddr::getStringAddress(TQString &szBuffer)
{