From 41a7950b737dc049f391a6b331a47e4c5cee2cdb Mon Sep 17 00:00:00 2001
From: Victor Poughon <victor.poughon@cnes.fr>
Date: Mon, 29 Apr 2019 13:49:25 +0200
Subject: [PATCH] REFAC: refactor SetupForFilenameDrop

---
 .../Indices/include/otbRadiometricIndex.h     |  2 +-
 .../mvdQtWidgetParameterInitializers.h        | 27 +++++++++----------
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/Modules/Radiometry/Indices/include/otbRadiometricIndex.h b/Modules/Radiometry/Indices/include/otbRadiometricIndex.h
index d65213a2ec..15cdba6cad 100644
--- a/Modules/Radiometry/Indices/include/otbRadiometricIndex.h
+++ b/Modules/Radiometry/Indices/include/otbRadiometricIndex.h
@@ -194,7 +194,7 @@ protected:
    */
   double Value(BandNameType band, const itk::VariableLengthVector<TInput>& input) const
   {
-    assert(m_RequiredBands[band] && "Retrieving value for a band that is not in the required bands list");
+    assert(m_RequiredBands[static_cast<size_t>(band)] && "Retrieving value for a band that is not in the required bands list");
     return static_cast<double>(input[UncheckedBandIndex(band) - 1]);
   }
 
diff --git a/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h b/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h
index 313f8f1537..1be6f7514f 100644
--- a/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h
+++ b/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h
@@ -90,7 +90,7 @@ namespace Wrapper
  */
 template< typename W >
 void
-SetupForFilenameDrop( W* widget, const char* text =NULL );
+SetupForFilenameDrop( W* widget );
 
 /**
  */
@@ -376,7 +376,7 @@ FileSelectionInitializer
 {
   assert( widget!=NULL );
 
-  SetupForFilenameDrop( widget, "You can drop filename here." );
+  SetupForFilenameDrop( widget );
 }
 
 /*****************************************************************************/
@@ -387,7 +387,7 @@ InputImageInitializer
 {
   assert( widget!=NULL );
 
-  SetupForFilenameDrop( widget, "You can drop filename here." );
+  SetupForFilenameDrop( widget );
 }
 
 /*****************************************************************************/
@@ -409,7 +409,7 @@ InputFilenameInitializer
 {
   assert( widget!=NULL );
 
-  SetupForFilenameDrop( widget, "You can drop filename here." );
+  SetupForFilenameDrop( widget );
 }
 
 /*****************************************************************************/
@@ -431,7 +431,7 @@ InputVectorDataInitializer
 {
   assert( widget!=NULL );
 
-  SetupForFilenameDrop( widget, "You can drop filename here." );
+  SetupForFilenameDrop( widget );
 }
 
 /*****************************************************************************/
@@ -453,7 +453,7 @@ InputProcessXMLInitializer
 {
   assert( widget!=NULL );
 
-  SetupForFilenameDrop( widget, "You can drop filename here." );
+  SetupForFilenameDrop( widget );
 }
 
 /*****************************************************************************/
@@ -494,7 +494,7 @@ OutputImageInitializer
 
   if( m_Prefix.isEmpty() )
     {
-    SetupForFilenameDrop( widget, "You can drop filename here." );
+    SetupForFilenameDrop( widget );
 
     assert( qApp!=NULL );
     assert( !qApp->arguments().empty() );
@@ -518,7 +518,7 @@ OutputVectorDataInitializer
 {
   assert( widget!=NULL );
 
-  SetupForFilenameDrop( widget, "You can drop filename here." );
+  SetupForFilenameDrop( widget );
 
   assert( qApp!=NULL );
   assert( !qApp->arguments().empty() );
@@ -534,7 +534,7 @@ OutputFilenameInitializer
 {
   assert( widget!=NULL );
 
-  SetupForFilenameDrop( widget, "You can drop filename here." );
+  SetupForFilenameDrop( widget );
 
   assert( qApp!=NULL );
   assert( !qApp->arguments().empty() );
@@ -550,7 +550,7 @@ OutputProcessXMLInitializer
 {
   assert( widget!=NULL );
 
-  SetupForFilenameDrop( widget, "You can drop filename here." );
+  SetupForFilenameDrop( widget );
 
   assert( qApp!=NULL );
   assert( !qApp->arguments().empty() );
@@ -592,7 +592,7 @@ ParameterListInitializer
 /*****************************************************************************/
 template< typename W >
 void
-SetupForFilenameDrop( W* widget, const char* text )
+SetupForFilenameDrop( W* widget )
 {
   assert( widget!=NULL );
 
@@ -602,15 +602,12 @@ SetupForFilenameDrop( W* widget, const char* text )
   // Setup widget.
   bool signalsBlocked = lineEdit->blockSignals( true );
   {
-  if( text!=NULL )
-    {
     lineEdit->setPlaceholderText(
       QCoreApplication::translate(
         "mvd::Wrapper::QtWidgetView",
-        text
+        "You can drop a file here"
       )
     );
-    }
 
   // lineEdit->setReadOnly( true );
 
-- 
GitLab