diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /lanbrowsing/kcmlisa/findnic.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lanbrowsing/kcmlisa/findnic.cpp')
-rw-r--r-- | lanbrowsing/kcmlisa/findnic.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lanbrowsing/kcmlisa/findnic.cpp b/lanbrowsing/kcmlisa/findnic.cpp index 721834c9..7de4b19c 100644 --- a/lanbrowsing/kcmlisa/findnic.cpp +++ b/lanbrowsing/kcmlisa/findnic.cpp @@ -128,10 +128,10 @@ NICList* findNICs() if (result==0) { sinptr = (struct sockaddr_in *) &ifcopy.ifr_addr; - tmp->netmask=inet_ntoa(sinptr->sin_addr); + tmp->nettqmask=inet_ntoa(sinptr->sin_addr); } else - tmp->netmask=i18n("Unknown"); + tmp->nettqmask=i18n("Unknown"); nl->append(tmp); break; @@ -159,14 +159,14 @@ NICList* findNICs() getnameinfo(ifa->ifa_addr, ifa->ifa_addr->sa_len, buf, 127, 0, 0, NI_NUMERICHOST); tmp->addr = buf; - if (ifa->ifa_netmask != NULL) { + if (ifa->ifa_nettqmask != NULL) { #ifdef Q_OS_FREEBSD - struct sockaddr_in *sinptr = (struct sockaddr_in *)ifa->ifa_netmask; - tmp->netmask=inet_ntoa(sinptr->sin_addr); + struct sockaddr_in *sinptr = (struct sockaddr_in *)ifa->ifa_nettqmask; + tmp->nettqmask=inet_ntoa(sinptr->sin_addr); #else bzero(buf, 128); - getnameinfo(ifa->ifa_netmask, ifa->ifa_netmask->sa_len, buf, 127, 0, 0, NI_NUMERICHOST); - tmp->netmask = buf; + getnameinfo(ifa->ifa_nettqmask, ifa->ifa_nettqmask->sa_len, buf, 127, 0, 0, NI_NUMERICHOST); + tmp->nettqmask = buf; #endif } @@ -192,13 +192,13 @@ NICList* findNICs() void suggestSettingsForAddress(const TQString& addrMask, LisaConfigInfo& lci) { - TQString ip=addrMask.left(addrMask.find("/")); - TQString mask=addrMask.mid(addrMask.find("/")+1); + TQString ip=addrMask.left(addrMask.tqfind("/")); + TQString tqmask=addrMask.mid(addrMask.tqfind("/")+1); - if (mask[mask.length()-1]==';') - mask=mask.left(mask.length()-1); + if (tqmask[tqmask.length()-1]==';') + tqmask=tqmask.left(tqmask.length()-1); MyNIC tmpNic; - KInetSocketAddress::stringToAddr(AF_INET, mask.latin1(), &tmpNic.netmask); + KInetSocketAddress::stringToAddr(AF_INET, tqmask.latin1(), &tmpNic.nettqmask); KInetSocketAddress::stringToAddr(AF_INET, ip.latin1(), &tmpNic.addr); suggestSettingsForNic(&tmpNic,lci); } @@ -209,11 +209,11 @@ void suggestSettingsForNic(MyNIC* nic, LisaConfigInfo& lci) if (nic==0) return; TQString address = nic->addr; - TQString netmask = nic->netmask; + TQString nettqmask = nic->nettqmask; - TQString addrMask(address+"/"+netmask+";"); + TQString addrMask(address+"/"+nettqmask+";"); struct in_addr tmpaddr; - inet_aton(nic->netmask.latin1(), &tmpaddr); + inet_aton(nic->nettqmask.latin1(), &tmpaddr); unsigned int tmp= ntohl(tmpaddr.s_addr); //if the host part is less than 20 bits simply take it @@ -275,21 +275,21 @@ TQString flags_tos (unsigned int flags) if (flags & IFF_BROADCAST) { if (tmp.length()) { - tmp += TQString::fromLatin1(", "); + tmp += TQString::tqfromLatin1(", "); } tmp += i18n("Broadcast"); } if (flags & IFF_MULTICAST) { if (tmp.length()) { - tmp += TQString::fromLatin1(", "); + tmp += TQString::tqfromLatin1(", "); } tmp += i18n("Multicast"); } if (flags & IFF_LOOPBACK) { if (tmp.length()) { - tmp += TQString::fromLatin1(", "); + tmp += TQString::tqfromLatin1(", "); } tmp += i18n("Loopback"); } |