summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/scanlist.cpp
Unidiff
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 @@
17#include "scanlistitem.h" 17#include "scanlistitem.h"
18 18
19#include <assert.h> 19#include <assert.h>
20 20
21#include "manufacturers.h" 21#include "manufacturers.h"
22 22
23#include <qtextstream.h>
24
23MScanListView::MScanListView( QWidget* parent, const char* name ) 25MScanListView::MScanListView( QWidget* parent, const char* name )
24 :OListView( parent, name ), _manufacturerdb( 0 ) 26 :OListView( parent, name ), _manufacturerdb( 0 )
25{ 27{
26 28
27 setFrameShape( QListView::StyledPanel ); 29 setFrameShape( QListView::StyledPanel );
28 setFrameShadow( QListView::Sunken ); 30 setFrameShadow( QListView::Sunken );
29 31
30 addColumn( tr( "Net/Station" ) ); 32 addColumn( tr( "Net/Station" ) );
31 setColumnAlignment( 0, AlignLeft || AlignVCenter ); 33 setColumnAlignment( 0, AlignLeft || AlignVCenter );
32 addColumn( tr( "B" ) ); 34 addColumn( tr( "B" ) );
33 setColumnAlignment( 1, AlignCenter ); 35 setColumnAlignment( 1, AlignCenter );
34 addColumn( tr( "AP" ) ); 36 addColumn( tr( "AP" ) );
35 setColumnAlignment( 2, AlignCenter ); 37 setColumnAlignment( 2, AlignCenter );
@@ -122,32 +124,44 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
122 return; 124 return;
123 } 125 }
124 } 126 }
125 else 127 else
126 { 128 {
127 s.sprintf( "(i) new network: '%s'", (const char*) essid ); 129 s.sprintf( "(i) new network: '%s'", (const char*) essid );
128 130
129 network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 ); 131 network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 );
130 } 132 }
131 133
132 134
133 // insert new station as child from network 135 // insert new station as child from network
134 136
135 // no essid to reduce clutter, maybe later we have a nick or stationname to display!? 137 // no essid to reduce clutter, maybe later we have a nick or stationname to display!?
136 138
137 qDebug( "inserting new station %s", (const char*) macaddr ); 139 qDebug( "inserting new station %s", (const char*) macaddr );
138 140
139 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); 141 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
140 if ( _manufacturerdb ) 142 if ( _manufacturerdb )
141 station->setManufacturer( _manufacturerdb->lookup( macaddr ) ); 143 station->setManufacturer( _manufacturerdb->lookup( macaddr ) );
142 144
143 if ( type == "managed" ) 145 if ( type == "managed" )
144 { 146 {
145 s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel ); 147 s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel );
146 } 148 }
147 else 149 else
148 { 150 {
149 s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel ); 151 s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel );
150 } 152 }
151 153
152} 154}
153 155
156void MScanListView::dump( QTextStream& t ) const
157{
158 qDebug( "dumping scanlist..." );
159
160 QListViewItemIterator it( const_cast<MScanListView*>( this ) );
161 for ( ; it.current(); ++it )
162 {
163 static_cast<MScanListItem*>( it.current() )->dump( t );
164 }
165
166 qDebug( "dump finished." );
167}