mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-10 07:10:12 -04:00
cleaned some debug text, suppressed a few memory leaks
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2624 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
068230ac8d
commit
058f965b71
7 changed files with 40 additions and 29 deletions
|
@ -227,6 +227,8 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
|
|||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Transfered: ")) ; painter->drawText(tab_size,y,QString::number(nfo.transfered) + " " + tr("bytes") + " " + "(" + misc::friendlyUnit(nfo.transfered) + ")") ;
|
||||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Remaining: ")) ; painter->drawText(tab_size,y,QString::number(info.file_size - nfo.transfered) + " " + tr("bytes") + " " + "(" + misc::friendlyUnit(info.file_size - nfo.transfered) + ")") ;
|
||||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Number of sources: ")) ; painter->drawText(tab_size,y,QString::number(info.compressed_peer_availability_maps.size())) ;
|
||||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Chunk strategy: ")) ; painter->drawText(tab_size,y,(info.strategy==FileChunksInfo::CHUNK_STRATEGY_RANDOM)?"Random":"Streaming") ;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
using namespace std ;
|
||||
|
||||
TrustView::TrustView()
|
||||
: RsAutoUpdatePage(10000)
|
||||
{
|
||||
setupUi(this) ;
|
||||
|
||||
|
@ -26,13 +27,6 @@ TrustView::TrustView()
|
|||
QObject::connect(trustTableTW->horizontalHeader(),SIGNAL(sectionClicked(int)),this,SLOT(hideShowPeers(int))) ;
|
||||
|
||||
updatePB->setToolTip(tr("This table normaly auto-updates every 10 seconds.")) ;
|
||||
|
||||
QTimer *timer = new QTimer ;
|
||||
|
||||
QObject::connect(timer,SIGNAL(timeout()),this,SLOT(update())) ;
|
||||
timer->start(10000) ;
|
||||
|
||||
update() ;
|
||||
}
|
||||
|
||||
void TrustView::showEvent(QShowEvent *e)
|
||||
|
@ -55,10 +49,11 @@ void TrustView::selectCell(int row,int col)
|
|||
{
|
||||
static int last_row = -1 ;
|
||||
static int last_col = -1 ;
|
||||
|
||||
#ifdef DEBUG_TRUSTVIEW
|
||||
cout << "row = " << row << ", column = " << col << endl;
|
||||
if(row == 0 || col == 0)
|
||||
cout << "***********************************************" << endl ;
|
||||
#endif
|
||||
if(last_row > -1)
|
||||
{
|
||||
int col_s,row_s ;
|
||||
|
@ -133,19 +128,18 @@ int TrustView::getRowColId(const string& peerid)
|
|||
return i ;
|
||||
}
|
||||
|
||||
void TrustView::updateDisplay()
|
||||
{
|
||||
update() ;
|
||||
}
|
||||
void TrustView::update()
|
||||
{
|
||||
// collect info.
|
||||
|
||||
if(!isVisible())
|
||||
return ;
|
||||
|
||||
std::list<std::string> neighs;
|
||||
|
||||
if(!rsPeers->getGPGAllList(neighs))
|
||||
if(!rsPeers->getGPGAllList(neighs))
|
||||
return ;
|
||||
|
||||
neighs.push_back(rsPeers->getGPGOwnId()) ;
|
||||
neighs.push_back(rsPeers->getGPGOwnId()) ;
|
||||
|
||||
trustTableTW->setSortingEnabled(false) ;
|
||||
|
||||
|
@ -162,9 +156,11 @@ void TrustView::update()
|
|||
int i = getRowColId(details.id) ;
|
||||
std::string issuer(details.issuer) ; // the one we check for trust.
|
||||
|
||||
for(list<string>::const_iterator it2(details.gpgSigners.begin());it2!=details.gpgSigners.end();++it2)
|
||||
for(list<string>::const_iterator it2(details.gpgSigners.begin());it2!=details.gpgSigners.end();++it2)
|
||||
{
|
||||
#ifdef DEBUG_TRUSTVIEW
|
||||
cout << *it2 << " " ;
|
||||
#endif
|
||||
|
||||
int j = getRowColId(*it2) ;
|
||||
|
||||
|
@ -175,7 +171,7 @@ void TrustView::update()
|
|||
else
|
||||
trustTableTW->item(i,j)->setText(trr) ;
|
||||
}
|
||||
// cout << endl ;
|
||||
// cout << endl ;
|
||||
}
|
||||
// assign colors
|
||||
vector<int> ni(trustTableTW->rowCount(),0) ;
|
||||
|
@ -199,7 +195,7 @@ void TrustView::update()
|
|||
if(i_ji == NULL)
|
||||
{
|
||||
i_ij->setBackgroundColor(Qt::yellow) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" is athenticated (one way) by " )+trustTableTW->verticalHeaderItem(j)->text()) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" is athenticated (one way) by " )+trustTableTW->verticalHeaderItem(j)->text()) ;
|
||||
i_ij->setText(tr("Half")) ;
|
||||
}
|
||||
else
|
||||
|
@ -207,22 +203,22 @@ void TrustView::update()
|
|||
if(i==j)
|
||||
{
|
||||
i_ij->setBackgroundColor(Qt::red) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" athenticated himself") ) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" athenticated himself") ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
i_ij->setBackgroundColor(Qt::green) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + " and " +trustTableTW->verticalHeaderItem(j)->text() + tr(" athenticated each others") ) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + " and " +trustTableTW->verticalHeaderItem(j)->text() + tr(" athenticated each others") ) ;
|
||||
i_ij->setText(tr("Full")) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i=0;i<trustTableTW->rowCount();++i)
|
||||
trustTableTW->verticalHeaderItem(i)->setToolTip(trustTableTW->verticalHeaderItem(i)->text()+ tr(" is athenticated by ") + QString::number(ni[i]) + tr(" peers, including him(her)self.")) ;
|
||||
trustTableTW->verticalHeaderItem(i)->setToolTip(trustTableTW->verticalHeaderItem(i)->text()+ tr(" is athenticated by ") + QString::number(ni[i]) + tr(" peers, including him(her)self.")) ;
|
||||
|
||||
for(int j=0;j<trustTableTW->columnCount();++j)
|
||||
trustTableTW->horizontalHeaderItem(j)->setToolTip(trustTableTW->horizontalHeaderItem(j)->text()+ tr(" athenticated ") + QString::number(nj[j]) + tr(" peers, including him(her)self.")) ;
|
||||
trustTableTW->horizontalHeaderItem(j)->setToolTip(trustTableTW->horizontalHeaderItem(j)->text()+ tr(" athenticated ") + QString::number(nj[j]) + tr(" peers, including him(her)self.")) ;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#include "ui_TrustView.h"
|
||||
#include <gui/RsAutoUpdatePage.h>
|
||||
|
||||
class QWheelEvent ;
|
||||
class QShowEvent ;
|
||||
|
||||
class TrustView: public QWidget, public Ui::TrustView
|
||||
class TrustView: public RsAutoUpdatePage, public Ui::TrustView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -14,6 +15,7 @@ class TrustView: public QWidget, public Ui::TrustView
|
|||
virtual void wheelEvent(QWheelEvent *) ;
|
||||
virtual void showEvent(QShowEvent *) ;
|
||||
|
||||
virtual void updateDisplay() ;
|
||||
public slots:
|
||||
void update() ;
|
||||
void updateZoom(int) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue