author | mickeyl <mickeyl> | 2003-10-05 13:12:45 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-10-05 13:12:45 (UTC) |
commit | 634a68b636a0fa24232029b79ffa915a5621b2be (patch) (unidiff) | |
tree | 3e4c58bebfd624e841c314f1db68d985d81cdc6c /noncore/net/wellenreiter/gui/scanlist.cpp | |
parent | dc9510f788212a6be063349461540e4bea690f51 (diff) | |
download | opie-634a68b636a0fa24232029b79ffa915a5621b2be.zip opie-634a68b636a0fa24232029b79ffa915a5621b2be.tar.gz opie-634a68b636a0fa24232029b79ffa915a5621b2be.tar.bz2 |
* start with preparations for scanning wired networks
* dhcp recognition now works nicely
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 245290d..9d6ed6a 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -341,2 +341,50 @@ void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) | |||
341 | 341 | ||
342 | void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) | ||
343 | { | ||
344 | qDebug( "addService '%s', Server = %s = %s", (const char*) name, (const char*) macaddr.toString(), (const char*) ip ); | ||
345 | |||
346 | //TODO: Refactor that out, we need it all over the place. | ||
347 | // Best to do it in a more comfortable abstraction in OListView | ||
348 | // (Hmm, didn't I already start something in this direction?) | ||
349 | |||
350 | QListViewItemIterator it( this ); | ||
351 | for ( ; it.current(); ++it ) | ||
352 | { | ||
353 | if ( it.current()->text( col_ap ) == macaddr.toString(true) ) | ||
354 | { | ||
355 | |||
356 | MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() ); | ||
357 | |||
358 | while ( subitem && ( subitem->text( col_essid ) != name ) ) | ||
359 | { | ||
360 | #ifdef DEBUG | ||
361 | qDebug( "subitemtext: %s", (const char*) subitem->text( col_essid ) ); | ||
362 | #endif | ||
363 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); | ||
364 | } | ||
365 | |||
366 | if ( subitem ) | ||
367 | { | ||
368 | // we have already seen this item, it's a dupe | ||
369 | #ifdef DEBUG | ||
370 | qDebug( "%s is a dupe - ignoring...", (const char*) name ); | ||
371 | #endif | ||
372 | subitem->receivedBeacon(); //FIXME: sent data bit | ||
373 | return; | ||
374 | } | ||
375 | |||
376 | // never seen that - add new item | ||
377 | |||
378 | MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", false, -1, -1 ); | ||
379 | item->setText( col_essid, name ); | ||
380 | |||
381 | return; | ||
382 | } | ||
383 | } | ||
384 | qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); | ||
385 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", | ||
386 | (const char*) macaddr.toString(), (const char*) ip ) ); | ||
387 | } | ||
388 | |||
389 | |||
342 | void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) | 390 | void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) |