From 6e67ac73f0b8605886c5382ab72e2073fe40f332 Mon Sep 17 00:00:00 2001 From: nge Date: Fri, 4 Jun 2010 15:58:37 +0000 Subject: [PATCH] Fix Icon system by fixing ComponentDataType method. Ca marchait sans la notif parce que la bretelle etait la aussi... --- src/SalomeApp/SalomeApp_DataObject.cxx | 18 ++++++++---------- src/SalomeApp/SalomeApp_Study.cxx | 4 +--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index 28ac15f0e..1a2f2a82d 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -164,6 +164,7 @@ QPixmap SalomeApp_DataObject::icon( const int id ) const if ( id == NameId ) { _PTR(GenericAttribute) anAttr; if ( myObject && myObject->FindAttribute( anAttr, "AttributePixMap" ) ){ + MESSAGE("SalomeApp_DataObject::icon : found attributePixmap") _PTR(AttributePixMap) aPixAttr ( anAttr ); if ( aPixAttr->HasPixMap() ) { QString componentType = componentDataType(); @@ -176,8 +177,11 @@ QPixmap SalomeApp_DataObject::icon( const int id ) const } QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() ); LightApp_RootObject* aRoot = dynamic_cast( root() ); + MESSAGE("SalomeApp_DataObject::icon : after dynamic cast") if ( aRoot && aRoot->study() ) { SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr(); + MESSAGE("SalomeApp_DataObject::icon : Call to mgr mgr == " << mgr ); + MESSAGE("SalomeApp_DataObject::icon : Call to mgr loadPixmap ( " << componentType.toStdString() << " , " << pixmapName.toStdString() << " )"); return mgr->loadPixmap( componentType, pixmapName, false ); } } @@ -308,16 +312,10 @@ QFont SalomeApp_DataObject::font( const int id ) const QString SalomeApp_DataObject::componentDataType() const { // if ( myCompDataType.isEmpty() ) { - const SalomeApp_DataObject* compObj = dynamic_cast( componentObject() ); - if ( compObj && compObj->object() ) - { - _PTR(SComponent) aComp( compObj->object() ); - if ( aComp ) { - SalomeApp_DataObject* that = (SalomeApp_DataObject*)this; - that->myCompDataType = aComp->ComponentDataType().c_str(); - } - } - // } + const SalomeApp_DataObject* compObj = dynamic_cast( componentObject() ); + _PTR(GenericAttribute) anAttr; + SalomeApp_DataObject* that = (SalomeApp_DataObject*)this; + that->myCompDataType=myObject->GetFatherComponent()->ComponentDataType().c_str(); return myCompDataType; } diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index da06dd0d5..8df6c633f 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -62,7 +62,6 @@ class Observer_i : public virtual POA_SALOME::Observer { MESSAGE("I'm notified of " << event << " of ID = " << theID); _PTR(SObject) obj = myStudyDS->FindObjectID( theID ); - MESSAGE("This obj is named " << obj->GetIOR()); MESSAGE("Checking the ID from the sObj : " << obj->GetID()); std::string entry_str = theID; @@ -140,10 +139,9 @@ class Observer_i : public virtual POA_SALOME::Observer suit_obj= entry2SuitObject[theID]; LightApp_Application* myApp=dynamic_cast(myStudy->application()); if (myApp){ - MESSAGE("Got an App !"); SUIT_ProxyModel* myModel=dynamic_cast(myApp->objectBrowser()->model()); if (myModel){ - MESSAGE("Call to myModel->updateItem"); + MESSAGE("Call to SUIT_ProxyModel::myModel->updateItem"); myModel->updateItem(suit_obj); } } -- 2.39.2