mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 08:05:18 -04:00
extended character filtering to fit a common denominator for all filesystems
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5979 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
892057b53e
commit
bb7645549f
3 changed files with 16 additions and 13 deletions
|
@ -59,15 +59,17 @@ void RsCollectionFile::downloadFiles() const
|
|||
|
||||
static QString purifyFileName(const QString& input,bool& bad)
|
||||
{
|
||||
static const QString bad_chars = "/\\\"*:?<>|" ;
|
||||
bad = false ;
|
||||
QString output = input ;
|
||||
|
||||
for(uint32_t i=0;i<output.length();++i)
|
||||
if(output[i] == '/' || output[i] == '\\')
|
||||
{
|
||||
output[i] = '_' ;
|
||||
bad = true ;
|
||||
}
|
||||
for(int j=0;j<bad_chars.length();++j)
|
||||
if(output[i] == bad_chars[j])
|
||||
{
|
||||
output[i] = '_' ;
|
||||
bad = true ;
|
||||
}
|
||||
|
||||
return output ;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue