summaryrefslogtreecommitdiff
authorzecke <zecke>2005-03-12 23:56:15 (UTC)
committer zecke <zecke>2005-03-12 23:56:15 (UTC)
commiteaec48ce99bc4e2f4e53dbd539a031b3ed993fb3 (patch) (side-by-side diff)
tree0b88cd5c35336003b06a9df3717435a1ad396f09
parent0dde10390f3b9c85030741e861d893a6a78fbbb1 (diff)
downloadopie-eaec48ce99bc4e2f4e53dbd539a031b3ed993fb3.zip
opie-eaec48ce99bc4e2f4e53dbd539a031b3ed993fb3.tar.gz
opie-eaec48ce99bc4e2f4e53dbd539a031b3ed993fb3.tar.bz2
Sort packagaes and channels (numbers) according their size instead
of alphabeticaly. 9873 received packages are more than 10 but less than 10.000. The same is applied to the channel number [0..15]
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp21
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.h2
2 files changed, 23 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 8c2015e..f24e09f 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -558,12 +558,33 @@ void MScanListItem::receivedBeacon()
_beacons++;
#ifdef DEBUG
odebug << "MScanListItem " << _macaddr << ": received beacon #" << _beacons << "" << oendl;
#endif
setText( col_sig, QString::number( _beacons ) );
setText( col_lastseen, QTime::currentTime().toString() );
MScanListItem* p = (MScanListItem*) parent();
if ( p ) p->receivedBeacon();
}
+QString MScanListItem::key( int id, bool b )const {
+ QString str;
+
+ /*
+ * Pad the amount of received packages, number
+ * of the channel.
+ */
+ switch( id ) {
+ case col_sig:
+ str = text(col_sig).rightJustify( 20, '0' );
+ break;
+ case col_channel:
+ str = text(col_channel).rightJustify( 2, '0' );
+ break;
+ default:
+ str = Opie::Ui::OListViewItem::key( id, b );
+ break;
+ }
+
+ return str;
+}
diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h
index 6a80f70..8b3814a 100644
--- a/noncore/net/wellenreiter/gui/scanlist.h
+++ b/noncore/net/wellenreiter/gui/scanlist.h
@@ -101,24 +101,26 @@ class MScanListItem: public Opie::Ui::OListViewItem
int beacons() { return _beacons; };
void setSignal( int signal ) { /* TODO */ };
void receivedBeacon();
void setManufacturer( const QString& manufacturer );
void setLocation( const QString& location );
virtual Opie::Ui::OListViewItem* childFactory();
virtual void serializeTo( QDataStream& s ) const;
virtual void serializeFrom( QDataStream& s );
+ virtual QString key( int id, bool )const;
+
private:
QString _type;
QString _essid;
QString _macaddr;
bool _wep;
int _channel;
int _signal;
int _beacons;
};
//****************************** MScanListViewFactory ****************************************************************