Salome HOME
lot 10 - warnings for DTM - untested
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ListSelector.cxx
index a973b0351ff7cecfc83cf754a3d94945c1476125..7ae11a62ba7c1bc2905c77b7a9874eb851435abc 100644 (file)
 
 #include "HYDROGUI_OrderedListWidget.h"
 
-#include <LightApp_DataOwner.h>
+#ifdef TEST_MODE
+  #include <SUIT_DataOwner.h>
+  class TestOwner : public SUIT_DataOwner
+  {
+  public:
+    TestOwner( const QString& entry ) { myEntry = entry; }
+    virtual ~TestOwner() {}
+
+    QString keyString() const { return myEntry; }
+    QString entry() const { return myEntry; }
+
+  private:
+    QString myEntry;
+  };
+  #define OWNER_CLASS TestOwner
+
+#else
+  #include <LightApp_DataOwner.h>
+  #define OWNER_CLASS LightApp_DataOwner
+#endif
 
 
 HYDROGUI_ListSelector::HYDROGUI_ListSelector( HYDROGUI_OrderedListWidget* theListWidget,
@@ -57,7 +76,7 @@ void HYDROGUI_ListSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
 
   foreach ( const QString& anEntry, aSelectedEntries ) {
     if ( !anEntry.isEmpty() ) {
-      theList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( anEntry ) ) );
+      theList.append( SUIT_DataOwnerPtr( new OWNER_CLASS( anEntry ) ) );
     }
   }
 }
@@ -73,7 +92,7 @@ void HYDROGUI_ListSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
   QStringList aSelectedEntries;
   SUIT_DataOwnerPtrList::const_iterator anIt = theList.begin();
   for ( ; anIt != theList.end(); ++anIt ) {
-    const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>( (*anIt).operator->() );
+    const OWNER_CLASS* anOwner = dynamic_cast<const OWNER_CLASS*>( (*anIt).operator->() );
     if ( anOwner ) {
       aSelectedEntries << anOwner->entry();
     }