This commit is contained in:
ArsenArsen 2017-07-05 12:41:09 +02:00
parent 37be9946d6
commit 7d45d794a6

View File

@ -29,12 +29,12 @@ WId PlatformBackend::getActiveWID() {
return (WId)GetForegroundWindow(); return (WId)GetForegroundWindow();
} }
QString illegal(QStringLiteral("<>:\"/\|?*")); QString illegal(QStringLiteral("<>:\"/\\|?*"));
QStringList illegalNames({ "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", QStringList illegalNames({ "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7",
"COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" }); "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" });
bool PlatformBackend::filenamValid(QString name) { bool PlatformBackend::filenameValid(QString name) {
unsigned int periods = 0; int periods = 0;
for (QChar c : name) { for (QChar c : name) {
if (c == '.') periods++; if (c == '.') periods++;
if (illegal.contains(c)) return false; if (illegal.contains(c)) return false;