mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
Replace QRegExp with QRegularExpression
Revise `static` keyword usage, static is added to frequently used instances.
This commit is contained in:
parent
c22e6b4502
commit
09f759355f
14 changed files with 72 additions and 63 deletions
|
@ -36,6 +36,7 @@
|
|||
#include <QDragMoveEvent>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QRegularExpression>
|
||||
#include <QStandardItemModel>
|
||||
#include <QString>
|
||||
|
||||
|
@ -461,10 +462,10 @@ void RSSWidget::handleCurrentArticleItemChanged(QListWidgetItem *currentItem, QL
|
|||
}
|
||||
else {
|
||||
QString description = article->description();
|
||||
QRegExp rx;
|
||||
QRegularExpression rx;
|
||||
// If description is plain text, replace BBCode tags with HTML and wrap everything in <pre></pre> so it looks nice
|
||||
rx.setMinimal(true);
|
||||
rx.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
rx.setPatternOptions(QRegularExpression::InvertedGreedinessOption
|
||||
| QRegularExpression::CaseInsensitiveOption);
|
||||
|
||||
rx.setPattern("\\[img\\](.+)\\[/img\\]");
|
||||
description = description.replace(rx, "<img src=\"\\1\">");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue