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) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp59
1 files changed, 29 insertions, 30 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index d5665b4..809d0bd 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -20,3 +20,2 @@
#include <assert.h>
-#include "manufacturers.h"
#include <qdatetime.h>
@@ -49,3 +48,3 @@ const int col_lastseen = 9;
MScanListView::MScanListView( QWidget* parent, const char* name )
- :OListView( parent, name ), _manufacturerdb( 0 )
+ :OListView( parent, name )
{
@@ -79,2 +78,3 @@ MScanListView::MScanListView( QWidget* parent, const char* name )
+
MScanListView::~MScanListView()
@@ -83,2 +83,3 @@ MScanListView::~MScanListView()
+
OListViewItem* MScanListView::childFactory()
@@ -88,2 +89,3 @@ OListViewItem* MScanListView::childFactory()
+
void MScanListView::serializeTo( QDataStream& s) const
@@ -94,2 +96,3 @@ void MScanListView::serializeTo( QDataStream& s) const
+
void MScanListView::serializeFrom( QDataStream& s)
@@ -100,10 +103,6 @@ void MScanListView::serializeFrom( QDataStream& s)
-void MScanListView::setManufacturerDB( ManufacturerDB* manufacturerdb )
-{
- _manufacturerdb = manufacturerdb;
-}
-void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal )
+void MScanListView::addNewItem( const QString& type, const QString& essid, const OMacAddress& mac, bool wep, int channel, int signal )
{
- // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...)
+ QString macaddr = mac.toString(true);
@@ -170,4 +169,3 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
- if ( _manufacturerdb )
- station->setManufacturer( _manufacturerdb->lookup( macaddr ) );
+ station->setManufacturer( mac.manufacturer() );
@@ -186,3 +184,3 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
-void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, const QString& type )
+void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type )
{
@@ -190,3 +188,3 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons
- while ( subitem && ( subitem->text( col_ap ) != addr ) )
+ while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) )
{
@@ -202,3 +200,3 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons
#ifdef DEBUG
- qDebug( "%s is a dupe - ignoring...", (const char*) addr );
+ qDebug( "%s is a dupe - ignoring...", (const char*) addr.toString(true) );
#endif
@@ -209,5 +207,4 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons
// Hey, it seems to be a new item :-D
- MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr, false, -1, -1 );
- if ( _manufacturerdb )
- station->setManufacturer( _manufacturerdb->lookup( addr ) );
+ MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 );
+ station->setManufacturer( addr.manufacturer() );
@@ -226,3 +223,3 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons
-void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QString viaTo )
+void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo )
{
@@ -233,4 +230,4 @@ void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QStri
while ( it.current() &&
- it.current()->text( col_ap ) != viaFrom &&
- it.current()->text( col_ap ) != viaTo ) ++it;
+ it.current()->text( col_ap ) != viaFrom.toString(true) &&
+ it.current()->text( col_ap ) != viaTo.toString(true) ) ++it;
@@ -251,3 +248,3 @@ void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QStri
-void MScanListView::toDStraffic( QString from, QString to, QString via )
+void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
{
@@ -257,3 +254,3 @@ void MScanListView::toDStraffic( QString from, QString to, QString via )
QListViewItemIterator it( this );
- while ( it.current() && it.current()->text( col_ap ) != via ) ++it;
+ while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it;
@@ -274,3 +271,3 @@ void MScanListView::toDStraffic( QString from, QString to, QString via )
-void MScanListView::fromDStraffic( QString from, QString to, QString via )
+void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
{
@@ -280,3 +277,3 @@ void MScanListView::fromDStraffic( QString from, QString to, QString via )
QListViewItemIterator it( this );
- while ( it.current() && it.current()->text( col_ap ) != via ) ++it;
+ while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it;
@@ -296,3 +293,3 @@ void MScanListView::fromDStraffic( QString from, QString to, QString via )
-void MScanListView::IBSStraffic( QString from, QString to, QString via )
+void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
{
@@ -303,5 +300,5 @@ void MScanListView::IBSStraffic( QString from, QString to, QString via )
-void MScanListView::identify( const QString& macaddr, const QString& ip )
+void MScanListView::identify( const OMacAddress& macaddr, const QString& ip )
{
- qDebug( "identify %s = %s", (const char*) macaddr, (const char*) ip );
+ qDebug( "identify %s = %s", (const char*) macaddr.toString(), (const char*) ip );
@@ -310,3 +307,3 @@ void MScanListView::identify( const QString& macaddr, const QString& ip )
{
- if ( it.current()->text( col_ap ) == macaddr )
+ if ( it.current()->text( col_ap ) == macaddr.toString(true) )
{
@@ -318,3 +315,3 @@ void MScanListView::identify( const QString& macaddr, const QString& ip )
MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!",
- (const char*) macaddr, (const char*) ip ) );
+ (const char*) macaddr.toString(), (const char*) ip ) );
}
@@ -452,4 +449,6 @@ void MScanListItem::receivedBeacon()
setText( col_lastseen, QTime::currentTime().toString() );
- if ( WellenreiterConfigWindow::instance() )
- playSound( WellenreiterConfigWindow::instance()->soundOnBeacon() );
+
+ MScanListItem* p = (MScanListItem*) parent();
+ if ( p ) p->receivedBeacon();
+
}