From 4aaa8efd13ad014280a6f1f05391c1ec464790db Mon Sep 17 00:00:00 2001 From: mickeyl Date: Fri, 02 May 2003 23:32:16 +0000 Subject: add parsing and interpretating of fromDS frames and getting pretty close to the 1.0 release --- (limited to 'noncore/net') 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 @@ -174,7 +174,7 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo } -void MScanListView::addIfNotExisting( MScanListItem* network, QString addr ) +void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, const QString& type ) { MScanListItem* subitem = static_cast( network->firstChild() ); @@ -195,7 +195,7 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr ) } // Hey, it seems to be a new item :-D - MScanListItem* station = new MScanListItem( network, "station", /* network->text( col_essid ) */ "", addr, false, -1, -1 ); + MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr, false, -1, -1 ); if ( _manufacturerdb ) station->setManufacturer( _manufacturerdb->lookup( addr ) ); } @@ -237,7 +237,7 @@ void MScanListView::toDStraffic( QString from, QString to, QString via ) if ( item ) // AP has shown up yet, so just add our new "from" - station { - addIfNotExisting( static_cast(item->parent()), from ); + addIfNotExisting( static_cast(item->parent()), from, "adhoc" ); } else { @@ -247,7 +247,22 @@ void MScanListView::toDStraffic( QString from, QString to, QString via ) void MScanListView::fromDStraffic( QString from, QString to, QString via ) { - qWarning( "D'oh! Not yet implemented..." ); + QString s; + MScanListItem* network; + + QListViewItemIterator it( this ); + while ( it.current() && it.current()->text( col_ap ) != via ) ++it; + + MScanListItem* item = static_cast( it.current() ); + + if ( item ) // AP has shown up yet, so just add our new "from" - station + { + addIfNotExisting( static_cast(item->parent()), from, "station" ); + } + else + { + qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); + } } void MScanListView::IBSStraffic( QString from, QString to, QString via ) diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h index a14d426..56bf837 100644 --- a/noncore/net/wellenreiter/gui/scanlist.h +++ b/noncore/net/wellenreiter/gui/scanlist.h @@ -47,7 +47,7 @@ class MScanListView: public OListView void IBSStraffic( QString from, QString to, QString via ); // NYI protected: - void addIfNotExisting( MScanListItem* parent, QString addr ); + void addIfNotExisting( MScanListItem* parent, QString addr, const QString& type = "station" ); private: ManufacturerDB* _manufacturerdb; -- cgit v0.9.0.2