diff options
| author | 2010-04-03 15:17:13 +0000 | |
|---|---|---|
| committer | 2010-04-03 15:17:13 +0000 | |
| commit | 2cfe650ca45d27ec87b5f40c5c97a63dfc40750c (patch) | |
| tree | 9b5b37686565ad31b08e393febd1859133000fd8 /src | |
| parent | modified message-tidy-* targets so that it works with defscripts translations... (diff) | |
| download | KVIrc-2cfe650ca45d27ec87b5f40c5c97a63dfc40750c.tar.gz KVIrc-2cfe650ca45d27ec87b5f40c5c97a63dfc40750c.tar.bz2 KVIrc-2cfe650ca45d27ec87b5f40c5c97a63dfc40750c.zip | |
implemented scaling down in iograph (#612)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4238 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/iograph/libkviiograph.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/modules/iograph/libkviiograph.cpp b/src/modules/iograph/libkviiograph.cpp index 926ec3662..931c1f048 100644 --- a/src/modules/iograph/libkviiograph.cpp +++ b/src/modules/iograph/libkviiograph.cpp @@ -146,6 +146,8 @@ KviIOGraphWidget::KviIOGraphWidget(QWidget * par) void KviIOGraphWidget::timerEvent(QTimerEvent *) { + static int uLastResize=0; + kvi_u64_t sB = g_uOutgoingTraffic; kvi_u64_t rB = g_uIncomingTraffic; @@ -153,8 +155,25 @@ void KviIOGraphWidget::timerEvent(QTimerEvent *) unsigned int rDiff = rB - m_uLastRecvBytes; unsigned int iMax = qMax(sDiff, rDiff); - while(iMax > m_maxRate) - m_maxRate*=2; + + if(uLastResize == 0) + { + if(m_maxRate > 1) + { + m_maxRate=1; + for(int i=0;i<m_sendRates.count();++i) + while(m_sendRates.at(i) > m_maxRate) m_maxRate*=2; + for(int i=0;i<m_recvRates.count();++i) + while(m_recvRates.at(i) > m_maxRate) m_maxRate*=2; + } + } else uLastResize--; + + if(iMax > m_maxRate) + { + while(iMax > m_maxRate) + m_maxRate*=2; + uLastResize=KVI_IOGRAPH_NUMBER_POINTS; + } m_uLastSentBytes = sB; m_uLastRecvBytes = rB; |
