diff options
| author | 2023-10-04 11:25:05 +0200 | |
|---|---|---|
| committer | 2023-10-18 10:26:35 +0200 | |
| commit | 29e92a939647612842b2f583ce0a43dd572b1345 (patch) | |
| tree | be091f42ad1c2ff70d670bd8bba597b9bbf8aae1 /src/modules/objects | |
| parent | Qt6 is stricter when casting numericals and chars. Add an explicit cast/conve... (diff) | |
| download | KVIrc-29e92a939647612842b2f583ce0a43dd572b1345.tar.gz KVIrc-29e92a939647612842b2f583ce0a43dd572b1345.tar.bz2 KVIrc-29e92a939647612842b2f583ce0a43dd572b1345.zip | |
Port from QRegExp (unavailable on qt6) to KviRegExp, based on QRegularExpression
Method str_kvs_fnc_split() had to be replaced with the original version, since the newer one relied on Qt5's QStringRef
Diffstat (limited to 'src/modules/objects')
| -rw-r--r-- | src/modules/objects/KvsObject_lineEdit.cpp | 5 | ||||
| -rw-r--r-- | src/modules/objects/qtftp/qftp.cpp | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/modules/objects/KvsObject_lineEdit.cpp b/src/modules/objects/KvsObject_lineEdit.cpp index daeea0142..bff8efc91 100644 --- a/src/modules/objects/KvsObject_lineEdit.cpp +++ b/src/modules/objects/KvsObject_lineEdit.cpp @@ -24,10 +24,11 @@ //============================================================================= #include "KviError.h" +#include "KviRegExp.h" #include "kvi_debug.h" #include "KviLocale.h" #include "KvsObject_lineEdit.h" -#include <QRegExpValidator> +#include <QRegularExpressionValidator> #include <QLineEdit> #include <QCompleter> static const char * mode_tbl[] = { @@ -270,7 +271,7 @@ KVSO_CLASS_FUNCTION(lineEdit, setInputValidator) KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("reg_expression", KVS_PT_STRING, 0, szReg) KVSO_PARAMETERS_END(c) - ((QLineEdit *)widget())->setValidator(new QRegExpValidator(QRegExp(szReg), ((QLineEdit *)widget()))); + ((QLineEdit *)widget())->setValidator(new QRegularExpressionValidator(KviRegExp(szReg), ((QLineEdit *)widget()))); return true; } KVSO_CLASS_FUNCTION(lineEdit, maxLength) diff --git a/src/modules/objects/qtftp/qftp.cpp b/src/modules/objects/qtftp/qftp.cpp index 8fa31ef04..483e00be1 100644 --- a/src/modules/objects/qtftp/qftp.cpp +++ b/src/modules/objects/qtftp/qftp.cpp @@ -53,13 +53,14 @@ #include "qtcpsocket.h" #include "qurlinfo.h" #include "qstringlist.h" -#include "qregexp.h" #include "qtimer.h" #include "qfileinfo.h" #include "qhash.h" #include "qtcpserver.h" #include "qlocale.h" +#include "KviRegExp.h" + QT_BEGIN_NAMESPACE /********************************************************************** @@ -488,7 +489,7 @@ bool QFtpDTP::parseDir(const QByteArray & buffer, const QString & userName, QUrl QString bufferStr = QString::fromLatin1(buffer).trimmed(); // Unix style FTP servers - QRegExp unixPattern(QLatin1String("^([\\-dl])([a-zA-Z\\-]{9,9})\\s+\\d+\\s+(\\S*)\\s+" + KviRegExp unixPattern(QLatin1String("^([\\-dl])([a-zA-Z\\-]{9,9})\\s+\\d+\\s+(\\S*)\\s+" "(\\S*)\\s+(\\d+)\\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(\\S.*)")); if(unixPattern.indexIn(bufferStr) == 0) { @@ -497,7 +498,7 @@ bool QFtpDTP::parseDir(const QByteArray & buffer, const QString & userName, QUrl } // DOS style FTP servers - QRegExp dosPattern(QLatin1String("^(\\d\\d-\\d\\d-\\d\\d\\d?\\d?\\ \\ \\d\\d:\\d\\d[AP]M)\\s+" + KviRegExp dosPattern(QLatin1String("^(\\d\\d-\\d\\d-\\d\\d\\d?\\d?\\ \\ \\d\\d:\\d\\d[AP]M)\\s+" "(<DIR>|\\d+)\\s+(\\S.*)$")); if(dosPattern.indexIn(bufferStr) == 0) { @@ -964,7 +965,7 @@ bool QFtpPI::processReply() // both examples where the parenthesis are used, and where // they are missing. We need to scan for the address and host // info. - QRegExp addrPortPattern(QLatin1String(R"((\d+),(\d+),(\d+),(\d+),(\d+),(\d+))")); + KviRegExp addrPortPattern(QLatin1String(R"((\d+),(\d+),(\d+),(\d+),(\d+),(\d+))")); if(addrPortPattern.indexIn(replyText) == -1) { #if defined(QFTPPI_DEBUG) |
