From e5414964cca549cf30fa8c9529a25eeb81956a05 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 17 Apr 2008 07:27:50 +0000 Subject: [PATCH] enable loading resources of MESH plugings by prepending plugin name to pixMap name --- src/SalomeApp/SalomeApp_DataObject.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index dd9ff8960..58a30df01 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -106,11 +106,19 @@ QPixmap SalomeApp_DataObject::icon() const if ( myObject && myObject->FindAttribute( anAttr, "AttributePixMap" ) ){ _PTR(AttributePixMap) aPixAttr ( anAttr ); if ( aPixAttr->HasPixMap() ){ - QString pixmapName = QObject::tr( aPixAttr->GetPixMap().c_str() ); + QString componentType = componentDataType(); + QString pixmapID = aPixAttr->GetPixMap().c_str(); + // select a plugin within a component + QStringList plugin_pixmap = QStringList::split(QString("::"), pixmapID); + if ( plugin_pixmap.size() == 2 ) { + componentType = plugin_pixmap.front(); + pixmapID = plugin_pixmap.back(); + } + QString pixmapName = QObject::tr( pixmapID ); LightApp_RootObject* aRoot = dynamic_cast( root() ); if ( aRoot && aRoot->study() ) { SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr(); - return mgr->loadPixmap( componentDataType(), pixmapName, false ); + return mgr->loadPixmap( componentType, pixmapName, false ); } } } -- 2.39.2