summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/scanlist.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 6d3469c..cdc2c48 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -17,19 +17,21 @@
#include "scanlistitem.h"
#include <assert.h>
#include "manufacturers.h"
+#include <qtextstream.h>
+
MScanListView::MScanListView( QWidget* parent, const char* name )
:OListView( parent, name ), _manufacturerdb( 0 )
{
setFrameShape( QListView::StyledPanel );
setFrameShadow( QListView::Sunken );
-
+
addColumn( tr( "Net/Station" ) );
setColumnAlignment( 0, AlignLeft || AlignVCenter );
addColumn( tr( "B" ) );
setColumnAlignment( 1, AlignCenter );
addColumn( tr( "AP" ) );
setColumnAlignment( 2, AlignCenter );
@@ -122,32 +124,44 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
return;
}
}
else
{
s.sprintf( "(i) new network: '%s'", (const char*) essid );
-
+
network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 );
- }
-
-
+ }
+
+
// insert new station as child from network
-
+
// no essid to reduce clutter, maybe later we have a nick or stationname to display!?
-
+
qDebug( "inserting new station %s", (const char*) macaddr );
-
+
MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
if ( _manufacturerdb )
station->setManufacturer( _manufacturerdb->lookup( macaddr ) );
if ( type == "managed" )
{
s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel );
}
else
{
s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel );
}
-
+
}
+void MScanListView::dump( QTextStream& t ) const
+{
+ qDebug( "dumping scanlist..." );
+
+ QListViewItemIterator it( const_cast<MScanListView*>( this ) );
+ for ( ; it.current(); ++it )
+ {
+ static_cast<MScanListItem*>( it.current() )->dump( t );
+ }
+
+ qDebug( "dump finished." );
+}