mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-18 19:48:23 -05:00
Convert some QRegExp usages to QRegularExpression
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include "sqlitedb.h"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QRegExpValidator>
|
||||
#include <QRegularExpressionValidator>
|
||||
|
||||
#include <QtCore/qmath.h>
|
||||
|
||||
@@ -11,7 +11,7 @@ CipherDialog::CipherDialog(QWidget* parent, bool encrypt) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::CipherDialog),
|
||||
encryptMode(encrypt),
|
||||
rawKeyValidator(new QRegExpValidator(QRegExp("0x[a-fA-F0-9]+")))
|
||||
rawKeyValidator(new QRegularExpressionValidator(QRegularExpression("\\A(0x[a-fA-F0-9]+)\\Z")))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "CipherSettings.h"
|
||||
|
||||
class QRegExpValidator;
|
||||
class QRegularExpressionValidator;
|
||||
|
||||
namespace Ui {
|
||||
class CipherDialog;
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
private:
|
||||
Ui::CipherDialog* ui;
|
||||
bool encryptMode;
|
||||
QRegExpValidator* rawKeyValidator;
|
||||
QRegularExpressionValidator* rawKeyValidator;
|
||||
|
||||
private slots:
|
||||
void checkInputFields();
|
||||
|
||||
@@ -105,7 +105,7 @@ void ColumnDisplayFormatDialog::accept()
|
||||
// Users could still devise a way to break this, but this is considered good enough for letting them know about simple incorrect
|
||||
// cases.
|
||||
if(!(ui->editDisplayFormat->text() == sqlb::escapeIdentifier(column_name) ||
|
||||
ui->editDisplayFormat->text().contains(QRegExp("[a-z]+[a-z_0-9]* *\\(.*" + QRegExp::escape(sqlb::escapeIdentifier(column_name)) + ".*\\)", Qt::CaseInsensitive))))
|
||||
ui->editDisplayFormat->text().contains(QRegularExpression("[a-z]+[a-z_0-9]* *\\(.*" + QRegularExpression::escape(sqlb::escapeIdentifier(column_name)) + ".*\\)", QRegularExpression::CaseInsensitiveOption))))
|
||||
errorMessage = tr("Custom display format must contain a function call applied to %1").arg(sqlb::escapeIdentifier(column_name));
|
||||
else {
|
||||
// Execute a query using the display format and check that it only returns one column.
|
||||
|
||||
Reference in New Issue
Block a user