From 1afe1bc1a57f91380cbac690fffc620e5866a313 Mon Sep 17 00:00:00 2001
From: Rashad Kanavath <rashad.kanavath@c-s.fr>
Date: Fri, 12 Jul 2019 14:07:19 +0200
Subject: [PATCH] [BUG] set fileFilter to None for ParameterType_OutputFilename

---
 .../Wrappers/QGIS/src/otbQgisDescriptor.cxx   | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx b/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
index c4a32c78cd..0f46c783e0 100644
--- a/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
+++ b/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
@@ -123,6 +123,15 @@ int main(int argc, char* argv[])
   
   dFile << appli->GetDescription() << std::endl;
   dFile << group << std::endl;
+
+  /*
+  From here onwards each line appended to dFile is passed to QgsProcessingParameter* class constructor.
+  dFile is nothing but a csv (with a .txt) with "|" as delimiter character.
+  First field is the name of Qgis parameter class and rest of it are extracted as list and passed to class constructor.
+  Parsing and calling of paramater classes are done by python.
+  source available : qgis/python/plugins/processing/core/parameters.py
+  source code of qgis parameter is available at: qgis/src/core/processing/qgsprocessingparameters.cpp
+  */
   
   for ( unsigned int i = 0; i < nbOfParam; i++ )
     {
@@ -250,12 +259,16 @@ int main(int argc, char* argv[])
       // setting default_value this way is an exception for ParameterType_StringList and ParameterType_String
       default_value = "None|True";
       }
-    else if (type == ParameterType_InputImage
-          || type == ParameterType_OutputImage
-          || type == ParameterType_OutputFilename)
+    else if (type == ParameterType_InputImage || type == ParameterType_OutputImage)
       {
       // default is None and nothing to add to dFile
       }
+    else if (type == ParameterType_OutputFilename)
+      {
+      // fileFilter and defaultValue is None
+      // OTB does not have any implementation for file extension.
+	default_value = "None|None";
+      }
     else if(type == ParameterType_ListView)
       {
       // default is None and nothing to add to dFile
-- 
GitLab