mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 16:45:11 -04:00
merge of branch v0.6-idclean 7180
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7187 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7815efb16f
commit
0f29d28b1b
397 changed files with 6503 additions and 5702 deletions
|
@ -99,7 +99,7 @@ DetailsDialog::show()
|
|||
}
|
||||
}
|
||||
|
||||
void DetailsDialog::setFileHash(const std::string & hash)
|
||||
void DetailsDialog::setFileHash(const RsFileHash & hash)
|
||||
{
|
||||
dynamic_cast<FileTransferInfoWidget*>(ui.fileTransferInfoWidget->widget())->setFileHash(hash) ;
|
||||
|
||||
|
@ -108,7 +108,7 @@ void DetailsDialog::setFileHash(const std::string & hash)
|
|||
return ;
|
||||
|
||||
RetroShareLink link ;
|
||||
link.createFile(QString::fromUtf8(nfo.fname.c_str()),nfo.size,QString::fromStdString(nfo.hash)) ;
|
||||
link.createFile(QString::fromUtf8(nfo.fname.c_str()),nfo.size,QString::fromStdString(nfo.hash.toStdString())) ;
|
||||
|
||||
ui.Linktext->setText(link.toString()) ;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include "ui_DetailsDialog.h"
|
||||
#include <retroshare/rstypes.h>
|
||||
|
||||
class FileChunksInfo ;
|
||||
|
||||
|
@ -37,7 +38,7 @@ public:
|
|||
/** Default destructor */
|
||||
~DetailsDialog() {}
|
||||
|
||||
void setFileHash(const std::string& hash) ;
|
||||
void setFileHash(const RsFileHash &hash) ;
|
||||
|
||||
public slots:
|
||||
/** Overloaded QWidget.show */
|
||||
|
@ -52,7 +53,7 @@ private:
|
|||
|
||||
class QStandardItemModel *CommentsModel;
|
||||
|
||||
std::string _file_hash ;
|
||||
RsFileHash _file_hash ;
|
||||
|
||||
|
||||
/** Qt Designer generated object */
|
||||
|
|
|
@ -227,7 +227,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
|
|||
int nb_src = 0 ;
|
||||
int chunk_num = (int)floor(i/float(availability_map_size_X)*(nb_chunks-1)) ;
|
||||
|
||||
for(std::map<std::string,CompressedChunkMap>::const_iterator it(info.compressed_peer_availability_maps.begin());it!=info.compressed_peer_availability_maps.end();++it)
|
||||
for(std::map<RsPeerId,CompressedChunkMap>::const_iterator it(info.compressed_peer_availability_maps.begin());it!=info.compressed_peer_availability_maps.end();++it)
|
||||
nb_src += it->second[chunk_num] ;
|
||||
|
||||
painter->setPen(QColor::fromHsv(200,std::min(255,50*nb_src),200)) ; // the more sources, the more saturated
|
||||
|
@ -248,7 +248,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
|
|||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Destination folder") + ":") ; painter->drawText(tab_size,y,QString::fromUtf8(nfo.path.c_str())) ;
|
||||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("File hash") + ":") ; painter->drawText(tab_size,y,QString::fromStdString(nfo.hash)) ;
|
||||
y += text_height ; painter->drawText(20,y,tr("File hash") + ":") ; painter->drawText(tab_size,y,QString::fromStdString(nfo.hash.toStdString())) ;
|
||||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("File size") + ":") ; painter->drawText(tab_size,y,QString::number(info.file_size) + " " + tr("bytes") + " " + "(" + misc::friendlyUnit(info.file_size) + ")") ;
|
||||
y += block_sep ;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <QPainter>
|
||||
#include <QBitmap>
|
||||
#include "RsAutoUpdatePage.h"
|
||||
#include <retroshare/rstypes.h>
|
||||
|
||||
class FileChunksInfo ;
|
||||
class FileInfo ;
|
||||
|
@ -36,7 +37,7 @@ class FileTransferInfoWidget : public RsAutoUpdatePage
|
|||
public:
|
||||
FileTransferInfoWidget(QWidget * parent = 0, Qt::WindowFlags f = 0 );
|
||||
|
||||
void setFileHash(const std::string& hash) { _file_hash = hash ; }
|
||||
void setFileHash(const RsFileHash& hash) { _file_hash = hash ; }
|
||||
|
||||
virtual void updateDisplay() ; // update from RsAutoUpdateWidget
|
||||
protected:
|
||||
|
@ -57,6 +58,6 @@ private:
|
|||
QPixmap notDownloadPixmap;
|
||||
QPixmap checkingPixmap;
|
||||
|
||||
std::string _file_hash ;
|
||||
RsFileHash _file_hash ;
|
||||
};
|
||||
|
||||
|
|
|
@ -621,7 +621,7 @@ void TransfersDialog::processSettings(bool bLoad)
|
|||
|
||||
void TransfersDialog::downloadListCustomPopupMenu( QPoint /*point*/ )
|
||||
{
|
||||
std::set<std::string> items;
|
||||
std::set<RsFileHash> items;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
bool single = (items.size() == 1) ;
|
||||
|
@ -677,7 +677,7 @@ void TransfersDialog::downloadListCustomPopupMenu( QPoint /*point*/ )
|
|||
if ( lst[i].column() == 0)
|
||||
{
|
||||
//Get Info for current item
|
||||
if (rsFiles->FileDetails(getID(lst[i].row(), DLListModel).toStdString(), RS_FILE_HINTS_DOWNLOAD, info))
|
||||
if (rsFiles->FileDetails(RsFileHash(getID(lst[i].row(), DLListModel).toStdString()), RS_FILE_HINTS_DOWNLOAD, info))
|
||||
{
|
||||
/*const uint32_t FT_STATE_FAILED = 0x0000 ;
|
||||
const uint32_t FT_STATE_OKAY = 0x0001 ;
|
||||
|
@ -852,7 +852,7 @@ void TransfersDialog::uploadsListCustomPopupMenu( QPoint /*point*/ )
|
|||
{
|
||||
std::cerr << "TransfersDialog::uploadsListCustomPopupMenu()" << std::endl;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<RsFileHash> items;
|
||||
getULSelectedItems(&items, NULL);
|
||||
|
||||
bool single = (items.size() == 1);
|
||||
|
@ -885,23 +885,23 @@ void TransfersDialog::chooseDestinationDirectory()
|
|||
if(dest_dir.isNull())
|
||||
return ;
|
||||
|
||||
std::set<std::string> items ;
|
||||
std::set<RsFileHash> items ;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for(std::set<std::string>::const_iterator it(items.begin());it!=items.end();++it)
|
||||
for(std::set<RsFileHash>::const_iterator it(items.begin());it!=items.end();++it)
|
||||
{
|
||||
std::cerr << "Setting new directory " << dest_dir.toUtf8().data() << " to file " << *it << std::endl;
|
||||
rsFiles->setDestinationDirectory(*it,dest_dir.toUtf8().data() ) ;
|
||||
rsFiles->setDestinationDirectory(*it,dest_dir.toUtf8().data() ) ;
|
||||
}
|
||||
}
|
||||
void TransfersDialog::setDestinationDirectory()
|
||||
{
|
||||
std::string dest_dir(qobject_cast<QAction*>(sender())->data().toString().toUtf8().data()) ;
|
||||
|
||||
std::set<std::string> items ;
|
||||
std::set<RsFileHash> items ;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for(std::set<std::string>::const_iterator it(items.begin());it!=items.end();++it)
|
||||
for(std::set<RsFileHash>::const_iterator it(items.begin());it!=items.end();++it)
|
||||
{
|
||||
std::cerr << "Setting new directory " << dest_dir << " to file " << *it << std::endl;
|
||||
rsFiles->setDestinationDirectory(*it,dest_dir) ;
|
||||
|
@ -910,7 +910,7 @@ void TransfersDialog::setDestinationDirectory()
|
|||
|
||||
int TransfersDialog::addItem(int row, const FileInfo &fileInfo)
|
||||
{
|
||||
QString fileHash = QString::fromStdString(fileInfo.hash);
|
||||
QString fileHash = QString::fromStdString(fileInfo.hash.toStdString());
|
||||
double fileDlspeed = (fileInfo.downloadStatus == FT_STATE_DOWNLOADING) ? (fileInfo.tfRate * 1024.0) : 0.0;
|
||||
|
||||
QString status;
|
||||
|
@ -951,7 +951,7 @@ int TransfersDialog::addItem(int row, const FileInfo &fileInfo)
|
|||
if (fileInfo.downloadStatus == FT_STATE_COMPLETE)
|
||||
file = QFileInfo(QString::fromUtf8(fileInfo.path.c_str()), QString::fromUtf8(fileInfo.fname.c_str()));
|
||||
else
|
||||
file = QFileInfo(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()), QString::fromUtf8(fileInfo.hash.c_str()));
|
||||
file = QFileInfo(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()), QString::fromUtf8(fileInfo.hash.toStdString().c_str()));
|
||||
|
||||
/*Get Last Access on File */
|
||||
if (file.exists())
|
||||
|
@ -1034,7 +1034,7 @@ int TransfersDialog::addItem(int row, const FileInfo &fileInfo)
|
|||
|
||||
QString peerName = getPeerName(transferInfo.peerId);
|
||||
//unique combination: fileHash + peerId, variant: hash + peerName (too long)
|
||||
QString hashFileAndPeerId = fileHash + QString::fromStdString(transferInfo.peerId);
|
||||
QString hashFileAndPeerId = fileHash + QString::fromStdString(transferInfo.peerId.toStdString());
|
||||
QString version;
|
||||
std::string rsversion;
|
||||
if (rsDisc->getPeerVersion(transferInfo.peerId, rsversion))
|
||||
|
@ -1232,12 +1232,12 @@ void TransfersDialog::insertTransfers()
|
|||
ui.downloadList->setSortingEnabled(false);
|
||||
|
||||
/* get the download lists */
|
||||
std::list<std::string> downHashes;
|
||||
std::list<RsFileHash> downHashes;
|
||||
rsFiles->FileDownloads(downHashes);
|
||||
|
||||
/* build set for quick search */
|
||||
std::set<std::string> hashs;
|
||||
std::list<std::string>::iterator it;
|
||||
std::set<RsFileHash> hashs;
|
||||
std::list<RsFileHash>::iterator it;
|
||||
for (it = downHashes.begin(); it != downHashes.end(); ++it) {
|
||||
hashs.insert(*it);
|
||||
}
|
||||
|
@ -1246,10 +1246,10 @@ void TransfersDialog::insertTransfers()
|
|||
|
||||
int rowCount = DLListModel->rowCount();
|
||||
int row ;
|
||||
std::set<std::string>::iterator hashIt;
|
||||
std::set<RsFileHash>::iterator hashIt;
|
||||
|
||||
for (row = 0; row < rowCount; ) {
|
||||
std::string hash = DLListModel->item(row, COLUMN_ID)->data(Qt::UserRole).toString().toStdString();
|
||||
RsFileHash hash ( DLListModel->item(row, COLUMN_ID)->data(Qt::UserRole).toString().toStdString());
|
||||
|
||||
hashIt = hashs.find(hash);
|
||||
if (hashIt == hashs.end()) {
|
||||
|
@ -1306,12 +1306,12 @@ void TransfersDialog::insertTransfers()
|
|||
|
||||
// Now show upload hashes
|
||||
//
|
||||
std::list<std::string> upHashes;
|
||||
std::list<RsFileHash> upHashes;
|
||||
rsFiles->FileUploads(upHashes);
|
||||
|
||||
std::string ownId = rsPeers->getOwnId();
|
||||
RsPeerId ownId = rsPeers->getOwnId();
|
||||
|
||||
std::set<std::string> used_hashes ;
|
||||
std::set<std::string> used_hashes ;
|
||||
|
||||
for(it = upHashes.begin(); it != upHashes.end(); it++)
|
||||
{
|
||||
|
@ -1328,7 +1328,7 @@ void TransfersDialog::insertTransfers()
|
|||
if (pit->peerId == ownId) //don't display transfer to ourselves
|
||||
continue ;
|
||||
|
||||
QString fileHash = QString::fromStdString(info.hash);
|
||||
QString fileHash = QString::fromStdString(info.hash.toStdString());
|
||||
QString fileName = QString::fromUtf8(info.fname.c_str());
|
||||
QString source = getPeerName(pit->peerId);
|
||||
|
||||
|
@ -1376,9 +1376,9 @@ void TransfersDialog::insertTransfers()
|
|||
pinfo.progress = (info.size>0)?((pit->transfered % chunk_size)*100.0/info.size):0 ;
|
||||
}
|
||||
|
||||
addUploadItem("", fileName, fileHash, fileSize, pinfo, dlspeed, source,QString::fromStdString(pit->peerId), status, completed, remaining);
|
||||
addUploadItem("", fileName, fileHash, fileSize, pinfo, dlspeed, source,QString::fromStdString(pit->peerId.toStdString()), status, completed, remaining);
|
||||
|
||||
used_hashes.insert(fileHash.toStdString() + pit->peerId) ;
|
||||
used_hashes.insert(fileHash.toStdString() + pit->peerId.toStdString()) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1402,7 +1402,7 @@ void TransfersDialog::insertTransfers()
|
|||
ui.uploadsList->setSortingEnabled(true);
|
||||
}
|
||||
|
||||
QString TransfersDialog::getPeerName(const std::string& id) const
|
||||
QString TransfersDialog::getPeerName(const RsPeerId& id) const
|
||||
{
|
||||
QString res = QString::fromUtf8(rsPeers->getPeerName(id).c_str()) ;
|
||||
|
||||
|
@ -1410,7 +1410,7 @@ QString TransfersDialog::getPeerName(const std::string& id) const
|
|||
// connect mgr). In such a case their id can suitably hold for a name.
|
||||
//
|
||||
if(res == "")
|
||||
return QString::fromStdString(id) ;
|
||||
return QString::fromStdString(id.toStdString()) ;
|
||||
else
|
||||
return res ;
|
||||
}
|
||||
|
@ -1425,8 +1425,8 @@ void TransfersDialog::cancel()
|
|||
{
|
||||
bool first = true;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
if (first) {
|
||||
|
@ -1472,8 +1472,8 @@ void TransfersDialog::copyLink ()
|
|||
{
|
||||
QList<RetroShareLink> links ;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
|
@ -1483,7 +1483,7 @@ void TransfersDialog::copyLink ()
|
|||
}
|
||||
|
||||
RetroShareLink link;
|
||||
if (link.createFile(QString::fromUtf8(info.fname.c_str()), info.size, QString::fromStdString(info.hash))) {
|
||||
if (link.createFile(QString::fromUtf8(info.fname.c_str()), info.size, QString::fromStdString(info.hash.toStdString()))) {
|
||||
links.push_back(link) ;
|
||||
}
|
||||
}
|
||||
|
@ -1495,8 +1495,8 @@ void TransfersDialog::ulCopyLink ()
|
|||
{
|
||||
QList<RetroShareLink> links ;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getULSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
|
@ -1506,7 +1506,7 @@ void TransfersDialog::ulCopyLink ()
|
|||
}
|
||||
|
||||
RetroShareLink link;
|
||||
if (link.createFile(QString::fromUtf8(info.fname.c_str()), info.size, QString::fromStdString(info.hash))) {
|
||||
if (link.createFile(QString::fromUtf8(info.fname.c_str()), info.size, QString::fromStdString(info.hash.toStdString()))) {
|
||||
links.push_back(link) ;
|
||||
}
|
||||
}
|
||||
|
@ -1530,7 +1530,7 @@ void TransfersDialog::showDetailsDialog()
|
|||
|
||||
void TransfersDialog::updateDetailsDialog()
|
||||
{
|
||||
std::string file_hash ;
|
||||
RsFileHash file_hash ;
|
||||
std::set<int> rows;
|
||||
std::set<int>::iterator it;
|
||||
getSelectedItems(NULL, &rows);
|
||||
|
@ -1538,7 +1538,7 @@ void TransfersDialog::updateDetailsDialog()
|
|||
if (rows.size()) {
|
||||
int row = *rows.begin();
|
||||
|
||||
file_hash = getID(row, DLListModel).toStdString();
|
||||
file_hash = RsFileHash(getID(row, DLListModel).toStdString());
|
||||
}
|
||||
|
||||
detailsDialog()->setFileHash(file_hash);
|
||||
|
@ -1549,7 +1549,7 @@ void TransfersDialog::pasteLink()
|
|||
RSLinkClipboard::process(RetroShareLink::TYPE_FILE);
|
||||
}
|
||||
|
||||
void TransfersDialog::getSelectedItems(std::set<std::string> *ids, std::set<int> *rows)
|
||||
void TransfersDialog::getSelectedItems(std::set<RsFileHash> *ids, std::set<int> *rows)
|
||||
{
|
||||
if (ids == NULL && rows == NULL) {
|
||||
return;
|
||||
|
@ -1584,8 +1584,8 @@ void TransfersDialog::getSelectedItems(std::set<std::string> *ids, std::set<int>
|
|||
if (isParentSelected || isChildSelected) {
|
||||
if (ids) {
|
||||
QStandardItem *id = DLListModel->item(i, COLUMN_ID);
|
||||
ids->insert(id->data(Qt::DisplayRole).toString().toStdString());
|
||||
ids->insert(id->data(Qt::UserRole ).toString().toStdString());
|
||||
ids->insert(RsFileHash(id->data(Qt::DisplayRole).toString().toStdString()));
|
||||
ids->insert(RsFileHash(id->data(Qt::UserRole ).toString().toStdString()));
|
||||
}
|
||||
if (rows) {
|
||||
rows->insert(i);
|
||||
|
@ -1594,7 +1594,7 @@ void TransfersDialog::getSelectedItems(std::set<std::string> *ids, std::set<int>
|
|||
}
|
||||
}
|
||||
|
||||
void TransfersDialog::getULSelectedItems(std::set<std::string> *ids, std::set<int> *rows)
|
||||
void TransfersDialog::getULSelectedItems(std::set<RsFileHash> *ids, std::set<int> *rows)
|
||||
{
|
||||
if (ids == NULL && rows == NULL) {
|
||||
return;
|
||||
|
@ -1609,7 +1609,7 @@ void TransfersDialog::getULSelectedItems(std::set<std::string> *ids, std::set<in
|
|||
foreach(index, indexes) {
|
||||
if (ids) {
|
||||
QStandardItem *id = ULListModel->item(index.row(), COLUMN_UHASH);
|
||||
ids->insert(id->data(Qt::DisplayRole).toString().toStdString());
|
||||
ids->insert(RsFileHash(id->data(Qt::DisplayRole).toString().toStdString()));
|
||||
}
|
||||
if (rows) {
|
||||
rows->insert(index.row());
|
||||
|
@ -1623,8 +1623,8 @@ bool TransfersDialog::controlTransferFile(uint32_t flags)
|
|||
{
|
||||
bool result = true;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
result &= rsFiles->FileControl(*it, flags);
|
||||
|
@ -1653,8 +1653,8 @@ void TransfersDialog::openFolderTransfer()
|
|||
{
|
||||
FileInfo info;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
|
||||
|
@ -1683,8 +1683,8 @@ void TransfersDialog::ulOpenFolder()
|
|||
{
|
||||
FileInfo info;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getULSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info)) continue;
|
||||
|
@ -1710,8 +1710,8 @@ void TransfersDialog::previewTransfer()
|
|||
{
|
||||
FileInfo info;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
|
||||
|
@ -1726,7 +1726,7 @@ void TransfersDialog::previewTransfer()
|
|||
if (info.downloadStatus == FT_STATE_COMPLETE) {
|
||||
fileInfo = QFileInfo(QString::fromUtf8(info.path.c_str()), QString::fromUtf8(info.fname.c_str()));
|
||||
} else {
|
||||
fileInfo = QFileInfo(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()), QString::fromUtf8(info.hash.c_str()));
|
||||
fileInfo = QFileInfo(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()), QString::fromUtf8(info.hash.toStdString().c_str()));
|
||||
|
||||
QString linkName = QFileInfo(QDir::temp(), QString::fromUtf8(info.fname.c_str())).absoluteFilePath();
|
||||
if (QFile::link(fileInfo.absoluteFilePath(), linkName)) {
|
||||
|
@ -1760,8 +1760,8 @@ void TransfersDialog::openTransfer()
|
|||
{
|
||||
FileInfo info;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
|
||||
|
@ -1819,8 +1819,8 @@ void TransfersDialog::chunkProgressive()
|
|||
}
|
||||
void TransfersDialog::setChunkStrategy(FileChunksInfo::ChunkStrategy s)
|
||||
{
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
|
@ -1860,8 +1860,8 @@ void TransfersDialog::priorityQueueBottom()
|
|||
|
||||
void TransfersDialog::changeSpeed(int speed)
|
||||
{
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++)
|
||||
|
@ -1890,7 +1890,7 @@ static bool checkFileName(const QString& name)
|
|||
|
||||
void TransfersDialog::renameFile()
|
||||
{
|
||||
std::set<std::string> items;
|
||||
std::set<RsFileHash> items;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
if(items.size() != 1)
|
||||
|
@ -1899,7 +1899,7 @@ void TransfersDialog::renameFile()
|
|||
return ;
|
||||
}
|
||||
|
||||
std::string hash = *(items.begin()) ;
|
||||
RsFileHash hash = *(items.begin()) ;
|
||||
|
||||
FileInfo info ;
|
||||
if (!rsFiles->FileDetails(hash, RS_FILE_HINTS_DOWNLOAD, info))
|
||||
|
@ -1925,8 +1925,8 @@ void TransfersDialog::renameFile()
|
|||
void TransfersDialog::changeQueuePosition(QueueMove mv)
|
||||
{
|
||||
// std::cerr << "In changeQueuePosition (gui)"<< std::endl ;
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++)
|
||||
|
@ -1943,7 +1943,7 @@ void TransfersDialog::clearcompleted()
|
|||
|
||||
void TransfersDialog::showFileDetails()
|
||||
{
|
||||
std::string file_hash ;
|
||||
RsFileHash file_hash ;
|
||||
int nb_select = 0 ;
|
||||
|
||||
for(int i = 0; i <= DLListModel->rowCount(); i++)
|
||||
|
@ -1953,7 +1953,7 @@ void TransfersDialog::showFileDetails()
|
|||
++nb_select ;
|
||||
}
|
||||
if(nb_select != 1)
|
||||
detailsDialog()->setFileHash("") ;
|
||||
detailsDialog()->setFileHash(RsFileHash()) ;
|
||||
else
|
||||
detailsDialog()->setFileHash(file_hash) ;
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ signals:
|
|||
void playFiles(QStringList files);
|
||||
|
||||
private:
|
||||
QString getPeerName(const std::string& peer_id) const ;
|
||||
QString getPeerName(const RsPeerId &peer_id) const ;
|
||||
|
||||
QStandardItemModel *DLListModel;
|
||||
QStandardItemModel *ULListModel;
|
||||
|
@ -218,8 +218,8 @@ private:
|
|||
bool m_bProcessSettings;
|
||||
void processSettings(bool bLoad);
|
||||
|
||||
void getSelectedItems(std::set<std::string> *ids, std::set<int> *rows);
|
||||
void getULSelectedItems(std::set<std::string> *ids, std::set<int> *rows);
|
||||
void getSelectedItems(std::set<RsFileHash> *ids, std::set<int> *rows);
|
||||
void getULSelectedItems(std::set<RsFileHash> *ids, std::set<int> *rows);
|
||||
bool controlTransferFile(uint32_t flags);
|
||||
void changePriority(int priority);
|
||||
void setChunkStrategy(FileChunksInfo::ChunkStrategy s) ;
|
||||
|
|
|
@ -83,11 +83,11 @@ void TurtleRouterDialog::updateDisplay()
|
|||
|
||||
}
|
||||
|
||||
QString TurtleRouterDialog::getPeerName(const std::string& peer_id)
|
||||
QString TurtleRouterDialog::getPeerName(const RsPeerId& peer_id)
|
||||
{
|
||||
static std::map<std::string, QString> names ;
|
||||
static std::map<RsPeerId, QString> names ;
|
||||
|
||||
std::map<std::string,QString>::const_iterator it = names.find(peer_id) ;
|
||||
std::map<RsPeerId,QString>::const_iterator it = names.find(peer_id) ;
|
||||
|
||||
if( it != names.end())
|
||||
return it->second ;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <retroshare/rsturtle.h>
|
||||
#include <retroshare/rstypes.h>
|
||||
#include "ui_TurtleRouterDialog.h"
|
||||
#include "RsAutoUpdatePage.h"
|
||||
|
||||
|
@ -14,7 +15,7 @@ class TurtleRouterDialog: public RsAutoUpdatePage, public Ui::TurtleRouterDialog
|
|||
~TurtleRouterDialog();
|
||||
|
||||
// Cache for peer names.
|
||||
static QString getPeerName(const std::string& peer_id) ;
|
||||
static QString getPeerName(const RsPeerId &peer_id) ;
|
||||
|
||||
private:
|
||||
void updateTunnelRequests( const std::vector<std::vector<std::basic_string<char> > >&,
|
||||
|
|
|
@ -63,9 +63,9 @@ class TRHistogram
|
|||
return ;
|
||||
|
||||
ox += 10 ;
|
||||
std::map<std::string,std::vector<int> > hits ;
|
||||
std::map<std::string,std::vector<int> > depths ;
|
||||
std::map<std::string,std::vector<int> >::iterator it ;
|
||||
std::map<RsPeerId,std::vector<int> > hits ;
|
||||
std::map<RsPeerId,std::vector<int> > depths ;
|
||||
std::map<RsPeerId,std::vector<int> >::iterator it ;
|
||||
|
||||
int max_hits = 1;
|
||||
int max_depth = 1;
|
||||
|
@ -241,11 +241,11 @@ void TurtleRouterStatistics::updateDisplay()
|
|||
_tst_CW->update();
|
||||
}
|
||||
|
||||
QString TurtleRouterStatistics::getPeerName(const std::string& peer_id)
|
||||
QString TurtleRouterStatistics::getPeerName(const RsPeerId &peer_id)
|
||||
{
|
||||
static std::map<std::string, QString> names ;
|
||||
static std::map<RsPeerId, QString> names ;
|
||||
|
||||
std::map<std::string,QString>::const_iterator it = names.find(peer_id) ;
|
||||
std::map<RsPeerId,QString>::const_iterator it = names.find(peer_id) ;
|
||||
|
||||
if( it != names.end())
|
||||
return it->second ;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include <QPoint>
|
||||
#include <retroshare/rsturtle.h>
|
||||
#include <retroshare/rstypes.h>
|
||||
#include "ui_TurtleRouterStatistics.h"
|
||||
#include "RsAutoUpdatePage.h"
|
||||
|
||||
|
@ -37,7 +38,7 @@ class TurtleRouterStatistics: public RsAutoUpdatePage, public Ui::TurtleRouterSt
|
|||
~TurtleRouterStatistics();
|
||||
|
||||
// Cache for peer names.
|
||||
static QString getPeerName(const std::string& peer_id) ;
|
||||
static QString getPeerName(const RsPeerId& peer_id) ;
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue