Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 155a6ae9 authored by Nikita Sirgienko's avatar Nikita Sirgienko

[R] Remove outdate addUserDefinition, removeUserDefinition

parent 86c4b235
......@@ -81,25 +81,3 @@ void RHighlighter::highlightBlock(const QString& text)
massFormat(variables,variableFormat(),text);
formatRule(QRegExp(QLatin1String("\"[^\"]+\"")),stringFormat(),text); // WARNING a bit redundant
}
void RHighlighter::addUserDefinition(const QStringList& names, QVector<QRegExp>& vector)
{
for (const QString s : names)
if (!s.contains(QRegExp(QLatin1String("[^A-Za-z0-9_.]"))))
vector.append(QRegExp(QLatin1String("\\b")+s+QLatin1String("\\b")));
emit rulesChanged();
}
void RHighlighter::removeUserDefinition(const QStringList& names, QVector<QRegExp>& vector)
{
for (const QString var : names)
for (int i = 0; i < vector.size(); i++)
if (vector[i].pattern() == QLatin1String("\\b")+var+QLatin1String("\\b"))
{
vector.remove(i);
break;
}
emit rulesChanged();
}
......@@ -40,9 +40,6 @@ class RHighlighter : public Cantor::DefaultHighlighter
inline void formatRule(const QRegExp &p, const QTextCharFormat &fmt, const QString& text,bool shift=false);
inline void massFormat(const QVector<QRegExp>& rules, const QTextCharFormat &fmt, const QString& text,bool shift=false);
void addUserDefinition(const QStringList& names, QVector<QRegExp>& vector);
void removeUserDefinition(const QStringList& names, QVector<QRegExp>& vector);
static const QStringList operators_list;
static const QStringList specials_list;
QVector<QRegExp> operators;
......
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