summaryrefslogtreecommitdiff
path: root/noncore/applets/wirelessapplet/networkinfo.cpp
Side-by-side diff
Diffstat (limited to 'noncore/applets/wirelessapplet/networkinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/wirelessapplet/networkinfo.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/noncore/applets/wirelessapplet/networkinfo.cpp b/noncore/applets/wirelessapplet/networkinfo.cpp
index 22d7d83..8531fd5 100644
--- a/noncore/applets/wirelessapplet/networkinfo.cpp
+++ b/noncore/applets/wirelessapplet/networkinfo.cpp
@@ -53,2 +53,4 @@
+#define MDEBUG 0
+
//---------------------------------------------------------------------------
@@ -71,4 +73,5 @@ MNetworkInterface::~MNetworkInterface()
-void MNetworkInterface::updateStatistics()
+bool MNetworkInterface::updateStatistics()
{
+ return true;
}
@@ -106,5 +109,7 @@ int MWirelessNetworkInterface::noisePercent()
-void MWirelessNetworkInterface::updateStatistics()
+bool MWirelessNetworkInterface::updateStatistics()
{
- MNetworkInterface::updateStatistics();
+ bool base = MNetworkInterface::updateStatistics();
+ if ( !base )
+ return false;
@@ -183,3 +188,5 @@ void MWirelessNetworkInterface::updateStatistics()
{
+#ifdef MDEBUG
qDebug( "WIFIAPPLET: D'oh! Someone removed the card..." );
+#endif
quality = -1;
@@ -187,3 +194,3 @@ void MWirelessNetworkInterface::updateStatistics()
noise = IW_LOWER;
- return;
+ return false;
}
@@ -193,7 +200,16 @@ void MWirelessNetworkInterface::updateStatistics()
if ( quality > 92 )
+#ifdef MDEBUG
qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality );
+#endif
if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) )
+#ifdef MDEBUG
qDebug( "WIFIAPPLET: Doh! Strength %d > estimated max!\n", signal );
+#endif
if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) )
+#ifdef MDEBUG
qDebug( "WIFIAPPLET: Doh! Noise %d > estimated max!\n", noise );
+#endif
+
+ return true;
+
}
@@ -206,3 +222,2 @@ MNetwork::MNetwork()
{
- //qDebug( "MNetwork::MNetwork()" );
procfile = PROCNETDEV;
@@ -212,3 +227,2 @@ MNetwork::~MNetwork()
{
- //qDebug( "MNetwork::~MNetwork()" );
}
@@ -221,3 +235,2 @@ MWirelessNetwork::MWirelessNetwork()
{
- //qDebug( "MWirelessNetwork::MWirelessNetwork()" );
procfile = PROCNETWIRELESS;
@@ -227,3 +240,2 @@ MWirelessNetwork::~MWirelessNetwork()
{
- //qDebug( "MWirelessNetwork::~MWirelessNetwork()" );
}
@@ -261,3 +273,5 @@ void MNetwork::enumerateInterfaces()
str.truncate( str.find( ':' ) );
+#ifdef MDEBUG
qDebug( "WIFIAPPLET: found interface '%s'", (const char*) str );
+#endif
interfaces.insert( str, createInterface( str ) );