Using Regex to remove invalid Filename Charecters

This commit is contained in:
Itay Grudev 2015-02-26 19:09:45 +00:00
parent aa95fdb742
commit e16742fe4e

View File

@ -13,7 +13,7 @@ SingleApplication::SingleApplication(int argc, char *argv[])
{ {
QString serverName = QApplication::organizationName() + QString serverName = QApplication::organizationName() +
QApplication::applicationName(); QApplication::applicationName();
serverName.replace(QRegExp("\\s"), ""); serverName.replace(QRegExp("[^\\w\\-. ]"), "");
// Attempt to connect to the LocalServer // Attempt to connect to the LocalServer
socket = new QLocalSocket(); socket = new QLocalSocket();