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/packetview.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/packetview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/packetview.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/packetview.cpp b/noncore/net/wellenreiter/gui/packetview.cpp index 69438fa..d71111f 100644 --- a/noncore/net/wellenreiter/gui/packetview.cpp +++ b/noncore/net/wellenreiter/gui/packetview.cpp @@ -72,4 +72,11 @@ PacketView::PacketView( QWidget * parent, const char * name, WFlags f ) void PacketView::add( const OPacket* p, int size ) { + /* + * don't scroll away when somebody views packages + * while scanning + */ + int value = _number->value(); + bool last = (value == static_cast<int>( _packets.count() ) ); + odebug << "PacketView::add() size = " << size << oendl; if ( size == -1 ) // unlimited buffer @@ -79,8 +86,12 @@ void PacketView::add( const OPacket* p, int size ) else { // limited buffer, limit = size - while ( _packets.count() >= size ) + while ( _packets.count() >= static_cast<uint>( size ) ) { _packets.removeFirst(); + --value; } + + /* check if we lost our packet */ + last = ( value < 1 ); _packets.append( p ); } @@ -88,5 +99,5 @@ void PacketView::add( const OPacket* p, int size ) _number->setMinValue( 1 ); _number->setMaxValue( _packets.count() ); - _number->setValue( _packets.count() ); + _number->setValue( last ? _packets.count() : value ); } @@ -140,4 +151,5 @@ void PacketView::_doHexPacket( const OPacket* p ) const QString PacketView::getLog() const { + return QString::null; } |