Fixed download all button in MessagesDialog.

The button had only downloaded the current selected recommended file. The "download all" function was commented out.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3799 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-11-16 00:05:17 +00:00
parent 145c6775c4
commit 187a64f8bd
2 changed files with 4 additions and 21 deletions

View file

@ -236,7 +236,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
connect(ui.printbutton, SIGNAL(clicked()), this, SLOT(print())); connect(ui.printbutton, SIGNAL(clicked()), this, SLOT(print()));
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview())); connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getcurrentrecommended())); connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
connect( ui.msgText, SIGNAL( anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &))); connect( ui.msgText, SIGNAL( anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
@ -886,7 +886,6 @@ void MessagesDialog::getcurrentrecommended()
} }
} }
#if 0
void MessagesDialog::getallrecommended() void MessagesDialog::getallrecommended()
{ {
/* get Message */ /* get Message */
@ -899,32 +898,16 @@ void MessagesDialog::getallrecommended()
const std::list<FileInfo> &recList = msgInfo.files; const std::list<FileInfo> &recList = msgInfo.files;
std::list<FileInfo>::const_iterator it; std::list<FileInfo>::const_iterator it;
std::list<std::string> fnames; /* do the requests */
std::list<std::string> hashes;
std::list<int> sizes;
for(it = recList.begin(); it != recList.end(); it++) for(it = recList.begin(); it != recList.end(); it++)
{
fnames.push_back(it->fname);
hashes.push_back(it->hash);
sizes.push_back(it->size);
}
/* now do requests */
std::list<std::string>::const_iterator fit;
std::list<std::string>::const_iterator hit;
std::list<int>::const_iterator sit;
for(fit = fnames.begin(), hit = hashes.begin(), sit = sizes.begin(); fit != fnames.end(); fit++, hit++, sit++)
{ {
std::cerr << "MessagesDialog::getallrecommended() Calling File Request"; std::cerr << "MessagesDialog::getallrecommended() Calling File Request";
std::cerr << std::endl; std::cerr << std::endl;
std::list<std::string> srcIds; std::list<std::string> srcIds;
srcIds.push_back(msgInfo.srcId); srcIds.push_back(msgInfo.srcId);
rsFiles -> FileRequest(*fit, *hit, *sit, "", 0, srcIds); rsFiles->FileRequest(it->fname, it->hash, it->size, "", RS_FILE_HINTS_NETWORK_WIDE, srcIds);
} }
} }
#endif
void MessagesDialog::changeBox(int) void MessagesDialog::changeBox(int)
{ {

View file

@ -90,7 +90,7 @@ private slots:
void anchorClicked (const QUrl &); void anchorClicked (const QUrl &);
void getcurrentrecommended(); void getcurrentrecommended();
// void getallrecommended(); void getallrecommended();
/* handle splitter */ /* handle splitter */
void togglefileview(); void togglefileview();