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:
@@ -25,9 +25,10 @@
|
||||
#ifndef LMMS_AUTOMATABLE_MODEL_H
|
||||
#define LMMS_AUTOMATABLE_MODEL_H
|
||||
|
||||
#include <cmath>
|
||||
#include <QMap>
|
||||
#include <QMutex>
|
||||
#include <cmath>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "JournallingObject.h"
|
||||
#include "Model.h"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <QPushButton>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <QScrollArea>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStandardItemModel>
|
||||
@@ -65,10 +65,19 @@ protected:
|
||||
QString name = sourceModel()->data(nameIndex, Qt::DisplayRole).toString();
|
||||
QString type = sourceModel()->data(typeIndex, Qt::DisplayRole).toString();
|
||||
|
||||
QRegExp nameRegExp(filterRegExp());
|
||||
nameRegExp.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
// TODO: cleanup once we drop Qt5 support
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,12,0))
|
||||
QRegularExpression nameRegularExpression(filterRegularExpression());
|
||||
nameRegularExpression.setPatternOptions(QRegularExpression::CaseInsensitiveOption);
|
||||
|
||||
bool nameFilterPassed = nameRegularExpression.match(name).capturedStart() != -1;
|
||||
#else
|
||||
QRegExp nameRegularExpression(filterRegExp());
|
||||
nameRegularExpression.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
bool nameFilterPassed = nameRegularExpression.indexIn(name) != -1;
|
||||
#endif
|
||||
|
||||
bool nameFilterPassed = nameRegExp.indexIn(name) != -1;
|
||||
bool typeFilterPassed = type.contains(m_effectTypeFilter, Qt::CaseInsensitive);
|
||||
|
||||
return nameFilterPassed && typeFilterPassed;
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#ifndef LMMS_LADSPA_BASE_H
|
||||
#define LMMS_LADSPA_BASE_H
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "LadspaManager.h"
|
||||
#include "Plugin.h"
|
||||
|
||||
@@ -75,7 +77,7 @@ inline Plugin::Descriptor::SubPluginFeatures::Key ladspaKeyToSubPluginKey(
|
||||
{
|
||||
Plugin::Descriptor::SubPluginFeatures::Key::AttributeMap m;
|
||||
QString file = _key.first;
|
||||
m["file"] = file.remove( QRegExp( "\\.so$" ) ).remove( QRegExp( "\\.dll$" ) );
|
||||
m["file"] = file.remove(QRegularExpression("\\.so$")).remove(QRegularExpression("\\.dll$"));
|
||||
m["plugin"] = _key.second;
|
||||
return Plugin::Descriptor::SubPluginFeatures::Key( _desc, _name, m );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user