summaryrefslogtreecommitdiffstats
path: root/src/kvilib/net/kvi_dns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvilib/net/kvi_dns.cpp')
-rw-r--r--src/kvilib/net/kvi_dns.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/kvilib/net/kvi_dns.cpp b/src/kvilib/net/kvi_dns.cpp
index faa2e126..285c45e3 100644
--- a/src/kvilib/net/kvi_dns.cpp
+++ b/src/kvilib/net/kvi_dns.cpp
@@ -60,9 +60,9 @@
KviDnsResult::KviDnsResult()
{
m_iError = KviError_success;
- m_pHostnameList = new KviPointerList<QString>;
+ m_pHostnameList = new KviPointerList<TQString>;
m_pHostnameList->setAutoDelete(true);
- m_pIpAddressList = new KviPointerList<QString>;
+ m_pIpAddressList = new KviPointerList<TQString>;
m_pIpAddressList->setAutoDelete(true);
}
@@ -73,15 +73,15 @@ KviDnsResult::~KviDnsResult()
delete m_pIpAddressList;
}
-void KviDnsResult::appendHostname(const QString &host)
+void KviDnsResult::appendHostname(const TQString &host)
{
- m_pHostnameList->append(new QString(host));
+ m_pHostnameList->append(new TQString(host));
}
-void KviDnsResult::appendAddress(const QString &addr)
+void KviDnsResult::appendAddress(const TQString &addr)
{
- m_pIpAddressList->append(new QString(addr));
+ m_pIpAddressList->append(new TQString(addr));
}
@@ -197,22 +197,22 @@ void KviDnsThread::run()
}
} else {
dns->appendHostname(pHostEntry->h_name);
- QString szIp;
+ TQString szIp;
KviNetUtils::binaryIpToStringIp(* ((struct in_addr*)(pHostEntry->h_addr)),szIp);
dns->appendAddress(szIp);
int idx = 1;
while(pHostEntry->h_addr_list[idx])
{
- QString tmp;
+ TQString tmp;
KviNetUtils::binaryIpToStringIp(* ((struct in_addr*)(pHostEntry->h_addr_list[idx])),tmp);
if(tmp.hasData())dns->appendAddress(tmp);
++idx;
}
if(pHostEntry->h_aliases[0])
{
- dns->appendHostname(QString::fromUtf8(pHostEntry->h_aliases[0]));
- if(pHostEntry->h_aliases[1])dns->appendHostname(QString::fromUtf8(pHostEntry->h_aliases[1]));
+ dns->appendHostname(TQString::fromUtf8(pHostEntry->h_aliases[0]));
+ if(pHostEntry->h_aliases[1])dns->appendHostname(TQString::fromUtf8(pHostEntry->h_aliases[1]));
}
}
@@ -293,12 +293,12 @@ void KviDnsThread::run()
hints.ai_addr = 0;
hints.ai_next = 0;
- retVal = getaddrinfo(KviQString::toUtf8(m_szQuery).data(),0,&hints,&pRet);
+ retVal = getaddrinfo(KviTQString::toUtf8(m_szQuery).data(),0,&hints,&pRet);
if(retVal != 0)dns->setError(translateDnsError(retVal));
else {
- dns->appendHostname(pRet->ai_canonname ? QString::fromUtf8(pRet->ai_canonname) : m_szQuery);
- QString szIp;
+ dns->appendHostname(pRet->ai_canonname ? TQString::fromUtf8(pRet->ai_canonname) : m_szQuery);
+ TQString szIp;
#ifdef COMPILE_IPV6_SUPPORT
if(pRet->ai_family == PF_INET6)KviNetUtils::binaryIpToStringIp_V6(((sockaddr_in6 *)(pRet->ai_addr))->sin6_addr,szIp);
else {
@@ -312,7 +312,7 @@ void KviDnsThread::run()
pNext = pRet->ai_next;
while(pNext)
{
- QString tmp;
+ TQString tmp;
#ifdef COMPILE_IPV6_SUPPORT
if(pNext->ai_family == PF_INET6)KviNetUtils::binaryIpToStringIp_V6(((sockaddr_in6 *)(pNext->ai_addr))->sin6_addr,tmp);
else {
@@ -326,7 +326,7 @@ void KviDnsThread::run()
if(pNext->ai_canonname)
{
// FIXME: only of not equal to other names ?
- dns->appendHostname(QString::fromUtf8(pNext->ai_canonname));
+ dns->appendHostname(TQString::fromUtf8(pNext->ai_canonname));
}
pNext = pNext->ai_next;
@@ -350,7 +350,7 @@ void KviDnsThread::run()
KviDns::KviDns()
-: QObject()
+: TQObject()
{
m_pSlaveThread = new KviDnsThread(this);
m_pDnsResult = new KviDnsResult();
@@ -372,10 +372,10 @@ bool KviDns::isRunning() const
return (m_state == Busy);
};
-bool KviDns::lookup(const QString &query,QueryType type)
+bool KviDns::lookup(const TQString &query,QueryType type)
{
if(m_state == Busy)return false;
- m_pSlaveThread->setQuery(KviQString::trimmed(query),type);
+ m_pSlaveThread->setQuery(KviTQString::trimmed(query),type);
bool bStarted = m_pSlaveThread->start();
m_state = bStarted ? Busy : Failure;
return bStarted;
@@ -393,12 +393,12 @@ KviDnsResult * KviDns::result()
return m_pDnsResult;
}
-KviPointerList<QString> * KviDns::hostnameList()
+KviPointerList<TQString> * KviDns::hostnameList()
{
return result()->hostnameList();
}
-KviPointerList<QString> * KviDns::ipAddressList()
+KviPointerList<TQString> * KviDns::ipAddressList()
{
return result()->ipAddressList();
}
@@ -413,26 +413,26 @@ int KviDns::ipAddressCount()
return result()->ipAddressList()->count();
}
-const QString & KviDns::firstHostname()
+const TQString & KviDns::firstHostname()
{
- QString * pStr = result()->hostnameList()->first();
+ TQString * pStr = result()->hostnameList()->first();
if(pStr)return *pStr;
- return KviQString::empty;
+ return KviTQString::empty;
}
-const QString & KviDns::firstIpAddress()
+const TQString & KviDns::firstIpAddress()
{
- QString * pStr = result()->ipAddressList()->first();
+ TQString * pStr = result()->ipAddressList()->first();
if(pStr)return *pStr;
- return KviQString::empty;
+ return KviTQString::empty;
}
-const QString & KviDns::query()
+const TQString & KviDns::query()
{
return result()->query();
}
-bool KviDns::event(QEvent *e)
+bool KviDns::event(TQEvent *e)
{
if(e->type() == KVI_THREAD_EVENT)
{
@@ -445,6 +445,6 @@ bool KviDns::event(QEvent *e)
return true;
} // else ops... unknown thread event ?
}
- return QObject::event(e);
+ return TQObject::event(e);
}