mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-25 17:21:05 -04:00
forgot to commit this patch to make the bandwidth graph refresh rate smoother
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5590 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1c3d6e7c16
commit
0cb0a9b0f9
3 changed files with 11 additions and 9 deletions
|
@ -90,7 +90,7 @@ BandwidthGraph::BandwidthGraph(QWidget *parent, Qt::WFlags flags)
|
||||||
|
|
||||||
QTimer *timer = new QTimer(this);
|
QTimer *timer = new QTimer(this);
|
||||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updategraphstatus()));
|
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updategraphstatus()));
|
||||||
timer->start(5113);
|
timer->start(BWGRAPH_REFRESH_RATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Custom event handler. Checks if the event is a bandwidth update event. If it
|
/** Custom event handler. Checks if the event is a bandwidth update event. If it
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
|
|
||||||
#include "ui_bwgraph.h"
|
#include "ui_bwgraph.h"
|
||||||
|
|
||||||
/** Redraw graph every 1000ms **/
|
/** Redraw graph every BWGRAPH_REFRESH_RATE ms **/
|
||||||
#define REFRESH_RATE 1000
|
#define BWGRAPH_REFRESH_RATE 5113
|
||||||
|
|
||||||
|
|
||||||
class BandwidthGraph : public RWindow
|
class BandwidthGraph : public RWindow
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
#include "graphframe.h"
|
#include "graphframe.h"
|
||||||
|
#include "gui/bwgraph/bwgraph.h"
|
||||||
|
|
||||||
|
|
||||||
/** Default contructor */
|
/** Default contructor */
|
||||||
|
@ -79,8 +80,9 @@ GraphFrame::addPoints(qreal recv, qreal send)
|
||||||
_recvData->prepend(recv);
|
_recvData->prepend(recv);
|
||||||
|
|
||||||
/* Add to the total counters */
|
/* Add to the total counters */
|
||||||
_totalSend += send;
|
/* These are not the real total values, but should be close enough. */
|
||||||
_totalRecv += recv;
|
_totalSend += BWGRAPH_REFRESH_RATE * send / 1000;
|
||||||
|
_totalRecv += BWGRAPH_REFRESH_RATE * recv / 1000;
|
||||||
|
|
||||||
/* Check for a new maximum value */
|
/* Check for a new maximum value */
|
||||||
if (send > _maxValue) _maxValue = send;
|
if (send > _maxValue) _maxValue = send;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue