Bugfix: Escape the username RegExp used for filtering Ports window

This commit is contained in:
Srivats P. 2015-05-06 21:47:46 +05:30
parent efbc2dcf48
commit ab76da1ad2

View File

@ -163,9 +163,10 @@ void PortsWindow::showMyReservedPortsOnly(bool enabled)
return;
if (enabled) {
QString rx = "Port Group|\\[xxx\\]";
rx.replace("xxx",
appSettings->value(kUserKey, kUserDefaultValue).toString());
QString rx = "Port Group|\\["
+ QRegExp::escape(appSettings->value(kUserKey,
kUserDefaultValue).toString())
+ "\\]";
qDebug("%s: regexp: <%s>", __FUNCTION__, qPrintable(rx));
proxyPortModel->setFilterRegExp(QRegExp(rx));
}