Merge pull request #2531 from Trial97/relax_fat
relax fat FS filename restrictions
This commit is contained in:
commit
3f68b68691
@ -815,20 +815,11 @@ QString NormalizePath(QString path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString removeDuplicates(QString a)
|
static const QString BAD_WIN_CHARS = "<>:\"|?*\r\n";
|
||||||
{
|
|
||||||
auto b = a.split("");
|
|
||||||
b.removeDuplicates();
|
|
||||||
return b.join("");
|
|
||||||
}
|
|
||||||
|
|
||||||
static const QString BAD_WIN_CHARS = "\"?<>:*|\r\n";
|
|
||||||
|
|
||||||
static const QString BAD_FAT_CHARS = "<>:\"|?*+.,;=[]!";
|
|
||||||
static const QString BAD_NTFS_CHARS = "<>:\"|?*";
|
static const QString BAD_NTFS_CHARS = "<>:\"|?*";
|
||||||
static const QString BAD_HFS_CHARS = ":";
|
static const QString BAD_HFS_CHARS = ":";
|
||||||
|
|
||||||
static const QString BAD_FILENAME_CHARS = removeDuplicates(BAD_WIN_CHARS + BAD_FAT_CHARS + BAD_NTFS_CHARS + BAD_HFS_CHARS) + "\\/";
|
static const QString BAD_FILENAME_CHARS = BAD_WIN_CHARS + "\\/";
|
||||||
|
|
||||||
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
|
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
|
||||||
{
|
{
|
||||||
@ -847,9 +838,8 @@ QString RemoveInvalidPathChars(QString path, QChar replaceWith)
|
|||||||
|
|
||||||
// the null character is ignored in this check as it was not a problem until now
|
// the null character is ignored in this check as it was not a problem until now
|
||||||
switch (statFS(path).fsType) {
|
switch (statFS(path).fsType) {
|
||||||
case FilesystemType::FAT:
|
case FilesystemType::FAT: // similar to NTFS
|
||||||
invalidChars += BAD_FAT_CHARS;
|
/* fallthrough */
|
||||||
break;
|
|
||||||
case FilesystemType::NTFS:
|
case FilesystemType::NTFS:
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case FilesystemType::REFS: // similar to NTFS(should be available only on windows)
|
case FilesystemType::REFS: // similar to NTFS(should be available only on windows)
|
||||||
|
Loading…
Reference in New Issue
Block a user