diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index 2a074bc58..e1fb167c0 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -144,11 +144,23 @@ bool ElementsLocation::operator!=(const ElementsLocation &other) const */ QString ElementsLocation::baseName() const { - QRegExp regexp("^.*([^/]+)\\.elmt$"); - if (regexp.exactMatch(m_collection_path)) { - return(regexp.capturedTexts().at(1)); + QRegularExpression regexp("^.*(?[^/]+)\\.elmt$"); + if (!regexp.isValid()) + { + qWarning() <<"this is an error in the code" + << regexp.errorString() + << regexp.patternErrorOffset(); + return QString(); } - return(QString()); + + QRegularExpressionMatch match = regexp.match(m_collection_path); + if (!match.hasMatch()) + { + qDebug()<<"no Match => return" + < return" - <[a-z]+://.*)/.*$"); + if (!re.isValid()) + { + qWarning() + < return" + <