summaryrefslogtreecommitdiff
path: root/src/modlistviewactions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlistviewactions.cpp')
-rw-r--r--src/modlistviewactions.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modlistviewactions.cpp b/src/modlistviewactions.cpp
index f72e8d0c..272d2ec6 100644
--- a/src/modlistviewactions.cpp
+++ b/src/modlistviewactions.cpp
@@ -4,7 +4,6 @@
#include <QGroupBox>
#include <QInputDialog>
#include <QLabel>
-#include <QRegExp>
#include <log.h>
#include <report.h>
@@ -1147,10 +1146,11 @@ void ModListViewActions::openExplorer(const QModelIndexList& index) const
void ModListViewActions::restoreBackup(const QModelIndex& index) const
{
- QRegExp backupRegEx("(.*)_backup[0-9]*$");
+ QRegularExpression backupRegEx("(.*)_backup[0-9]*$");
ModInfo::Ptr modInfo = ModInfo::getByIndex(index.data(ModList::IndexRole).toInt());
- if (backupRegEx.indexIn(modInfo->name()) != -1) {
- QString regName = backupRegEx.cap(1);
+ auto match = backupRegEx.match(modInfo->name());
+ if (match.hasMatch()) {
+ QString regName = match.captured(1);
QDir modDir(QDir::fromNativeSeparators(m_core.settings().paths().mods()));
if (!modDir.exists(regName) ||
(QMessageBox::question(m_parent, tr("Overwrite?"),