mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
DiagramContextWidget: Fix verification of keys
This commit is contained in:
committed by
Laurent Trinques
parent
a8d42b0f9a
commit
e9a5fded5c
@@ -92,7 +92,7 @@ const QVariant DiagramContext::operator[](const QString &key) const
|
||||
@return true if the insertion succeeds, false otherwise
|
||||
*/
|
||||
bool DiagramContext::addValue(const QString &key, const QVariant &value, bool show) {
|
||||
if (keyIsAcceptable(key)) {
|
||||
if (isKeyAcceptable(key)) {
|
||||
m_content.insert(key, value);
|
||||
m_content_show.insert(key, show);
|
||||
return(true);
|
||||
@@ -240,10 +240,11 @@ bool DiagramContext::stringLongerThan(const QString &a, const QString &b) {
|
||||
@param key a key string
|
||||
@return true if that key is acceptable, false otherwise
|
||||
*/
|
||||
bool DiagramContext::keyIsAcceptable(const QString &key) const
|
||||
bool DiagramContext::isKeyAcceptable(const QString &key)
|
||||
{
|
||||
QRegularExpression re(DiagramContext::validKeyRegExp());
|
||||
QRegularExpressionMatch match =re.match(key);
|
||||
static const QRegularExpression re(DiagramContext::validKeyRegExp());
|
||||
|
||||
QRegularExpressionMatch match = re.match(key);
|
||||
return match.hasMatch();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user