[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sun Dec 26 02:31:59 UTC 2004


CVS commit by okellogg: 

No need for m_Name, use the QObject::name() instead.


  M +14 -9     umlview.cpp   1.198
  M +2 -11     umlview.h   1.66


--- kdesdk/umbrello/umbrello/umlview.cpp  #1.197:1.198
@@ -114,5 +114,5 @@ UMLView::UMLView() : QCanvasView(UMLApp:
         m_pDoc = UMLApp::app()->getDocument();
 }
-////////////////////////////////////////////////////////////////////////////////////////////////////
+
 void UMLView::init() {
         // Initialize loaded/saved data
@@ -120,5 +120,4 @@ void UMLView::init() {
         m_pDoc = NULL;
         m_Documentation = "";
-        m_Name = "umlview";
         m_Type = dt_Undefined;
         m_nLocalID = 900000;
@@ -185,5 +184,4 @@ void UMLView::init() {
 }
 
-////////////////////////////////////////////////////////////////////////////////////////////////////
 UMLView::~UMLView() {
         if(m_pIDChangesLog) {
@@ -216,5 +214,12 @@ UMLView::~UMLView() {
 }
 
-////////////////////////////////////////////////////////////////////////////////////////////////////
+QString UMLView::getName() const {
+        return QString( QObject::name() );
+}
+
+void UMLView::setName(const QString &name) {
+        QObject::setName( name.latin1() );
+}
+
 void UMLView::print(KPrinter *pPrinter, QPainter & pPainter) {
         int height, width;
@@ -3144,5 +3149,5 @@ void UMLView::saveToXMI( QDomDocument & 
         QDomElement viewElement = qDoc.createElement( "diagram" );
         viewElement.setAttribute( "xmi.id", ID2STR(m_nID) );
-        viewElement.setAttribute( "name", m_Name );
+        viewElement.setAttribute( "name", getName() );
         viewElement.setAttribute( "type", m_Type );
         viewElement.setAttribute( "documentation", m_Documentation );
@@ -3227,5 +3232,5 @@ bool UMLView::loadFromXMI( QDomElement &
         if( m_nID == Uml::id_None )
                 return false;
-        m_Name = qElement.attribute( "name", "" );
+        setName( qElement.attribute( "name", "" ) );
         QString type = qElement.attribute( "type", "-1" );
         m_Documentation = qElement.attribute( "documentation", "" );
@@ -3627,7 +3632,7 @@ bool UMLView::loadUISDiagram(QDomElement
                 QString tag = elem.tagName();
                 if (tag == "uisDiagramName") {
-                        m_Name = elem.text();
+                        setName( elem.text() );
                         if (ulvi)
-                                ulvi->setText( m_Name );
+                                ulvi->setText( getName() );
                 } else if (tag == "uisDiagramStyle") {
                         QString diagramStyle = elem.text();
@@ -3640,5 +3645,5 @@ bool UMLView::loadUISDiagram(QDomElement
                         m_Type = Uml::dt_Class;
                         UMLListView *lv = UMLApp::app()->getListView();
-                        ulvi = new UMLListViewItem( lv->theLogicalView(), m_Name,
+                        ulvi = new UMLListViewItem( lv->theLogicalView(), getName(),
                                                     Uml::lvt_Class_Diagram, m_nID );
                 } else if (tag == "uisDiagramPresentation") {

--- kdesdk/umbrello/umbrello/umlview.h  #1.65:1.66
@@ -90,14 +90,10 @@ public:
          * Return the name of the diagram.
          */
-        QString getName() const {
-                return m_Name;
-        }
+        QString getName() const;
 
         /**
          * Set the name of the diagram.
          */
-        void setName( const QString &name ) {
-                m_Name = name;
-        }
+        void setName(const QString &name);
 
         /**
@@ -886,9 +882,4 @@ protected:
 
         /**
-         * The name of the diagram.
-         */
-        QString m_Name;
-
-        /**
          * The documentation of the diagram.
          */






More information about the umbrello-devel mailing list