Commit 250d797f authored by Volker Krause's avatar Volker Krause
Browse files

Port from RegExpValidator to RegularExpressionValidator

RegExpValidator is deprecated and gone in Qt6.
parent d3094d32
Pipeline #215321 passed with stage
in 4 minutes and 15 seconds
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
import QtQuick 2.2
import QtQuick 2.15
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
......@@ -14,8 +14,8 @@ PlasmaComponents3.TextField {
echoMode: TextInput.Password
revealPasswordButtonShown: true
placeholderText: i18n("Password…")
validator: RegExpValidator {
regExp: (securityType === PlasmaNM.Enums.StaticWep)
validator: RegularExpressionValidator {
regularExpression: (securityType === PlasmaNM.Enums.StaticWep)
? /^(?:.{5}|[0-9a-fA-F]{10}|.{13}|[0-9a-fA-F]{26})$/
: /^(?:.{8,64})$/
}
......
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
import QtQuick 2.5
import QtQuick 2.15
import QtQuick.Dialogs 1.2
import QtQuick.Controls 2.5 as QQC2
import org.kde.kirigami 2.5 as Kirigami
......@@ -71,8 +71,8 @@ Dialog {
QQC2.TextField {
id: hotspotPassword
Kirigami.FormData.label: i18n("Hotspot password:")
validator: RegExpValidator {
regExp: if (useApMode) {
validator: RegularExpressionValidator {
regularExpression: if (useApMode) {
/^$|^(?:.{8,64}){1}$/
} else {
/^$|^(?:.{5}|[0-9a-fA-F]{10}|.{13}|[0-9a-fA-F]{26}){1}$/
......
......@@ -3,7 +3,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.6
import QtQuick 2.15
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.2 as Controls
import org.kde.kirigami 2.3 as Kirigami
......@@ -148,8 +148,8 @@ SimpleKCM {
placeholderText: "192.168.1.128"
text: ipSettings["address"] ? ipSettings["address"] : ""
onTextChanged: ipSettings["address"] = text
validator: RegExpValidator {
regExp: ipRegex
validator: RegularExpressionValidator {
regularExpression: ipRegex
}
}
......@@ -160,8 +160,8 @@ SimpleKCM {
placeholderText: "192.168.1.1"
text: ipSettings["gateway"] ? ipSettings["gateway"] : ""
onTextChanged: ipSettings["gateway"] = text
validator: RegExpValidator {
regExp: ipRegex
validator: RegularExpressionValidator {
regularExpression: ipRegex
}
}
......@@ -185,8 +185,8 @@ SimpleKCM {
placeholderText: "8.8.8.8"
text: ipSettings["dns"] ? ipSettings["dns"] : ""
onTextChanged: ipSettings["dns"] = text
validator: RegExpValidator {
regExp: ipRegex
validator: RegularExpressionValidator {
regularExpression: ipRegex
}
}
}
......
......@@ -4,15 +4,15 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
import QtQuick 2.6
import QtQuick 2.15
import org.kde.kirigami 2.10 as Kirigami
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
Kirigami.PasswordField {
property int securityType
placeholderText: i18n("Password…")
validator: RegExpValidator {
regExp: if (securityType == PlasmaNM.Enums.StaticWep) {
validator: RegularExpressionValidator {
regularExpression: if (securityType == PlasmaNM.Enums.StaticWep) {
/^(?:.{5}|[0-9a-fA-F]{10}|.{13}|[0-9a-fA-F]{26}){1}$/
} else {
/^(?:.{8,64}){1}$/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment