From 1755f526c96a547f33306008bff99f12a3e4da72 Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Tue, 23 Nov 2021 11:49:44 -0700 Subject: Fix extension parsing for the plugin list The old code was just looking at the last three letters of the filename instead of looking for any kind of proper extension. This led to something like "alice.__esp" being considered a plugin which is just wrong. --- src/pluginlist.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/pluginlist.cpp') diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 10ed1e28..bec7f0c3 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -42,6 +42,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include @@ -201,9 +202,9 @@ void PluginList::refresh(const QString &profileName } QString filename = ToQString(current->getName()); - QString extension = filename.right(3).toLower(); - - if ((extension == "esp") || (extension == "esm") || (extension == "esl")) { + if (filename.endsWith(".esp", Qt::CaseInsensitive) || + filename.endsWith(".esm", Qt::CaseInsensitive) || + filename.endsWith(".esl", Qt::CaseInsensitive)) { availablePlugins.append(filename); -- cgit v1.3.1