From b317305889ace154297a84f046bf73fee943cc12 Mon Sep 17 00:00:00 2001
From: Martin Heistermann <git@mheistermann.de>
Date: Thu, 24 Jan 2019 15:52:00 +0100
Subject: [PATCH] Fix bug in File loader plugin selection.

Bug example: OVM loads *.volumemesh files, however the previous logic would
also try to use this plugin to load a *.mesh file, because "mesh" is a
suffix of "volumemesh"

This change adopts the same logic exhibited in Core/openFunctions.cc to
require an advertised filetype to have a suffix of "*.ext", not of "ext"
when trying to load a file "foo.ext".
---
 widgets/loadWidget/loadWidget.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/widgets/loadWidget/loadWidget.cc b/widgets/loadWidget/loadWidget.cc
index 85db3ce2..2d6ae1d8 100644
--- a/widgets/loadWidget/loadWidget.cc
+++ b/widgets/loadWidget/loadWidget.cc
@@ -212,7 +212,7 @@ void LoadWidget::loadFile(){
 
       for ( int filterId = 0 ; filterId < separateFilters.size(); ++filterId ) {
 
-        if (separateFilters[filterId].endsWith(ext[i],Qt::CaseInsensitive)){
+        if (separateFilters[filterId].endsWith("*." + ext[i],Qt::CaseInsensitive)){
           pluginForExtension_[ ext[i] ] = t;
           found = true;
         }
-- 
GitLab