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.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index b8aa81c..1cf49e0 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -171,13 +171,13 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
171 s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel ); 171 s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel );
172 } 172 }
173 173
174} 174}
175 175
176 176
177void MScanListView::addIfNotExisting( MScanListItem* network, QString addr ) 177void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, const QString& type )
178{ 178{
179 MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() ); 179 MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() );
180 180
181 while ( subitem && ( subitem->text( col_ap ) != addr ) ) 181 while ( subitem && ( subitem->text( col_ap ) != addr ) )
182 { 182 {
183 qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) ); 183 qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) );
@@ -192,13 +192,13 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr )
192 #endif 192 #endif
193 subitem->receivedBeacon(); //FIXME: sent data bit 193 subitem->receivedBeacon(); //FIXME: sent data bit
194 return; 194 return;
195 } 195 }
196 196
197 // Hey, it seems to be a new item :-D 197 // Hey, it seems to be a new item :-D
198 MScanListItem* station = new MScanListItem( network, "station", /* network->text( col_essid ) */ "", addr, false, -1, -1 ); 198 MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr, false, -1, -1 );
199 if ( _manufacturerdb ) 199 if ( _manufacturerdb )
200 station->setManufacturer( _manufacturerdb->lookup( addr ) ); 200 station->setManufacturer( _manufacturerdb->lookup( addr ) );
201} 201}
202 202
203 203
204void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QString viaTo ) 204void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QString viaTo )
@@ -234,23 +234,38 @@ void MScanListView::toDStraffic( QString from, QString to, QString via )
234 while ( it.current() && it.current()->text( col_ap ) != via ) ++it; 234 while ( it.current() && it.current()->text( col_ap ) != via ) ++it;
235 235
236 MScanListItem* item = static_cast<MScanListItem*>( it.current() ); 236 MScanListItem* item = static_cast<MScanListItem*>( it.current() );
237 237
238 if ( item ) // AP has shown up yet, so just add our new "from" - station 238 if ( item ) // AP has shown up yet, so just add our new "from" - station
239 { 239 {
240 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from ); 240 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "adhoc" );
241 } 241 }
242 else 242 else
243 { 243 {
244 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); 244 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" );
245 } 245 }
246} 246}
247 247
248void MScanListView::fromDStraffic( QString from, QString to, QString via ) 248void MScanListView::fromDStraffic( QString from, QString to, QString via )
249{ 249{
250 qWarning( "D'oh! Not yet implemented..." ); 250 QString s;
251 MScanListItem* network;
252
253 QListViewItemIterator it( this );
254 while ( it.current() && it.current()->text( col_ap ) != via ) ++it;
255
256 MScanListItem* item = static_cast<MScanListItem*>( it.current() );
257
258 if ( item ) // AP has shown up yet, so just add our new "from" - station
259 {
260 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "station" );
261 }
262 else
263 {
264 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" );
265 }
251} 266}
252 267
253void MScanListView::IBSStraffic( QString from, QString to, QString via ) 268void MScanListView::IBSStraffic( QString from, QString to, QString via )
254{ 269{
255 qWarning( "D'oh! Not yet implemented..." ); 270 qWarning( "D'oh! Not yet implemented..." );
256} 271}