Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nate Graham
Kid3
Commits
ebc37ece
Commit
ebc37ece
authored
May 08, 2012
by
Urs Fleisch
Browse files
Strip drive part when checking for illegal file name characters on Windows.
parent
91bd260a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/core/utils/saferename.cpp
View file @
ebc37ece
...
...
@@ -32,8 +32,11 @@
bool
Utils
::
hasIllegalFileNameCharacters
(
const
QString
&
fileName
)
{
static
const
char
illegalChars
[]
=
"<>:
\"
|?*"
;
QString
fileNameWithoutDrive
(
(
QDir
::
isAbsolutePath
(
fileName
)
&&
fileName
.
mid
(
1
,
2
)
==
":/"
)
?
fileName
.
mid
(
3
)
:
fileName
);
for
(
const
char
*
chPtr
=
illegalChars
;
*
chPtr
;
++
chPtr
)
{
if
(
fileName
.
contains
(
*
chPtr
))
{
if
(
fileName
WithoutDrive
.
contains
(
*
chPtr
))
{
return
true
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment