mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-18 12:24:22 -05:00
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:
parent
88a32c67fc
commit
fb01f61bb2
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user