Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlistitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp index 15aef0c..dd33f5f 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp | |||
@@ -12,12 +12,13 @@ | |||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "scanlistitem.h" | 16 | #include "scanlistitem.h" |
17 | #include <assert.h> | 17 | #include <assert.h> |
18 | #include <qdatetime.h> | ||
18 | #include <qpixmap.h> | 19 | #include <qpixmap.h> |
19 | 20 | ||
20 | #ifdef QWS | 21 | #ifdef QWS |
21 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
22 | #else | 23 | #else |
23 | #include "resource.h" | 24 | #include "resource.h" |
@@ -28,12 +29,14 @@ const int col_essid = 0; | |||
28 | const int col_sig = 1; | 29 | const int col_sig = 1; |
29 | const int col_ap = 2; | 30 | const int col_ap = 2; |
30 | const int col_channel = 3; | 31 | const int col_channel = 3; |
31 | const int col_wep = 4; | 32 | const int col_wep = 4; |
32 | const int col_traffic = 5; | 33 | const int col_traffic = 5; |
33 | const int col_manuf = 6; | 34 | const int col_manuf = 6; |
35 | const int col_firstseen = 7; | ||
36 | const int col_lastseen = 8; | ||
34 | 37 | ||
35 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, | 38 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, |
36 | bool wep, int channel, int signal ) | 39 | bool wep, int channel, int signal ) |
37 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), | 40 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), |
38 | _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), | 41 | _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), |
39 | _channel( channel ), _signal( signal ), _beacons( 0 ) | 42 | _channel( channel ), _signal( signal ), _beacons( 0 ) |
@@ -62,23 +65,26 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, | |||
62 | QString name; | 65 | QString name; |
63 | name.sprintf( "wellenreiter/%s", (const char*) type ); | 66 | name.sprintf( "wellenreiter/%s", (const char*) type ); |
64 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 67 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
65 | 68 | ||
66 | // set icon for wep (wireless encryption protocol) | 69 | // set icon for wep (wireless encryption protocol) |
67 | if ( wep ) | 70 | if ( wep ) |
68 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap! | 71 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! |
69 | 72 | ||
70 | // set channel and signal text | 73 | // set channel and signal text |
71 | 74 | ||
72 | if ( signal != -1 ) | 75 | if ( signal != -1 ) |
73 | setText( col_sig, QString::number( signal ) ); | 76 | setText( col_sig, QString::number( signal ) ); |
74 | if ( channel != -1 ) | 77 | if ( channel != -1 ) |
75 | setText( col_channel, QString::number( channel ) ); | 78 | setText( col_channel, QString::number( channel ) ); |
76 | 79 | ||
80 | setText( col_firstseen, QTime::currentTime().toString() ); | ||
81 | //setText( col_lastseen, QTime::currentTime().toString() ); | ||
82 | |||
77 | listView()->triggerUpdate(); | 83 | listView()->triggerUpdate(); |
78 | 84 | ||
79 | this->type = type; | 85 | this->type = type; |
80 | 86 | ||
81 | } | 87 | } |
82 | 88 | ||
83 | void MScanListItem::setManufacturer( const QString& manufacturer ) | 89 | void MScanListItem::setManufacturer( const QString& manufacturer ) |
84 | { | 90 | { |
@@ -89,8 +95,8 @@ void MScanListItem::receivedBeacon() | |||
89 | { | 95 | { |
90 | _beacons++; | 96 | _beacons++; |
91 | #ifdef DEBUG | 97 | #ifdef DEBUG |
92 | qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); | 98 | qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); |
93 | #endif | 99 | #endif |
94 | setText( col_sig, QString::number( _beacons ) ); | 100 | setText( col_sig, QString::number( _beacons ) ); |
101 | setText( col_lastseen, QTime::currentTime().toString() ); | ||
95 | } | 102 | } |
96 | |||