fixed handling of incoming rscollection files

This commit is contained in:
csoler 2024-02-16 13:28:55 +01:00
parent 142a8e2503
commit eccfc7ba71
5 changed files with 48 additions and 21 deletions

View file

@ -385,7 +385,7 @@ bool RsCollection::checkFile(const QString& fileName, bool showError)
//std::cerr << "n==" << n <<" Checking string " << std::string(current,n+1) << " c = " << std::hex << (int)c << std::dec << std::endl;
for(uint i=0;i<bad_strings.size();++i)
for(uint i=0;i<bad_strings.size();++i)
if(std::string(current,bad_strings[i].length()) == bad_strings[i])
{
showErrorBox(file.fileName(), QApplication::translate("RsCollectionFile", "This file contains the string \"%1\" and is therefore an invalid collection file. \n\nIf you believe it is correct, remove the corresponding line from the file and re-open it with Retroshare.").arg(bad_strings[i].c_str()));
@ -394,7 +394,7 @@ bool RsCollection::checkFile(const QString& fileName, bool showError)
//std::cerr << "Bad string detected" << std::endl;
}
if(file.atEnd())
if(file.atEnd())
n-- ;
else if(n < max_size)
++n ;