Replace QRegExp with QRegularExpression (#7133)
* replace QRegExp with QRegularExpression (find n replace) * follow up to fix errors * removed rpmalloc * Fix compilation for qt5, to be fixed when qt6 fully supported. Co-authored-by: Kevin Zander <veratil@gmail.com> * Added QtGlobal header for version finding fix * Use the other syntax to try fix compilation. * Check for 5.12 instead. * Fix the header * Attempt at fixing it further. * Use version checks properly in header file * Use QT_VERSION_CHECK macro in sources * Apply suggestions from messmerd's review Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com> --------- Co-authored-by: Kevin Zander <veratil@gmail.com> Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QDomElement>
|
||||
#include <QMutex>
|
||||
#include <QRegularExpression>
|
||||
|
||||
// carla/source/includes
|
||||
#include "carlabase_export.h"
|
||||
@@ -89,8 +90,8 @@ public:
|
||||
// From AutomatableModel.h, it's private there.
|
||||
inline static bool mustQuoteName(const QString &name)
|
||||
{
|
||||
QRegExp reg("^[A-Za-z0-9._-]+$");
|
||||
return !reg.exactMatch(name);
|
||||
QRegularExpression reg("^[A-Za-z0-9._-]+$");
|
||||
return !reg.match(name).hasMatch();
|
||||
}
|
||||
|
||||
inline void loadSettings(const QDomElement& element, const QString& name = QString("value")) override
|
||||
|
||||
@@ -171,8 +171,7 @@ ladspa_key_t LadspaSubPluginFeatures::subPluginKeyToLadspaKey(
|
||||
const Key * _key )
|
||||
{
|
||||
QString file = _key->attributes["file"];
|
||||
return( ladspa_key_t( file.remove( QRegExp( "\\.so$" ) ).
|
||||
remove( QRegExp( "\\.dll$" ) ) +
|
||||
return(ladspa_key_t(file.remove(QRegularExpression("\\.so$")).remove(QRegularExpression("\\.dll$")) +
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
".dll"
|
||||
#else
|
||||
|
||||
@@ -311,7 +311,7 @@ void ZynAddSubFxInstrument::loadFile( const QString & _file )
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
instrumentTrack()->setName( QFileInfo( _file ).baseName().replace( QRegExp( "^[0-9]{4}-" ), QString() ) );
|
||||
instrumentTrack()->setName(QFileInfo(_file).baseName().replace(QRegularExpression("^[0-9]{4}-"), QString()));
|
||||
|
||||
m_modifiedControllers.clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user