diff options
| author | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2021-12-06 18:54:46 -0600 |
|---|---|---|
| committer | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2022-04-19 15:17:23 +0200 |
| commit | fb4cd4375c0a547129b454c376a32d752bc70422 (patch) | |
| tree | 7356323bee8287eb7a843e5d182592cfa9cbd0ce /src/modlistviewactions.cpp | |
| parent | c4b2be45d29a247422e60bb8fdf1664c10384eee (diff) | |
Remove dependency on Core5Compat
Diffstat (limited to 'src/modlistviewactions.cpp')
| -rw-r--r-- | src/modlistviewactions.cpp | 8 |
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?"), |
