Helper: check for a filename validity
| 10378 | |
| 10379 | //Helper: check for a filename validity |
| 10380 | static bool IsValidFileName(QString filename) |
| 10381 | { |
| 10382 | #ifdef CC_WINDOWS |
| 10383 | QString sPattern("^(?!^(PRN|AUX|CLOCK\\$|NUL|CON|COM\\d|LPT\\d|\\..*)(\\..+)?$)[^\\x00-\\x1f\\\\?*:\\"";|/]+$"); |
| 10384 | #else |
| 10385 | QString sPattern("^(([a-zA-Z]:|\\\\)\\\\)?(((\\.)|(\\.\\.)|([^\\\\/:\\*\\?""\\|<>\\. ](([^\\\\/:\\*\\?""\\|<>\\. ])|([^\\\\/:\\*\\?""\\|<>]*[^\\\\/:\\*\\?""\\|<>\\. ]))?))\\\\)*[^\\\\/:\\*\\?""\\|<>\\. ](([^\\\\/:\\*\\?""\\|<>\\. ])|([^\\\\/:\\*\\?""\\|<>]*[^\\\\/:\\*\\?""\\|<>\\. ]))?$"); |
| 10386 | #endif |
| 10387 | |
| 10388 | return QRegExp(sPattern).exactMatch(filename); |
| 10389 | } |
| 10390 | |
| 10391 | void MainWindow::doActionSaveFile() |
| 10392 | { |
no outgoing calls
no test coverage detected