mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-30 20:36:36 -05:00
Replaced deprecated QRegExp by QRegularExpression
This commit is contained in:
parent
f0286740f4
commit
13b294838b
8 changed files with 26 additions and 18 deletions
|
|
@ -103,6 +103,7 @@
|
|||
#include <QXmlStreamReader>
|
||||
#include <QDomDocument>
|
||||
#include <QTextStream>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "ChatStyle.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
|
|
@ -376,7 +377,7 @@ QString ChatStyle::formatMessage(enumFormatMessage type
|
|||
QString strDate = DateTime::formatDate(timestamp.date()).prepend(QString("<a name=\"date\">")).append(QString("</a>"));
|
||||
QString strTime = DateTime::formatTime(timestamp.time()).prepend(QString("<a name=\"time\">")).append(QString("</a>"));
|
||||
|
||||
int bi = name.lastIndexOf(QRegExp(" \\(.*\\)")); //trim location from the end
|
||||
int bi = name.lastIndexOf(QRegularExpression(" \\(.*\\)")); //trim location from the end
|
||||
QString strShortName = RsHtml::plainText(name.left(bi)).prepend(QString("<a name=\"name\">")).append(QString("</a>"));
|
||||
|
||||
//handle /me
|
||||
|
|
@ -384,9 +385,9 @@ QString ChatStyle::formatMessage(enumFormatMessage type
|
|||
//meName class for modifying the style of the name in the palce of /me
|
||||
if(me){
|
||||
messageBody = messageBody.replace(messageBody.indexOf("/me "), 3, strShortName.prepend(QString("<span class=\"meName\">")).append(QString("</span>"))); //replace only the first /me
|
||||
style = style.remove(QRegExp("%nome%.*%/nome%")).remove("%me%").remove("%/me%");
|
||||
style = style.remove(QRegularExpression("%nome%.*%/nome%")).remove("%me%").remove("%/me%");
|
||||
} else {
|
||||
style = style.remove(QRegExp("%me%.*%/me%")).remove("%nome%").remove("%/nome%");
|
||||
style = style.remove(QRegularExpression("%me%.*%/me%")).remove("%nome%").remove("%/nome%");
|
||||
}
|
||||
|
||||
QString formatMsg = style.replace("%name%", strName)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue