Merge pull request #1120 from sehraf/pr_fixForumDownloadAll

Fix 'download all' button for forum.
This commit is contained in:
csoler 2017-12-04 16:31:48 +01:00 committed by GitHub
commit 621ed71eeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1220,6 +1220,11 @@ static void processList(const QStringList &list, const QString &textSingular, co
errorList << &fileExist << &personExist << &personFailed << &personNotFound << &forumUnknown << &forumMsgUnknown << &channelUnknown << &channelMsgUnknown << &postedUnknown << &postedMsgUnknown << &messageReceipientNotAccepted << &messageReceipientUnknown;
// not needed: forumFound, channelFound, messageStarted
// we want to merge all single file links into one collection
// if a collection tree link is found it is processed independen for the other file links
RsCollection col;
bool fileLinkFound = false;
for (linkIt = links.begin(); linkIt != links.end(); ++linkIt) {
const RetroShareLink &link = *linkIt;
@ -1364,12 +1369,9 @@ static void processList(const QStringList &list, const QString &textSingular, co
}
break;
case TYPE_FILE:
{
RsCollection col ;
col.merge_in(link.name(),link.size(),RsFileHash(link.hash().toStdString())) ;
col.downloadFiles();
}
case TYPE_FILE:
col.merge_in(link.name(),link.size(),RsFileHash(link.hash().toStdString())) ;
fileLinkFound = true;
break;
@ -1557,6 +1559,10 @@ static void processList(const QStringList &list, const QString &textSingular, co
}
}
// were single file links found?
if (fileLinkFound)
col.downloadFiles();
int countProcessed = 0;
int countError = 0;