author | mickeyl <mickeyl> | 2004-08-24 11:53:43 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-08-24 11:53:43 (UTC) |
commit | b06390cb17114692a9fd5233d77620b385252480 (patch) (side-by-side diff) | |
tree | 91de2ed5b0eb6ed739eb6bd0126e2ad004d6a9bd /noncore/net/wellenreiter/gui/scanlist.cpp | |
parent | 94611edc1942717faa15861adef25418e40ea626 (diff) | |
download | opie-b06390cb17114692a9fd5233d77620b385252480.zip opie-b06390cb17114692a9fd5233d77620b385252480.tar.gz opie-b06390cb17114692a9fd5233d77620b385252480.tar.bz2 |
apply megapatch courtesy Holger 'Zecke' Freyther:
- bump version to 1.0.3-cvs
- fix compile warnings
- fix PacketViewer not to scroll, when watching in "real time"
- fix appending text to log view
- update statistics when tab is getting activated
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 9e907d8..fa1d724 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp @@ -26,7 +26,5 @@ #include "resource.h" #endif -using namespace Opie::Core; -using namespace Opie::Ui; -using namespace Opie::Net; + /* QT */ @@ -39,4 +37,8 @@ using namespace Opie::Net; #include <assert.h> +using namespace Opie::Core; +using namespace Opie::Ui; +using namespace Opie::Net; + const int col_type = 0; const int col_essid = 0; @@ -52,4 +54,6 @@ const int col_lastseen = 9; const int col_location = 10; +#define DEBUG + MScanListView::MScanListView( QWidget* parent, const char* name ) :OListView( parent, name ) @@ -177,5 +181,5 @@ void MScanListView::addNewItem( const QString& type, else { - s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid ); + s = QString( "(i) New network: ESSID '%1'" ).arg( essid ); MLogWindow::logwindow()->log( s ); network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe ); @@ -196,9 +200,9 @@ void MScanListView::addNewItem( const QString& type, if ( type == "managed" ) { - s.sprintf( "(i) New Access Point in '%s' [%d]", (const char*) essid, channel ); + s = QString( "(i) New Access Point in '%1' [%2]" ).arg( essid ).arg( channel ); } else { - s.sprintf( "(i) New AdHoc station in '%s' [%d]", (const char*) essid, channel ); + s = QString( "(i) New AdHoc station in '%1' [%2]" ).arg( essid ).arg( channel ); } MLogWindow::logwindow()->log( s ); @@ -235,9 +239,9 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& if ( type == "station" ) { - s.sprintf( "(i) New Station in '%s' [xx]", (const char*) network->text( col_essid ) ); + s = QString( "(i) New Station in '%1' [xx]" ).arg( network->text( col_essid ) ); } else { - s.sprintf( "(i) New Wireless Station in '%s' [xx]", (const char*) network->text( col_essid ) ); + s = QString( "(i) New Wireless Station in '%1' [xx]" ).arg( network->text( col_essid ) ); } MLogWindow::logwindow()->log( s ); @@ -247,7 +251,7 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) { - odebug << "WDSTraffic: " << (const char*) viaFrom.toString() << " and " << viaTo.toString() << " seem to form a WDS" << oendl; + odebug << "WDSTraffic: " << viaFrom.toString() << " and " << viaTo.toString() << " seem to form a WDS" << oendl; QString s; - MScanListItem* network; +// MScanListItem* network; QListViewItemIterator it( this ); @@ -271,8 +275,8 @@ void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, -void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) +void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& /*to*/, const OMacAddress& via ) { QString s; - MScanListItem* network; +// MScanListItem* network; QListViewItemIterator it( this ); @@ -294,8 +298,8 @@ void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, -void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) +void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& /*to*/, const OMacAddress& via ) { QString s; - MScanListItem* network; +// MScanListItem* network; QListViewItemIterator it( this ); @@ -316,5 +320,5 @@ void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& t -void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) +void MScanListView::IBSStraffic( const OMacAddress& /*from*/, const OMacAddress& /*to*/, const OMacAddress& /*via*/ ) { owarn << "D'oh! Not yet implemented..." << oendl; @@ -325,5 +329,5 @@ void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) { - odebug << "identify " << (const char*) macaddr.toString() << " = " << ip << "" << oendl; + odebug << "identify " << macaddr.toString() << " = " << ip << "" << oendl; QListViewItemIterator it( this ); @@ -337,6 +341,6 @@ void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) } odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; - MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", - (const char*) macaddr.toString(), (const char*) ip ) ); + MLogWindow::logwindow()->log( QString( "WARNING: Unhandled identification %1 = %2!" ) + .arg( macaddr.toString() ).arg( ip ) ); } @@ -344,5 +348,5 @@ void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) { - odebug << "addService '" << (const char*) name << "', Server = " << (const char*) macaddr.toString() << " = " << ip << "" << oendl; + odebug << "addService '" << name << "', Server = " << macaddr.toString() << " = " << ip << "" << oendl; //TODO: Refactor that out, we need it all over the place. @@ -385,6 +389,6 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr, } odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; - MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", - (const char*) macaddr.toString(), (const char*) ip ) ); + MLogWindow::logwindow()->log( QString("WARNING: Unhandled service addition %s = %s!") + .arg( macaddr.toString() ).arg( ip ) ); } @@ -396,10 +400,10 @@ void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, in MScanListItem* itm = static_cast<MScanListItem*>( item ); - odebug << "contextMenuRequested on item '" << (const char*) itm->text(0) << "' (" - << (const char*) itm->type << ") in column: '" << col << "'" << oendl; + odebug << "contextMenuRequested on item '" << itm->text(0) << "' (" + << itm->type << ") in column: '" << col << "'" << oendl; if ( itm->type == "adhoc" || itm->type == "managed" ) { - QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() ); + QString entry = QString( "&Join %1 Net '%2'..." ).arg( itm->type ).arg( itm->essid() ); QPopupMenu m( this ); @@ -480,6 +484,5 @@ void MScanListItem::serializeFrom( QDataStream& s ) _wep = (wep == 'y'); - QString name; - name.sprintf( "wellenreiter/%s", (const char*) _type ); + QString name = QString( "wellenreiter/"+ _type ); setPixmap( col_type, Resource::loadPixmap( name ) ); if ( _wep ) @@ -491,6 +494,6 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, { #ifdef DEBUG - odebug << "decorating scanlist item " << (const char*) type << " / " - << (const char*) essid << " / " << (const char*) macaddr + odebug << "decorating scanlist item " << type << " / " + << essid << " / " << macaddr << "[" << channel << "]" << oendl; #endif @@ -498,5 +501,5 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, // set icon for managed or adhoc mode QString name; - name.sprintf( "wellenreiter/%s", (const char*) type ); + name.sprintf( "wellenreiter/"+ type ); setPixmap( col_type, Resource::loadPixmap( name ) ); |