mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 07:25:36 -04:00
Fixes for visState -> vs_disc & vs_dht.
Added RTT Gui. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6775 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
90aa57a0f0
commit
ba157e4891
15 changed files with 644 additions and 134 deletions
|
@ -62,9 +62,10 @@
|
|||
/****
|
||||
* #define SHOW_RTT_STATISTICS 1
|
||||
****/
|
||||
#define SHOW_RTT_STATISTICS 1
|
||||
|
||||
#ifdef SHOW_RTT_STATISTICS
|
||||
#include "VoipStatistics.h"
|
||||
#include "RttStatistics.h"
|
||||
#endif
|
||||
|
||||
/* Images for context menu icons */
|
||||
|
@ -333,6 +334,10 @@ TransfersDialog::TransfersDialog(QWidget *parent)
|
|||
|
||||
ui.tabWidget->addTab(localSharedFiles = new LocalSharedFilesDialog(), QIcon(IMAGE_MYFILES), tr("My files")) ;
|
||||
|
||||
#ifdef SHOW_RTT_STATISTICS
|
||||
ui.tabWidget->addTab( new RttStatistics(), tr("RTT Statistics")) ;
|
||||
#endif
|
||||
|
||||
//ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ;
|
||||
//ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ;
|
||||
|
||||
|
@ -899,7 +904,7 @@ void TransfersDialog::setDestinationDirectory()
|
|||
}
|
||||
}
|
||||
|
||||
int TransfersDialog::addItem(int row, const FileInfo &fileInfo, const std::map<std::string, std::string> &versions)
|
||||
int TransfersDialog::addItem(int row, const FileInfo &fileInfo)
|
||||
{
|
||||
QString fileHash = QString::fromStdString(fileInfo.hash);
|
||||
double fileDlspeed = (fileInfo.downloadStatus == FT_STATE_DOWNLOADING) ? (fileInfo.tfRate * 1024.0) : 0.0;
|
||||
|
@ -1026,8 +1031,10 @@ int TransfersDialog::addItem(int row, const FileInfo &fileInfo, const std::map<s
|
|||
//unique combination: fileHash + peerId, variant: hash + peerName (too long)
|
||||
QString hashFileAndPeerId = fileHash + QString::fromStdString(transferInfo.peerId);
|
||||
QString version;
|
||||
if (versions.end() != (vit = versions.find(transferInfo.peerId))) {
|
||||
version = tr("version: ") + QString::fromStdString(vit->second);
|
||||
std::string rsversion;
|
||||
if (rsDisc->getPeerVersion(transferInfo.peerId, rsversion))
|
||||
{
|
||||
version = tr("version: ") + QString::fromStdString(rsversion);
|
||||
}
|
||||
|
||||
double peerDlspeed = 0;
|
||||
|
@ -1222,10 +1229,6 @@ void TransfersDialog::insertTransfers()
|
|||
std::list<std::string> downHashes;
|
||||
rsFiles->FileDownloads(downHashes);
|
||||
|
||||
/* get only once */
|
||||
std::map<std::string, std::string> versions;
|
||||
rsDisc->getDiscVersions(versions);
|
||||
|
||||
/* build set for quick search */
|
||||
std::set<std::string> hashs;
|
||||
std::list<std::string>::iterator it;
|
||||
|
@ -1266,7 +1269,7 @@ void TransfersDialog::insertTransfers()
|
|||
|
||||
hashs.erase(hashIt);
|
||||
|
||||
if (addItem(row, fileInfo, versions) < 0) {
|
||||
if (addItem(row, fileInfo) < 0) {
|
||||
DLListModel->removeRow(row);
|
||||
rowCount = DLListModel->rowCount();
|
||||
continue;
|
||||
|
@ -1288,7 +1291,7 @@ void TransfersDialog::insertTransfers()
|
|||
continue;
|
||||
}
|
||||
|
||||
addItem(-1, fileInfo, versions);
|
||||
addItem(-1, fileInfo);
|
||||
}
|
||||
|
||||
ui.downloadList->setSortingEnabled(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue