fix 'download all' button for forum.

Now all file links are opened in one collection dialog instead of each link in one separate dialog.
This commit is contained in:
sehraf 2017-12-02 15:00:24 +01:00
parent b99a1a56ef
commit 49b4057522

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;
@ -1365,11 +1370,8 @@ 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();
}
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;