Commit 149b594c authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Fixed leak in AttendeeStatusModel constructor

parent edfcf7a5
Pipeline #89149 passed with stage
in 5 minutes and 36 seconds
......@@ -24,7 +24,6 @@
AttendeeStatusModel::AttendeeStatusModel(QObject *parent)
: QAbstractListModel(parent)
{
QRegularExpression roleExp(QStringLiteral("Role$"));
QRegularExpression lowerToCapitalSep(QStringLiteral("([a-z])([A-Z])"));
QRegularExpression capitalToCapitalSep(QStringLiteral("([A-Z])([A-Z])"));
......@@ -34,8 +33,8 @@ AttendeeStatusModel::AttendeeStatusModel(QObject *parent)
// QLatin1String is a workaround for QT_NO_CAST_FROM_ASCII.
// Regular expression adds space between every lowercase and Capitalised character then does the same
// for capitalised letters together, e.g. ThisIsATest. Not a problem right now, but best to be safe.
QString enumName = QLatin1String(QMetaEnum::fromType<KCalendarCore::Attendee::PartStat>().key(i));
QString displayName = enumName.replace(roleExp, QString());
QLatin1String enumName = QLatin1String(QMetaEnum::fromType<KCalendarCore::Attendee::PartStat>().key(i));
QString displayName = enumName;
displayName.replace(lowerToCapitalSep, QStringLiteral("\\1 \\2"));
displayName.replace(capitalToCapitalSep, QStringLiteral("\\1 \\2"));
displayName.replace(lowerToCapitalSep, QStringLiteral("\\1 \\2"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment