added check to avoid adding 3 times the same file request

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@985 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-02-02 20:46:30 +00:00
parent 88a32c67fc
commit fb01f61bb2

View File

@ -724,36 +724,37 @@ void RemoteDirModel::downloadSelected(QModelIndexList list)
/* Fire off requests */
QModelIndexList::iterator it;
for(it = list.begin(); it != list.end(); it++)
{
void *ref = it -> internalPointer();
if(it->column()==1)
{
void *ref = it -> internalPointer();
DirDetails details;
uint32_t flags = DIR_FLAGS_DETAILS;
if (RemoteMode)
{
flags |= DIR_FLAGS_REMOTE;
}
else
{
flags |= DIR_FLAGS_LOCAL;
continue; /* don't try to download local stuff */
}
DirDetails details;
uint32_t flags = DIR_FLAGS_DETAILS;
if (RemoteMode)
{
flags |= DIR_FLAGS_REMOTE;
}
else
{
flags |= DIR_FLAGS_LOCAL;
continue; /* don't try to download local stuff */
}
if (!rsFiles->RequestDirDetails(ref, details, flags))
{
continue;
}
/* only request if it is a file */
if (details.type == DIR_TYPE_FILE)
{
std::cerr << "RemoteDirModel::downloadSelected() Calling File Request";
std::cerr << std::endl;
std::list<std::string> srcIds;
srcIds.push_back(details.id);
rsFiles -> FileRequest(details.name, details.hash,
if (!rsFiles->RequestDirDetails(ref, details, flags))
{
continue;
}
/* only request if it is a file */
if (details.type == DIR_TYPE_FILE)
{
std::cerr << "RemoteDirModel::downloadSelected() Calling File Request";
std::cerr << std::endl;
std::list<std::string> srcIds;
srcIds.push_back(details.id);
rsFiles -> FileRequest(details.name, details.hash,
details.count, "", 0, srcIds);
}
}
}
}
/****************************************************************************