diff options
| author | Chris Bessent <lost.dragonist@gmail.com> | 2021-11-23 11:49:44 -0700 |
|---|---|---|
| committer | Chris Bessent <lost.dragonist@gmail.com> | 2021-11-23 11:49:44 -0700 |
| commit | 1755f526c96a547f33306008bff99f12a3e4da72 (patch) | |
| tree | 37c870eebdcf1a0c5e52d36c8b4a5f7d5afe84b8 /src/pluginlist.cpp | |
| parent | a1e953f40936c9e52292fd06cb9b80fd66bf5e43 (diff) | |
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.
Diffstat (limited to 'src/pluginlist.cpp')
| -rw-r--r-- | src/pluginlist.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>. #include <QDateTime>
#include <QDir>
#include <QFile>
+#include <QFileInfo>
#include <QTextCodec>
#include <QFileInfo>
#include <QListWidgetItem>
@@ -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);
|
