mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 10:30:53 +01:00
Fix deprecated QRegExp
Use QRegularExpression instead. https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users This function was introduced in Qt 5
This commit is contained in:
@@ -33,14 +33,14 @@
|
||||
#include "projectview.h"
|
||||
#include "elementpicturefactory.h"
|
||||
#include "aboutqetdialog.h"
|
||||
#include "factory/elementfactory.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#define QUOTE(x) STRINGIFY(x)
|
||||
#define STRINGIFY(x) #x
|
||||
#include <QProcessEnvironment>
|
||||
#include "factory/elementfactory.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <KAutoSaveFile>
|
||||
|
||||
#ifdef QET_ALLOW_OVERRIDE_CED_OPTION
|
||||
@@ -911,7 +911,7 @@ QStringList QETApp::handledFileExtensions()
|
||||
if (!ext.count()) {
|
||||
ext << "qet";
|
||||
ext << "elmt";
|
||||
ext << QString(TITLEBLOCKS_FILE_EXTENSION).remove(QRegExp("^\\."));
|
||||
ext << QString(TITLEBLOCKS_FILE_EXTENSION).remove(QRegularExpression("^\\."));
|
||||
}
|
||||
return(ext);
|
||||
}
|
||||
@@ -2102,10 +2102,10 @@ template <class T> void QETApp::addWindowsListToMenu(
|
||||
or -1 if none could be found.
|
||||
*/
|
||||
int QETApp::projectIdFromString(const QString &url) {
|
||||
QRegExp embedded("^project([0-9]+)\\+embed.*$", Qt::CaseInsensitive);
|
||||
if (embedded.exactMatch(url)) {
|
||||
QRegularExpression embedded("^project([0-9]+)\\+embed.*$", QRegularExpression::CaseInsensitiveOption);
|
||||
if (embedded==QRegularExpression(url)) {
|
||||
bool conv_ok = false;
|
||||
int project_id = embedded.capturedTexts().at(1).toInt(&conv_ok);
|
||||
int project_id = embedded.namedCaptureGroups().at(1).toInt(&conv_ok);
|
||||
if (conv_ok) {
|
||||
return(project_id);
|
||||
}
|
||||
@@ -2227,10 +2227,10 @@ void QETApp::checkBackupFiles()
|
||||
for(const KAutoSaveFile *kasf : stale_files)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
//Remove the first character '/' before the name of the drive
|
||||
text.append("<br>" + kasf->managedFile().path().remove(0,1));
|
||||
//Remove the first character '/' before the name of the drive
|
||||
text.append("<br>" + kasf->managedFile().path().remove(0,1));
|
||||
#else
|
||||
text.append("<br>" + kasf->managedFile().path());
|
||||
text.append("<br>" + kasf->managedFile().path());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2319,12 +2319,12 @@ void QETApp::fetchWindowStats(
|
||||
bool QETApp::eventFiltrer(QObject *object, QEvent *e) {
|
||||
// gere l'ouverture de fichiers (sous MacOs)
|
||||
if (e -> type() == QEvent::FileOpen) {
|
||||
// nom du fichier a ouvrir
|
||||
QString filename = static_cast<QFileOpenEvent *>(e) -> file();
|
||||
openFiles(QStringList() << filename);
|
||||
return(true);
|
||||
// nom du fichier a ouvrir
|
||||
QString filename = static_cast<QFileOpenEvent *>(e) -> file();
|
||||
openFiles(QStringList() << filename);
|
||||
return(true);
|
||||
} else {
|
||||
return QObject::eventFilter(object, e);
|
||||
return QObject::eventFilter(object, e);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user