diff --git a/libretroshare/src/dbase/findex.cc b/libretroshare/src/dbase/findex.cc index fd82941d8..7bb2be399 100644 --- a/libretroshare/src/dbase/findex.cc +++ b/libretroshare/src/dbase/findex.cc @@ -947,12 +947,20 @@ int FileIndex::saveIndex(std::string filename, std::string &fileHash, uint64_t & std::map::iterator it; for(it = root->subdirs.begin(); it != root->subdirs.end(); it++) { +#ifdef FI_DEBUG std::cout << "writting root directory: name=" << it->second->name << ", path=" << it->second->path << std::endl ; +#endif if(forbidden_dirs.find(it->second->name) != forbidden_dirs.end()) + { +#ifdef FI_DEBUG std::cerr << " will be suppressed." << std::endl ; +#endif + } else { +#ifdef FI_DEBUG std::cerr << " will be saved." << std::endl ; +#endif (it->second)->saveEntry(oss); } } diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index 5a0045eb8..2f9296019 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -57,7 +57,6 @@ * #define CONTROL_DEBUG 1 * #define DEBUG_DWLQUEUE 1 *****/ -#define DEBUG_DWLQUEUE 1 static const uint32_t SAVE_TRANSFERS_DELAY = 61 ; // save transfer progress every 61 seconds. static const uint32_t INACTIVE_CHUNKS_CHECK_DELAY = 60 ; // time after which an inactive chunk is released diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index 6e4b08400..15068ea79 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -34,7 +34,9 @@ #include "serialiser/rsconfigitems.h" +/* #define CONFIG_DEBUG 1 +*/ #define BACKEDUP_SAVE @@ -184,8 +186,8 @@ bool p3ConfigMgr::backedUpFileSave(const std::string& fname, const std::string& const std::string& sign_fname_backup, BinMemInterface* configbio, BinMemInterface* signbio){ FILE *file = NULL, *sign = NULL; - char *config_buff, *sign_buff; - int size_file, size_sign; + char *config_buff=NULL, *sign_buff=NULL; + int size_file=0, size_sign=0; // begin two pass saving by writing to back up file instead if (!configbio->writetofile(fname_backup.c_str()) || !signbio->writetofile(sign_fname_backup.c_str())) @@ -665,7 +667,7 @@ bool p3Config::backedUpFileSave(const std::string& cfg_fname, const std::string& uint32_t stream_flags = BIN_FLAGS_WRITEABLE; bool written = true; FILE* cfg_file = NULL; - char* buff; + char* buff=NULL; int size_file = 0; if (!cleanup) diff --git a/libretroshare/src/services/p3chatservice.cc b/libretroshare/src/services/p3chatservice.cc index 29edfd1b5..9afe90a32 100644 --- a/libretroshare/src/services/p3chatservice.cc +++ b/libretroshare/src/services/p3chatservice.cc @@ -594,15 +594,17 @@ void p3ChatService::sendAvatarJpegData(const std::string& peer_id) // take avatar, and embed it into a std::wstring. // +#ifdef CHAT_DEBUG std::cerr << "p3ChatService::sending avatar image to peer" << peer_id << ", image size = " << ci->image_size << std::endl ; std::cerr << std::endl; +#endif sendItem(ci) ; } else { - #ifdef CHAT_DEBUG +#ifdef CHAT_DEBUG std::cerr << "Doing nothing" << std::endl ; - #endif +#endif } } diff --git a/retroshare-gui/src/gui/FileTransferInfoWidget.cpp b/retroshare-gui/src/gui/FileTransferInfoWidget.cpp index d60b07e01..c006680c9 100644 --- a/retroshare-gui/src/gui/FileTransferInfoWidget.cpp +++ b/retroshare-gui/src/gui/FileTransferInfoWidget.cpp @@ -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") ; diff --git a/retroshare-gui/src/gui/TrustView.cpp b/retroshare-gui/src/gui/TrustView.cpp index aeb407576..7fbd81667 100644 --- a/retroshare-gui/src/gui/TrustView.cpp +++ b/retroshare-gui/src/gui/TrustView.cpp @@ -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 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::const_iterator it2(details.gpgSigners.begin());it2!=details.gpgSigners.end();++it2) + for(list::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 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;irowCount();++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;jcolumnCount();++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.")) ; } diff --git a/retroshare-gui/src/gui/TrustView.h b/retroshare-gui/src/gui/TrustView.h index bbc5b6077..1ebc3b630 100644 --- a/retroshare-gui/src/gui/TrustView.h +++ b/retroshare-gui/src/gui/TrustView.h @@ -1,9 +1,10 @@ #include "ui_TrustView.h" +#include 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) ;