Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 59 |
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 @@ | |||
20 | #include <assert.h> | 20 | #include <assert.h> |
21 | #include "manufacturers.h" | ||
22 | #include <qdatetime.h> | 21 | #include <qdatetime.h> |
@@ -49,3 +48,3 @@ const int col_lastseen = 9; | |||
49 | MScanListView::MScanListView( QWidget* parent, const char* name ) | 48 | MScanListView::MScanListView( QWidget* parent, const char* name ) |
50 | :OListView( parent, name ), _manufacturerdb( 0 ) | 49 | :OListView( parent, name ) |
51 | { | 50 | { |
@@ -79,2 +78,3 @@ MScanListView::MScanListView( QWidget* parent, const char* name ) | |||
79 | 78 | ||
79 | |||
80 | MScanListView::~MScanListView() | 80 | MScanListView::~MScanListView() |
@@ -83,2 +83,3 @@ MScanListView::~MScanListView() | |||
83 | 83 | ||
84 | |||
84 | OListViewItem* MScanListView::childFactory() | 85 | OListViewItem* MScanListView::childFactory() |
@@ -88,2 +89,3 @@ OListViewItem* MScanListView::childFactory() | |||
88 | 89 | ||
90 | |||
89 | void MScanListView::serializeTo( QDataStream& s) const | 91 | void MScanListView::serializeTo( QDataStream& s) const |
@@ -94,2 +96,3 @@ void MScanListView::serializeTo( QDataStream& s) const | |||
94 | 96 | ||
97 | |||
95 | void MScanListView::serializeFrom( QDataStream& s) | 98 | void MScanListView::serializeFrom( QDataStream& s) |
@@ -100,10 +103,6 @@ void MScanListView::serializeFrom( QDataStream& s) | |||
100 | 103 | ||
101 | void MScanListView::setManufacturerDB( ManufacturerDB* manufacturerdb ) | ||
102 | { | ||
103 | _manufacturerdb = manufacturerdb; | ||
104 | } | ||
105 | 104 | ||
106 | void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) | 105 | void MScanListView::addNewItem( const QString& type, const QString& essid, const OMacAddress& mac, bool wep, int channel, int signal ) |
107 | { | 106 | { |
108 | // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...) | 107 | QString macaddr = mac.toString(true); |
109 | 108 | ||
@@ -170,4 +169,3 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo | |||
170 | MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); | 169 | MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); |
171 | if ( _manufacturerdb ) | 170 | station->setManufacturer( mac.manufacturer() ); |
172 | station->setManufacturer( _manufacturerdb->lookup( macaddr ) ); | ||
173 | 171 | ||
@@ -186,3 +184,3 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo | |||
186 | 184 | ||
187 | void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, const QString& type ) | 185 | void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type ) |
188 | { | 186 | { |
@@ -190,3 +188,3 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons | |||
190 | 188 | ||
191 | while ( subitem && ( subitem->text( col_ap ) != addr ) ) | 189 | while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) ) |
192 | { | 190 | { |
@@ -202,3 +200,3 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons | |||
202 | #ifdef DEBUG | 200 | #ifdef DEBUG |
203 | qDebug( "%s is a dupe - ignoring...", (const char*) addr ); | 201 | qDebug( "%s is a dupe - ignoring...", (const char*) addr.toString(true) ); |
204 | #endif | 202 | #endif |
@@ -209,5 +207,4 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons | |||
209 | // Hey, it seems to be a new item :-D | 207 | // Hey, it seems to be a new item :-D |
210 | MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr, false, -1, -1 ); | 208 | MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 ); |
211 | if ( _manufacturerdb ) | 209 | station->setManufacturer( addr.manufacturer() ); |
212 | station->setManufacturer( _manufacturerdb->lookup( addr ) ); | ||
213 | 210 | ||
@@ -226,3 +223,3 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons | |||
226 | 223 | ||
227 | void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QString viaTo ) | 224 | void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) |
228 | { | 225 | { |
@@ -233,4 +230,4 @@ void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QStri | |||
233 | while ( it.current() && | 230 | while ( it.current() && |
234 | it.current()->text( col_ap ) != viaFrom && | 231 | it.current()->text( col_ap ) != viaFrom.toString(true) && |
235 | it.current()->text( col_ap ) != viaTo ) ++it; | 232 | it.current()->text( col_ap ) != viaTo.toString(true) ) ++it; |
236 | 233 | ||
@@ -251,3 +248,3 @@ void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QStri | |||
251 | 248 | ||
252 | void MScanListView::toDStraffic( QString from, QString to, QString via ) | 249 | void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) |
253 | { | 250 | { |
@@ -257,3 +254,3 @@ void MScanListView::toDStraffic( QString from, QString to, QString via ) | |||
257 | QListViewItemIterator it( this ); | 254 | QListViewItemIterator it( this ); |
258 | while ( it.current() && it.current()->text( col_ap ) != via ) ++it; | 255 | while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it; |
259 | 256 | ||
@@ -274,3 +271,3 @@ void MScanListView::toDStraffic( QString from, QString to, QString via ) | |||
274 | 271 | ||
275 | void MScanListView::fromDStraffic( QString from, QString to, QString via ) | 272 | void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) |
276 | { | 273 | { |
@@ -280,3 +277,3 @@ void MScanListView::fromDStraffic( QString from, QString to, QString via ) | |||
280 | QListViewItemIterator it( this ); | 277 | QListViewItemIterator it( this ); |
281 | while ( it.current() && it.current()->text( col_ap ) != via ) ++it; | 278 | while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it; |
282 | 279 | ||
@@ -296,3 +293,3 @@ void MScanListView::fromDStraffic( QString from, QString to, QString via ) | |||
296 | 293 | ||
297 | void MScanListView::IBSStraffic( QString from, QString to, QString via ) | 294 | void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) |
298 | { | 295 | { |
@@ -303,5 +300,5 @@ void MScanListView::IBSStraffic( QString from, QString to, QString via ) | |||
303 | 300 | ||
304 | void MScanListView::identify( const QString& macaddr, const QString& ip ) | 301 | void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) |
305 | { | 302 | { |
306 | qDebug( "identify %s = %s", (const char*) macaddr, (const char*) ip ); | 303 | qDebug( "identify %s = %s", (const char*) macaddr.toString(), (const char*) ip ); |
307 | 304 | ||
@@ -310,3 +307,3 @@ void MScanListView::identify( const QString& macaddr, const QString& ip ) | |||
310 | { | 307 | { |
311 | if ( it.current()->text( col_ap ) == macaddr ) | 308 | if ( it.current()->text( col_ap ) == macaddr.toString(true) ) |
312 | { | 309 | { |
@@ -318,3 +315,3 @@ void MScanListView::identify( const QString& macaddr, const QString& ip ) | |||
318 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", | 315 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", |
319 | (const char*) macaddr, (const char*) ip ) ); | 316 | (const char*) macaddr.toString(), (const char*) ip ) ); |
320 | } | 317 | } |
@@ -452,4 +449,6 @@ void MScanListItem::receivedBeacon() | |||
452 | setText( col_lastseen, QTime::currentTime().toString() ); | 449 | setText( col_lastseen, QTime::currentTime().toString() ); |
453 | if ( WellenreiterConfigWindow::instance() ) | 450 | |
454 | playSound( WellenreiterConfigWindow::instance()->soundOnBeacon() ); | 451 | MScanListItem* p = (MScanListItem*) parent(); |
452 | if ( p ) p->receivedBeacon(); | ||
453 | |||
455 | } | 454 | } |