author | mickeyl <mickeyl> | 2004-07-28 16:33:32 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-07-28 16:33:32 (UTC) |
commit | 19eab093c4d63ae275d215f400b1d262390daa16 (patch) (side-by-side diff) | |
tree | 74b48d8ebe8c303c30bc969e32884306a480dc48 | |
parent | 614c7e0add47c87902da610e7f31f5abe0d79655 (diff) | |
download | opie-19eab093c4d63ae275d215f400b1d262390daa16.zip opie-19eab093c4d63ae275d215f400b1d262390daa16.tar.gz opie-19eab093c4d63ae275d215f400b1d262390daa16.tar.bz2 |
disambiguate
-rw-r--r-- | noncore/settings/networksettings/wlan/wextensions.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp index fe21f02..8a9db66 100644 --- a/noncore/settings/networksettings/wlan/wextensions.cpp +++ b/noncore/settings/networksettings/wlan/wextensions.cpp @@ -43,49 +43,53 @@ WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false), i strcpy( iwr.ifr_ifrn.ifrn_name, (const char *)iname ); if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr ) ) hasWirelessExtensions = true; } /** * @return QString the station name of the access point. */ QString WExtensions::station(){ if(!hasWirelessExtensions) return QString(); const char* buffer[200]; iwr.u.data.pointer = (caddr_t) buffer; iwr.u.data.length = IW_ESSID_MAX_SIZE; iwr.u.data.flags = 0; if ( 0 == ioctl( fd, SIOCGIWNICKN, &iwr )){ - iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0'; - return QString(iwr.u.data.pointer); + buffer[(unsigned int) iwr.u.data.length-1] = '\0'; + return (const char*) buffer; } - return QString(); + return QString::null; } /** * @return QString the essid of the host 802.11 access point. */ QString WExtensions::essid(){ if(!hasWirelessExtensions) return QString(); + const char* buffer[200]; + iwr.u.data.pointer = (caddr_t) buffer; + iwr.u.data.length = IW_ESSID_MAX_SIZE; + iwr.u.data.flags = 0; if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr )){ - iwr.u.essid.pointer[(unsigned int) iwr.u.essid.length] = '\0'; - return QString(iwr.u.essid.pointer); + buffer[(unsigned int) iwr.u.essid.length] = '\0'; + return (const char*) buffer; } - return QString(); + return QString::null; } /** * @return QString the mode of interface */ QString WExtensions::mode(){ if(!hasWirelessExtensions) return QString(); if ( 0 == ioctl( fd, SIOCGIWMODE, &iwr ) ) return QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed"); return QString(); } /** * Get the frequency that the interface is running at. * @return int the frequency that the interfacae is running at. |