From 65ddf6116a972283782ddf0e4d80ac4a1027c855 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 3 Nov 2005 07:14:34 +0000 Subject: [PATCH] Return name of root object as moduleName --- src/CAM/CAM_RootObject.cxx | 12 ++++++++++++ src/CAM/CAM_RootObject.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/CAM/CAM_RootObject.cxx b/src/CAM/CAM_RootObject.cxx index e24827167..d915a7c1d 100755 --- a/src/CAM/CAM_RootObject.cxx +++ b/src/CAM/CAM_RootObject.cxx @@ -1,6 +1,7 @@ #include "CAM_RootObject.h" #include "CAM_DataModel.h" +#include "CAM_Module.h" /*!Constructor. Initialize by \a parent. * Set data model to 0. @@ -26,6 +27,17 @@ CAM_RootObject::~CAM_RootObject() { } +/*! + Returns module name +*/ +QString CAM_RootObject::name() const +{ + QString aName = ""; + if (myDataModel) + aName = myDataModel->module()->moduleName(); + return aName; +} + /*!Get data model *\retval const CAM_DataModel pointer to data model. */ diff --git a/src/CAM/CAM_RootObject.h b/src/CAM/CAM_RootObject.h index dee53d7ba..7e4e2d4b8 100755 --- a/src/CAM/CAM_RootObject.h +++ b/src/CAM/CAM_RootObject.h @@ -18,6 +18,8 @@ public: CAM_RootObject( CAM_DataModel*, SUIT_DataObject* = 0 ); virtual ~CAM_RootObject(); + virtual QString name() const; + virtual CAM_DataModel* dataModel() const; virtual void setDataModel( CAM_DataModel* ); -- 2.39.2