aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2019-07-22 16:42:32 +0200
committerRoland Knall <rknall@gmail.com>2019-07-22 15:58:04 +0000
commit8892da8a472c96960723b7cdfda8f1f25d6ffeef (patch)
tree9fa5b5e1a8abe1642646731ce4b74806c725da3c
parent8198413514b1edc39556e9ee24491ca9e4e7aa77 (diff)
Qt: Fix invalid characters for profiles
Change-Id: Ic44f075b2723e2d5d95e29b485791e89134315e8 Reviewed-on: https://code.wireshark.org/review/34056 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
-rw-r--r--ui/qt/models/profile_model.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/qt/models/profile_model.cpp b/ui/qt/models/profile_model.cpp
index 49aef53122..31c1ad7552 100644
--- a/ui/qt/models/profile_model.cpp
+++ b/ui/qt/models/profile_model.cpp
@@ -776,6 +776,7 @@ bool ProfileModel::checkNameValidity(QString name, QString *msg)
{
QString message;
bool invalid = false;
+ QString msgChars;
#ifdef _WIN32
/* According to https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file */
@@ -786,11 +787,12 @@ bool ProfileModel::checkNameValidity(QString name, QString *msg)
for ( int cnt = 0; cnt < invalid_dir_chars.length() && ! invalid; cnt++ )
{
+ msgChars += invalid_dir_chars[cnt] + " ";
if ( name.contains(invalid_dir_chars[cnt]) )
invalid = true;
}
if ( invalid )
- message = tr("A profile must not contain any of the following characters: %1").arg(invalid_dir_chars);
+ message = tr("A profile must not contain any of the following characters: %1").arg(msgChars);
if ( message.isEmpty() && ( name.startsWith('.') || name.endsWith('.') ) )
message = tr("A profile must not start or end with a period (.)");