Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 3b7120a..a2be782 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -18,19 +18,24 @@ | |||
18 | #include "logwindow.h" | 18 | #include "logwindow.h" |
19 | 19 | ||
20 | #include <assert.h> | 20 | /* OPIE */ |
21 | #include <qcursor.h> | ||
22 | #include <qdatetime.h> | ||
23 | #include <qpopupmenu.h> | ||
24 | #include <qcheckbox.h> | ||
25 | |||
26 | #ifdef QWS | 21 | #ifdef QWS |
22 | #include <opie2/odebug.h> | ||
27 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
28 | #endif | ||
29 | |||
30 | #ifdef QWS | ||
31 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
32 | #else | 25 | #else |
33 | #include "resource.h" | 26 | #include "resource.h" |
34 | #endif | 27 | #endif |
28 | using namespace Opie::Core; | ||
29 | using namespace Opie::Ui; | ||
30 | using namespace Opie::Net; | ||
31 | |||
32 | /* QT */ | ||
33 | #include <qcursor.h> | ||
34 | #include <qdatetime.h> | ||
35 | #include <qpopupmenu.h> | ||
36 | #include <qcheckbox.h> | ||
37 | |||
38 | /* STD */ | ||
39 | #include <assert.h> | ||
35 | 40 | ||
36 | const int col_type = 0; | 41 | const int col_type = 0; |
@@ -47,10 +52,4 @@ const int col_lastseen = 9; | |||
47 | const int col_location = 10; | 52 | const int col_location = 10; |
48 | 53 | ||
49 | using namespace Opie::Net; | ||
50 | using namespace Opie::Ui; | ||
51 | using namespace Opie::Net; | ||
52 | using namespace Opie::Ui; | ||
53 | using namespace Opie::Ui; | ||
54 | using namespace Opie::Net; | ||
55 | MScanListView::MScanListView( QWidget* parent, const char* name ) | 54 | MScanListView::MScanListView( QWidget* parent, const char* name ) |
56 | :OListView( parent, name ) | 55 | :OListView( parent, name ) |
@@ -107,5 +106,5 @@ OListViewItem* MScanListView::childFactory() | |||
107 | void MScanListView::serializeTo( QDataStream& s) const | 106 | void MScanListView::serializeTo( QDataStream& s) const |
108 | { | 107 | { |
109 | qDebug( "serializing MScanListView" ); | 108 | odebug << "serializing MScanListView" << oendl; |
110 | OListView::serializeTo( s ); | 109 | OListView::serializeTo( s ); |
111 | } | 110 | } |
@@ -114,5 +113,5 @@ void MScanListView::serializeTo( QDataStream& s) const | |||
114 | void MScanListView::serializeFrom( QDataStream& s) | 113 | void MScanListView::serializeFrom( QDataStream& s) |
115 | { | 114 | { |
116 | qDebug( "serializing MScanListView" ); | 115 | odebug << "serializing MScanListView" << oendl; |
117 | OListView::serializeFrom( s ); | 116 | OListView::serializeFrom( s ); |
118 | } | 117 | } |
@@ -144,5 +143,5 @@ void MScanListView::addNewItem( const QString& type, | |||
144 | { | 143 | { |
145 | #ifdef DEBUG | 144 | #ifdef DEBUG |
146 | qDebug( "itemtext: %s", (const char*) item->text( col_essid ) ); | 145 | odebug << "itemtext: " << (const char*) item->text( col_essid ) << "" << oendl; |
147 | #endif | 146 | #endif |
148 | item = static_cast<MScanListItem*> ( item->nextSibling() ); | 147 | item = static_cast<MScanListItem*> ( item->nextSibling() ); |
@@ -160,5 +159,5 @@ void MScanListView::addNewItem( const QString& type, | |||
160 | { | 159 | { |
161 | #ifdef DEBUG | 160 | #ifdef DEBUG |
162 | qDebug( "subitemtext: %s", (const char*) item->text( col_ap ) ); | 161 | odebug << "subitemtext: " << (const char*) item->text( col_ap ) << "" << oendl; |
163 | #endif | 162 | #endif |
164 | item = static_cast<MScanListItem*> ( item->nextSibling() ); | 163 | item = static_cast<MScanListItem*> ( item->nextSibling() ); |
@@ -169,5 +168,5 @@ void MScanListView::addNewItem( const QString& type, | |||
169 | // we have already seen this item, it's a dupe | 168 | // we have already seen this item, it's a dupe |
170 | #ifdef DEBUG | 169 | #ifdef DEBUG |
171 | qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); | 170 | odebug << "" << (const char*) macaddr << " is a dupe - ignoring..." << oendl; |
172 | #endif | 171 | #endif |
173 | item->receivedBeacon(); | 172 | item->receivedBeacon(); |
@@ -187,5 +186,5 @@ void MScanListView::addNewItem( const QString& type, | |||
187 | 186 | ||
188 | #ifdef DEBUG | 187 | #ifdef DEBUG |
189 | qDebug( "inserting new station %s", (const char*) macaddr ); | 188 | odebug << "inserting new station " << (const char*) macaddr << "" << oendl; |
190 | #endif | 189 | #endif |
191 | 190 | ||
@@ -213,5 +212,5 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& | |||
213 | { | 212 | { |
214 | #ifdef DEBUG | 213 | #ifdef DEBUG |
215 | qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) ); | 214 | odebug << "subitemtext: " << (const char*) subitem->text( col_ap ) << "" << oendl; |
216 | #endif | 215 | #endif |
217 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); | 216 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); |
@@ -222,5 +221,5 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& | |||
222 | // we have already seen this item, it's a dupe | 221 | // we have already seen this item, it's a dupe |
223 | #ifdef DEBUG | 222 | #ifdef DEBUG |
224 | qDebug( "%s is a dupe - ignoring...", (const char*) addr.toString(true) ); | 223 | odebug << "" << (const char*) addr.toString(true) << " is a dupe - ignoring..." << oendl; |
225 | #endif | 224 | #endif |
226 | subitem->receivedBeacon(); //FIXME: sent data bit | 225 | subitem->receivedBeacon(); //FIXME: sent data bit |
@@ -247,5 +246,5 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& | |||
247 | void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) | 246 | void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) |
248 | { | 247 | { |
249 | qDebug( "WDSTraffic: %s and %s seem to form a WDS", (const char*) viaFrom.toString(), (const char*) viaTo.toString() ); | 248 | odebug << "WDSTraffic: " << (const char*) viaFrom.toString() << " and " << (const char*) viaTo.toString() << " seem to form a WDS" << oendl; |
250 | QString s; | 249 | QString s; |
251 | MScanListItem* network; | 250 | MScanListItem* network; |
@@ -265,5 +264,5 @@ void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, | |||
265 | else | 264 | else |
266 | { | 265 | { |
267 | qDebug( "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" ); | 266 | odebug << "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" << oendl; |
268 | MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); | 267 | MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); |
269 | } | 268 | } |
@@ -287,5 +286,5 @@ void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, | |||
287 | else | 286 | else |
288 | { | 287 | { |
289 | qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); | 288 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; |
290 | MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); | 289 | MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); |
291 | 290 | ||
@@ -310,5 +309,5 @@ void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& t | |||
310 | else | 309 | else |
311 | { | 310 | { |
312 | qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); | 311 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; |
313 | MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); | 312 | MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); |
314 | } | 313 | } |
@@ -318,5 +317,5 @@ void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& t | |||
318 | void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) | 317 | void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) |
319 | { | 318 | { |
320 | qWarning( "D'oh! Not yet implemented..." ); | 319 | owarn << "D'oh! Not yet implemented..." << oendl; |
321 | MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); | 320 | MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); |
322 | } | 321 | } |
@@ -325,5 +324,5 @@ void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, | |||
325 | void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) | 324 | void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) |
326 | { | 325 | { |
327 | qDebug( "identify %s = %s", (const char*) macaddr.toString(), (const char*) ip ); | 326 | odebug << "identify " << (const char*) macaddr.toString() << " = " << (const char*) ip << "" << oendl; |
328 | 327 | ||
329 | QListViewItemIterator it( this ); | 328 | QListViewItemIterator it( this ); |
@@ -336,5 +335,5 @@ void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) | |||
336 | } | 335 | } |
337 | } | 336 | } |
338 | qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); | 337 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; |
339 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", | 338 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", |
340 | (const char*) macaddr.toString(), (const char*) ip ) ); | 339 | (const char*) macaddr.toString(), (const char*) ip ) ); |
@@ -344,5 +343,5 @@ void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) | |||
344 | void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) | 343 | void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) |
345 | { | 344 | { |
346 | qDebug( "addService '%s', Server = %s = %s", (const char*) name, (const char*) macaddr.toString(), (const char*) ip ); | 345 | odebug << "addService '" << (const char*) name << "', Server = " << (const char*) macaddr.toString() << " = " << (const char*) ip << "" << oendl; |
347 | 346 | ||
348 | //TODO: Refactor that out, we need it all over the place. | 347 | //TODO: Refactor that out, we need it all over the place. |
@@ -361,5 +360,5 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr, | |||
361 | { | 360 | { |
362 | #ifdef DEBUG | 361 | #ifdef DEBUG |
363 | qDebug( "subitemtext: %s", (const char*) subitem->text( col_essid ) ); | 362 | odebug << "subitemtext: " << (const char*) subitem->text( col_essid ) << "" << oendl; |
364 | #endif | 363 | #endif |
365 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); | 364 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); |
@@ -370,5 +369,5 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr, | |||
370 | // we have already seen this item, it's a dupe | 369 | // we have already seen this item, it's a dupe |
371 | #ifdef DEBUG | 370 | #ifdef DEBUG |
372 | qDebug( "%s is a dupe - ignoring...", (const char*) name ); | 371 | odebug << "" << (const char*) name << " is a dupe - ignoring..." << oendl; |
373 | #endif | 372 | #endif |
374 | subitem->receivedBeacon(); //FIXME: sent data bit | 373 | subitem->receivedBeacon(); //FIXME: sent data bit |
@@ -384,5 +383,5 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr, | |||
384 | } | 383 | } |
385 | } | 384 | } |
386 | qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); | 385 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; |
387 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", | 386 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", |
388 | (const char*) macaddr.toString(), (const char*) ip ) ); | 387 | (const char*) macaddr.toString(), (const char*) ip ) ); |
@@ -422,5 +421,5 @@ MScanListItem::MScanListItem( QListView* parent, const QString& type, const QStr | |||
422 | { | 421 | { |
423 | #ifdef DEBUG | 422 | #ifdef DEBUG |
424 | qDebug( "creating scanlist item" ); | 423 | odebug << "creating scanlist item" << oendl; |
425 | #endif | 424 | #endif |
426 | 425 | ||
@@ -436,5 +435,5 @@ MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const | |||
436 | { | 435 | { |
437 | #ifdef DEBUG | 436 | #ifdef DEBUG |
438 | qDebug( "creating scanlist item" ); | 437 | odebug << "creating scanlist item" << oendl; |
439 | #endif | 438 | #endif |
440 | if ( WellenreiterConfigWindow::instance() ) | 439 | if ( WellenreiterConfigWindow::instance() ) |
@@ -460,5 +459,5 @@ void MScanListItem::serializeTo( QDataStream& s ) const | |||
460 | { | 459 | { |
461 | #ifdef DEBUG | 460 | #ifdef DEBUG |
462 | qDebug( "serializing MScanListItem" ); | 461 | odebug << "serializing MScanListItem" << oendl; |
463 | #endif | 462 | #endif |
464 | OListViewItem::serializeTo( s ); | 463 | OListViewItem::serializeTo( s ); |
@@ -471,5 +470,5 @@ void MScanListItem::serializeFrom( QDataStream& s ) | |||
471 | { | 470 | { |
472 | #ifdef DEBUG | 471 | #ifdef DEBUG |
473 | qDebug( "serializing MScanListItem" ); | 472 | odebug << "serializing MScanListItem" << oendl; |
474 | #endif | 473 | #endif |
475 | OListViewItem::serializeFrom( s ); | 474 | OListViewItem::serializeFrom( s ); |
@@ -557,5 +556,5 @@ void MScanListItem::receivedBeacon() | |||
557 | _beacons++; | 556 | _beacons++; |
558 | #ifdef DEBUG | 557 | #ifdef DEBUG |
559 | qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); | 558 | odebug << "MScanListItem " << (const char*) _macaddr << ": received beacon #" << _beacons << "" << oendl; |
560 | #endif | 559 | #endif |
561 | setText( col_sig, QString::number( _beacons ) ); | 560 | setText( col_sig, QString::number( _beacons ) ); |