[Uml-devel] KDE/kdesdk/umbrello/umbrello

Andi Fischer andi.fischer at hispeed.ch
Fri Jan 6 17:18:19 UTC 2012


SVN commit 1272077 by fischer:

Enum to string conversion functions added.

 M  +1 -1      umldoc.cpp  
 M  +9 -1      umlobject.cpp  
 M  +2 -1      umlobject.h  
 M  +12 -1     widgets/widgetbase.cpp  
 M  +3 -1      widgets/widgetbase.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp #1272076:1272077
@@ -2124,7 +2124,7 @@
             }
             else {
                 uError() << "Guess is Uml::ModelType::N_MODELTYPES - package not set correctly for "
-                         << pObject->name() << " / base type " << ot;
+                         << pObject->name() << " / base type " << pObject->baseTypeStr();
                 pkg = m_root[Uml::ModelType::Logical];
             }
         }
--- trunk/KDE/kdesdk/umbrello/umbrello/umlobject.cpp #1272076:1272077
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2011                                               *
+ *   copyright (C) 2002-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -378,6 +378,14 @@
 }
 
 /**
+ * @return The type used for rtti as string.
+ */
+QLatin1String UMLObject::baseTypeStr() const
+{
+    return QLatin1String(ENUM_NAME(UMLObject, ObjectType, m_BaseType));
+}
+
+/**
  * Set the type of the object.
  *
  * @param ot The ObjectType to set.
--- trunk/KDE/kdesdk/umbrello/umbrello/umlobject.h #1272076:1272077
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2011                                               *
+ *   copyright (C) 2002-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -89,6 +89,7 @@
 
     virtual void setBaseType(ObjectType ot);
     ObjectType baseType() const;
+    QLatin1String baseTypeStr() const;
 
     virtual void setID(Uml::IDType NewID);
     virtual Uml::IDType id() const;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/widgetbase.cpp #1272076:1272077
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -297,4 +297,15 @@
     return *this;
 }
 
+/**
+ * Helper function for debug output.
+ * Returns the given enum value as string.
+ * @param ot   ObjectType of which a string representation is wanted
+ * @return   the ObjectType as string
+ */
+QString WidgetBase::toString(WidgetType wt)
+{
+    return QLatin1String(ENUM_NAME(WidgetBase, WidgetType, wt));
+}
+
 #include "widgetbase.moc"
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/widgetbase.h #1272076:1272077
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -67,6 +67,8 @@
         wt_Category                 // has UMLObject representation
     };
 
+    static QString toString(WidgetType wt);
+
     explicit WidgetBase(UMLScene * scene);
     virtual ~WidgetBase();
 




More information about the umbrello-devel mailing list