aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/theme
diff options
context:
space:
mode:
authorGravatar Fabio Bas2023-10-04 11:25:05 +0200
committerGravatar ctrlaltca2023-10-18 10:26:35 +0200
commit29e92a939647612842b2f583ce0a43dd572b1345 (patch)
treebe091f42ad1c2ff70d670bd8bba597b9bbf8aae1 /src/modules/theme
parentQt6 is stricter when casting numericals and chars. Add an explicit cast/conve... (diff)
downloadKVIrc-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/theme')
-rw-r--r--src/modules/theme/PackThemeDialog.cpp5
-rw-r--r--src/modules/theme/SaveThemeDialog.cpp9
-rw-r--r--src/modules/theme/ThemeFunctions.cpp3
-rw-r--r--src/modules/theme/ThemeManagementDialog.cpp1
-rw-r--r--src/modules/theme/WebThemeInterfaceDialog.cpp3
5 files changed, 11 insertions, 10 deletions
diff --git a/src/modules/theme/PackThemeDialog.cpp b/src/modules/theme/PackThemeDialog.cpp
index f7e2b14b0..91bde9429 100644
--- a/src/modules/theme/PackThemeDialog.cpp
+++ b/src/modules/theme/PackThemeDialog.cpp
@@ -37,13 +37,12 @@
#include "kvi_fileextensions.h"
#include "KviSelectors.h"
#include "KviMiscUtils.h"
+#include "KviRegExp.h"
#include "kvi_sourcesdate.h"
#include <QLineEdit>
#include <QLabel>
#include <QTextEdit>
-
-#include <QRegExp>
#include <QMessageBox>
#include <QDir>
#include <QDateTime>
@@ -165,7 +164,7 @@ void PackThemeDataWidget::parseThemes(KviPointerList<KviThemeInfo> * pThemeInfoL
szPackageVersion = pThemeInfo->version();
szPackagePath += pThemeInfo->subdirectory();
- if(szPackagePath.indexOf(QRegExp("[0-9]\\.[0-9]")) == -1)
+ if(szPackagePath.indexOf(KviRegExp("[0-9]\\.[0-9]")) == -1)
{
szPackagePath += "-";
szPackagePath += szPackageVersion;
diff --git a/src/modules/theme/SaveThemeDialog.cpp b/src/modules/theme/SaveThemeDialog.cpp
index d625a9b72..00ac0b17f 100644
--- a/src/modules/theme/SaveThemeDialog.cpp
+++ b/src/modules/theme/SaveThemeDialog.cpp
@@ -37,13 +37,13 @@
#include "KviMessageBox.h"
#include "KviSelectors.h"
#include "KviMiscUtils.h"
+#include "KviRegExp.h"
#include "kvi_sourcesdate.h"
#include <QTextEdit>
#include <QLayout>
#include <QPushButton>
#include <QLineEdit>
-#include <QRegExp>
#include <QMessageBox>
#include <QDir>
#include <QComboBox>
@@ -54,6 +54,7 @@
#include <QBuffer>
#include <QLabel>
#include <QCheckBox>
+#include <QRegularExpressionValidator>
SaveThemeDialog::SaveThemeDialog(QWidget * pParent)
: KviTalWizard(pParent)
@@ -113,8 +114,8 @@ SaveThemeDialog::SaveThemeDialog(QWidget * pParent)
m_pThemeVersionEdit = new QLineEdit(pPage);
m_pThemeVersionEdit->setText(info.version());
- QRegExp rx(R"(\d{1,2}\.\d{1,2}(\.\d{1,2})?)");
- QValidator * validator = new QRegExpValidator(rx, this);
+ KviRegExp rx(R"(\d{1,2}\.\d{1,2}(\.\d{1,2})?)");
+ QValidator * validator = new QRegularExpressionValidator(rx, this);
m_pThemeVersionEdit->setValidator(validator);
pLayout->addWidget(m_pThemeVersionEdit, 2, 1);
@@ -279,7 +280,7 @@ bool SaveThemeDialog::saveTheme()
sto.setVersion("1.0.0");
QString szSubdir = sto.name() + QString("-") + sto.version();
- szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_");
+ szSubdir.replace(KviRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_");
sto.setDirectoryAndLocation(szSubdir, KviThemeInfo::User);
QString szAbsDir = sto.directory();
diff --git a/src/modules/theme/ThemeFunctions.cpp b/src/modules/theme/ThemeFunctions.cpp
index 187a21f13..0583e9a5a 100644
--- a/src/modules/theme/ThemeFunctions.cpp
+++ b/src/modules/theme/ThemeFunctions.cpp
@@ -33,6 +33,7 @@
#include "KviIconManager.h"
#include "KviMiscUtils.h"
#include "kvi_sourcesdate.h"
+#include "KviRegExp.h"
#include "KviTheme.h"
#include "KviMainWindow.h"
@@ -469,7 +470,7 @@ namespace ThemeFunctions
}
QString szSubdir = pInfo->name() + QString("-") + pInfo->version();
- szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_");
+ szSubdir.replace(KviRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_");
szTmp = QString("Theme%1Name").arg(iIdx);
f.addInfoField(szTmp, pInfo->name());
diff --git a/src/modules/theme/ThemeManagementDialog.cpp b/src/modules/theme/ThemeManagementDialog.cpp
index 795a1e1b3..a2ba82c0a 100644
--- a/src/modules/theme/ThemeManagementDialog.cpp
+++ b/src/modules/theme/ThemeManagementDialog.cpp
@@ -51,7 +51,6 @@
#include <QLayout>
#include <QPushButton>
#include <QLineEdit>
-#include <QRegExp>
#include <QMessageBox>
#include <QDir>
#include <QStringList>
diff --git a/src/modules/theme/WebThemeInterfaceDialog.cpp b/src/modules/theme/WebThemeInterfaceDialog.cpp
index e21a5c48b..e6eb16711 100644
--- a/src/modules/theme/WebThemeInterfaceDialog.cpp
+++ b/src/modules/theme/WebThemeInterfaceDialog.cpp
@@ -33,6 +33,7 @@
#include "KviFileUtils.h"
#include "KviIconManager.h"
#include "KviLocale.h"
+#include "KviRegExp.h"
WebThemeInterfaceDialog::WebThemeInterfaceDialog(QWidget * par)
: KviWebPackageManagementDialog(par)
@@ -62,7 +63,7 @@ bool WebThemeInterfaceDialog::installPackage(const QString & szPath, QString & s
bool WebThemeInterfaceDialog::packageIsInstalled(const QString & szId, const QString & szVersion)
{
QString szSubdir = szId + QString("-") + szVersion;
- szSubdir.replace(QRegularExpression("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_");
+ szSubdir.replace(KviRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_");
return KviFileUtils::fileExists(m_szGlobalThemesPath + szSubdir) || KviFileUtils::fileExists(m_szLocalThemesPath + szSubdir);
}