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
Tobias Hunger
qt-creator
Commits
5b01ea11
Commit
5b01ea11
authored
Apr 17, 2009
by
Oswald Buddenhagen
Browse files
beautify regexes
parent
c38cb83d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/utils/filenamevalidatinglineedit.cpp
View file @
5b01ea11
...
...
@@ -36,12 +36,14 @@
namespace
Core
{
namespace
Utils
{
#define WINDOWS_DEVICES "CON|AUX|PRN|COM1|COM2|LPT1|LPT2|NUL"
// Naming a file like a device name will break on Windows, even if it is
// "com1.txt". Since we are cross-platform, we generally disallow such file
// names.
static
const
QRegExp
&
windowsDeviceNoSubDirPattern
()
{
static
const
QRegExp
rc
(
QLatin1String
(
"CON|AUX|PRN|COM1|COM2|LPT1|LPT2|NUL"
),
static
const
QRegExp
rc
(
QLatin1String
(
WINDOWS_DEVICES
),
Qt
::
CaseInsensitive
);
QTC_ASSERT
(
rc
.
isValid
(),
return
rc
);
return
rc
;
...
...
@@ -49,8 +51,7 @@ static const QRegExp &windowsDeviceNoSubDirPattern()
static
const
QRegExp
&
windowsDeviceSubDirPattern
()
{
static
const
QRegExp
rc
(
QLatin1String
(
".*[/
\\\\
]CON|.*[/
\\\\
]AUX|.*[/
\\\\
]PRN|.*[/
\\\\
]COM1|.*[/
\\\\
]COM2|.*[/
\\\\
]LPT1|.*[/
\\\\
]LPT2|.*[/
\\\\
]NUL"
),
Qt
::
CaseInsensitive
);
static
const
QRegExp
rc
(
QLatin1String
(
".*[/
\\\\
]("
WINDOWS_DEVICES
")"
),
Qt
::
CaseInsensitive
);
QTC_ASSERT
(
rc
.
isValid
(),
return
rc
);
return
rc
;
}
...
...
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