diff options
| author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-01-14 15:30:26 +0800 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-14 15:30:26 +0800 | 
| commit | f1e278c30f00ecf27d769a5b9a53dcf250c1a09f (patch) | |
| tree | ea187b4b5da31b1dc70c63952bc67d26e475863a | |
| parent | 980973d83ece14861f56b88a9acc407029a30a36 (diff) | |
| parent | a2952ac213359a544f6e79dfb1f655e9a49350a0 (diff) | |
Merge pull request #5343 from lioncash/qt6
configure_motion_touch: Migrate off QRegExp to QRegularExpression
| -rw-r--r-- | src/yuzu/configuration/configure_motion_touch.cpp | 15 | 
1 files changed, 9 insertions, 6 deletions
| diff --git a/src/yuzu/configuration/configure_motion_touch.cpp b/src/yuzu/configuration/configure_motion_touch.cpp index 68110c195..1c477f868 100644 --- a/src/yuzu/configuration/configure_motion_touch.cpp +++ b/src/yuzu/configuration/configure_motion_touch.cpp @@ -4,12 +4,15 @@  #include <array>  #include <sstream> +  #include <QCloseEvent>  #include <QLabel>  #include <QMessageBox>  #include <QPushButton> +#include <QRegularExpression>  #include <QStringListModel>  #include <QVBoxLayout> +  #include "common/logging/log.h"  #include "core/settings.h"  #include "input_common/main.h" @@ -186,14 +189,14 @@ void ConfigureMotionTouch::ConnectEvents() {  void ConfigureMotionTouch::OnUDPAddServer() {      // Validator for IP address -    QRegExp re(QStringLiteral( +    const QRegularExpression re(QStringLiteral(          R"re(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$)re"));      bool ok; -    QString port_text = ui->udp_port->text(); -    QString server_text = ui->udp_server->text(); +    const QString port_text = ui->udp_port->text(); +    const QString server_text = ui->udp_server->text();      const QString server_string = tr("%1:%2").arg(server_text, port_text); -    int port_number = port_text.toInt(&ok, 10); -    int row = udp_server_list_model->rowCount(); +    const int port_number = port_text.toInt(&ok, 10); +    const int row = udp_server_list_model->rowCount();      if (!ok) {          QMessageBox::warning(this, tr("yuzu"), tr("Port number has invalid characters")); @@ -203,7 +206,7 @@ void ConfigureMotionTouch::OnUDPAddServer() {          QMessageBox::warning(this, tr("yuzu"), tr("Port has to be in range 0 and 65353"));          return;      } -    if (!re.exactMatch(server_text)) { +    if (!re.match(server_text).hasMatch()) {          QMessageBox::warning(this, tr("yuzu"), tr("IP address is not valid"));          return;      } | 
