-rw-r--r-- | noncore/net/networksetup/wlan/wlanmodule.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp index 8d25d99..f12e608 100644 --- a/noncore/net/networksetup/wlan/wlanmodule.cpp +++ b/noncore/net/networksetup/wlan/wlanmodule.cpp | |||
@@ -112,65 +112,65 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ | |||
112 | if ( result == 0 ){ | 112 | if ( result == 0 ){ |
113 | QString foo = foo.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", | 113 | QString foo = foo.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", |
114 | iwr.u.ap_addr.sa_data[0]&0xff, | 114 | iwr.u.ap_addr.sa_data[0]&0xff, |
115 | iwr.u.ap_addr.sa_data[1]&0xff, | 115 | iwr.u.ap_addr.sa_data[1]&0xff, |
116 | iwr.u.ap_addr.sa_data[2]&0xff, | 116 | iwr.u.ap_addr.sa_data[2]&0xff, |
117 | iwr.u.ap_addr.sa_data[3]&0xff, | 117 | iwr.u.ap_addr.sa_data[3]&0xff, |
118 | iwr.u.ap_addr.sa_data[4]&0xff, | 118 | iwr.u.ap_addr.sa_data[4]&0xff, |
119 | iwr.u.ap_addr.sa_data[5]&0xff ); | 119 | iwr.u.ap_addr.sa_data[5]&0xff ); |
120 | info->apLabel->setText(foo); | 120 | info->apLabel->setText(foo); |
121 | } | 121 | } |
122 | else info->apLabel->setText("*** Unknown ***"); | 122 | else info->apLabel->setText("*** Unknown ***"); |
123 | 123 | ||
124 | iwr.u.data.pointer = (caddr_t) buffer; | 124 | iwr.u.data.pointer = (caddr_t) buffer; |
125 | iwr.u.data.length = IW_ESSID_MAX_SIZE; | 125 | iwr.u.data.length = IW_ESSID_MAX_SIZE; |
126 | iwr.u.data.flags = 0; | 126 | iwr.u.data.flags = 0; |
127 | result = ioctl( fd, SIOCGIWNICKN, &iwr ); | 127 | result = ioctl( fd, SIOCGIWNICKN, &iwr ); |
128 | if ( result == 0 ){ | 128 | if ( result == 0 ){ |
129 | iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0'; | 129 | iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0'; |
130 | info->stationLabel->setText(iwr.u.data.pointer); | 130 | info->stationLabel->setText(iwr.u.data.pointer); |
131 | } | 131 | } |
132 | else info->stationLabel->setText("*** Unknown ***"); | 132 | else info->stationLabel->setText("*** Unknown ***"); |
133 | 133 | ||
134 | result = ioctl( fd, SIOCGIWMODE, &iwr ); | 134 | result = ioctl( fd, SIOCGIWMODE, &iwr ); |
135 | if ( result == 0 ) | 135 | if ( result == 0 ) |
136 | info->modeLabel->setText( QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed")); | 136 | info->modeLabel->setText( QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed")); |
137 | else | 137 | else |
138 | info->modeLabel->setText("*** Unknown ***"); | 138 | info->modeLabel->setText("*** Unknown ***"); |
139 | 139 | ||
140 | result = ioctl( fd, SIOCGIWFREQ, &iwr ); | 140 | result = ioctl( fd, SIOCGIWFREQ, &iwr ); |
141 | if ( result == 0 ) | 141 | if ( result == 0 ) |
142 | info->freqLabel->setText(QString("%1").arg((double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000))); | 142 | info->freqLabel->setText(QString("%1").arg((double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000))); |
143 | else | 143 | else |
144 | info->freqLabel->setText("0"); | 144 | info->freqLabel->setText("*** Unknown ***"); |
145 | 145 | ||
146 | /* | 146 | /* |
147 | // gather link quality from /proc/net/wireless | 147 | // gather link quality from /proc/net/wireless |
148 | 148 | ||
149 | char c; | 149 | char c; |
150 | QString status; | 150 | QString status; |
151 | QString name; | 151 | QString name; |
152 | QFile wfile( PROCNETWIRELESS ); | 152 | QFile wfile( PROCNETWIRELESS ); |
153 | bool hasFile = wfile.open( IO_ReadOnly ); | 153 | bool hasFile = wfile.open( IO_ReadOnly ); |
154 | QTextStream wstream( &wfile ); | 154 | QTextStream wstream( &wfile ); |
155 | if ( hasFile ) | 155 | if ( hasFile ) |
156 | { | 156 | { |
157 | wstream.readLine(); // skip the first two lines | 157 | wstream.readLine(); // skip the first two lines |
158 | wstream.readLine(); // because they only contain headers | 158 | wstream.readLine(); // because they only contain headers |
159 | } | 159 | } |
160 | if ( ( !hasFile ) || ( wstream.atEnd() ) ) | 160 | if ( ( !hasFile ) || ( wstream.atEnd() ) ) |
161 | { | 161 | { |
162 | #ifdef MDEBUG | 162 | #ifdef MDEBUG |
163 | qDebug( "WIFIAPPLET: D'oh! Someone removed the card..." ); | 163 | qDebug( "WIFIAPPLET: D'oh! Someone removed the card..." ); |
164 | #endif | 164 | #endif |
165 | quality = -1; | 165 | quality = -1; |
166 | signal = IW_LOWER; | 166 | signal = IW_LOWER; |
167 | noise = IW_LOWER; | 167 | noise = IW_LOWER; |
168 | return false; | 168 | return false; |
169 | } | 169 | } |
170 | 170 | ||
171 | wstream >> name >> status >> quality >> c >> signal >> c >> noise; | 171 | wstream >> name >> status >> quality >> c >> signal >> c >> noise; |
172 | 172 | ||
173 | if ( quality > 92 ) | 173 | if ( quality > 92 ) |
174 | #ifdef MDEBUG | 174 | #ifdef MDEBUG |
175 | qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality ); | 175 | qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality ); |
176 | #endif | 176 | #endif |
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index 8d25d99..f12e608 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp | |||
@@ -112,65 +112,65 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ | |||
112 | if ( result == 0 ){ | 112 | if ( result == 0 ){ |
113 | QString foo = foo.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", | 113 | QString foo = foo.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", |
114 | iwr.u.ap_addr.sa_data[0]&0xff, | 114 | iwr.u.ap_addr.sa_data[0]&0xff, |
115 | iwr.u.ap_addr.sa_data[1]&0xff, | 115 | iwr.u.ap_addr.sa_data[1]&0xff, |
116 | iwr.u.ap_addr.sa_data[2]&0xff, | 116 | iwr.u.ap_addr.sa_data[2]&0xff, |
117 | iwr.u.ap_addr.sa_data[3]&0xff, | 117 | iwr.u.ap_addr.sa_data[3]&0xff, |
118 | iwr.u.ap_addr.sa_data[4]&0xff, | 118 | iwr.u.ap_addr.sa_data[4]&0xff, |
119 | iwr.u.ap_addr.sa_data[5]&0xff ); | 119 | iwr.u.ap_addr.sa_data[5]&0xff ); |
120 | info->apLabel->setText(foo); | 120 | info->apLabel->setText(foo); |
121 | } | 121 | } |
122 | else info->apLabel->setText("*** Unknown ***"); | 122 | else info->apLabel->setText("*** Unknown ***"); |
123 | 123 | ||
124 | iwr.u.data.pointer = (caddr_t) buffer; | 124 | iwr.u.data.pointer = (caddr_t) buffer; |
125 | iwr.u.data.length = IW_ESSID_MAX_SIZE; | 125 | iwr.u.data.length = IW_ESSID_MAX_SIZE; |
126 | iwr.u.data.flags = 0; | 126 | iwr.u.data.flags = 0; |
127 | result = ioctl( fd, SIOCGIWNICKN, &iwr ); | 127 | result = ioctl( fd, SIOCGIWNICKN, &iwr ); |
128 | if ( result == 0 ){ | 128 | if ( result == 0 ){ |
129 | iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0'; | 129 | iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0'; |
130 | info->stationLabel->setText(iwr.u.data.pointer); | 130 | info->stationLabel->setText(iwr.u.data.pointer); |
131 | } | 131 | } |
132 | else info->stationLabel->setText("*** Unknown ***"); | 132 | else info->stationLabel->setText("*** Unknown ***"); |
133 | 133 | ||
134 | result = ioctl( fd, SIOCGIWMODE, &iwr ); | 134 | result = ioctl( fd, SIOCGIWMODE, &iwr ); |
135 | if ( result == 0 ) | 135 | if ( result == 0 ) |
136 | info->modeLabel->setText( QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed")); | 136 | info->modeLabel->setText( QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed")); |
137 | else | 137 | else |
138 | info->modeLabel->setText("*** Unknown ***"); | 138 | info->modeLabel->setText("*** Unknown ***"); |
139 | 139 | ||
140 | result = ioctl( fd, SIOCGIWFREQ, &iwr ); | 140 | result = ioctl( fd, SIOCGIWFREQ, &iwr ); |
141 | if ( result == 0 ) | 141 | if ( result == 0 ) |
142 | info->freqLabel->setText(QString("%1").arg((double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000))); | 142 | info->freqLabel->setText(QString("%1").arg((double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000))); |
143 | else | 143 | else |
144 | info->freqLabel->setText("0"); | 144 | info->freqLabel->setText("*** Unknown ***"); |
145 | 145 | ||
146 | /* | 146 | /* |
147 | // gather link quality from /proc/net/wireless | 147 | // gather link quality from /proc/net/wireless |
148 | 148 | ||
149 | char c; | 149 | char c; |
150 | QString status; | 150 | QString status; |
151 | QString name; | 151 | QString name; |
152 | QFile wfile( PROCNETWIRELESS ); | 152 | QFile wfile( PROCNETWIRELESS ); |
153 | bool hasFile = wfile.open( IO_ReadOnly ); | 153 | bool hasFile = wfile.open( IO_ReadOnly ); |
154 | QTextStream wstream( &wfile ); | 154 | QTextStream wstream( &wfile ); |
155 | if ( hasFile ) | 155 | if ( hasFile ) |
156 | { | 156 | { |
157 | wstream.readLine(); // skip the first two lines | 157 | wstream.readLine(); // skip the first two lines |
158 | wstream.readLine(); // because they only contain headers | 158 | wstream.readLine(); // because they only contain headers |
159 | } | 159 | } |
160 | if ( ( !hasFile ) || ( wstream.atEnd() ) ) | 160 | if ( ( !hasFile ) || ( wstream.atEnd() ) ) |
161 | { | 161 | { |
162 | #ifdef MDEBUG | 162 | #ifdef MDEBUG |
163 | qDebug( "WIFIAPPLET: D'oh! Someone removed the card..." ); | 163 | qDebug( "WIFIAPPLET: D'oh! Someone removed the card..." ); |
164 | #endif | 164 | #endif |
165 | quality = -1; | 165 | quality = -1; |
166 | signal = IW_LOWER; | 166 | signal = IW_LOWER; |
167 | noise = IW_LOWER; | 167 | noise = IW_LOWER; |
168 | return false; | 168 | return false; |
169 | } | 169 | } |
170 | 170 | ||
171 | wstream >> name >> status >> quality >> c >> signal >> c >> noise; | 171 | wstream >> name >> status >> quality >> c >> signal >> c >> noise; |
172 | 172 | ||
173 | if ( quality > 92 ) | 173 | if ( quality > 92 ) |
174 | #ifdef MDEBUG | 174 | #ifdef MDEBUG |
175 | qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality ); | 175 | qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality ); |
176 | #endif | 176 | #endif |