[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Thu Dec 23 07:05:02 UTC 2004


CVS commit by okellogg: 

ClassifierWidget::displayedMembers(): New.


  M +8 -4      classifierwidget.cpp   1.5
  M +6 -0      classifierwidget.h   1.5
  M +1 -8      classwidget.cpp   1.36


--- kdesdk/umbrello/umbrello/classifierwidget.cpp  #1.4:1.5
@@ -180,10 +180,8 @@ void ClassifierWidget::setOpSignature(Um
 }
 
-int ClassifierWidget::displayedOperations() {
-        if (!m_bShowOperations)
-                return 0;
+int ClassifierWidget::displayedMembers(Uml::Object_Type ot) {
         UMLClassifier *c = static_cast<UMLClassifier*>(m_pObject);
         int count = 0;
-        UMLClassifierListItemList list = c->getFilteredList(Uml::ot_Operation);
+        UMLClassifierListItemList list = c->getFilteredList(ot);
         for (UMLClassifierListItem *m = list.first(); m; m = list.next()) {
                 if (!(m_bShowPublicOnly && m->getScope() != Uml::Public))
@@ -193,4 +191,10 @@ int ClassifierWidget::displayedOperation
 }
 
+int ClassifierWidget::displayedOperations() {
+        if (!m_bShowOperations)
+                return 0;
+        return displayedMembers(Uml::ot_Operation);
+}
+
 bool ClassifierWidget::activate(IDChangeLog* ChangeLog /* = 0 */) {
         bool status = UMLWidget::activate(ChangeLog);

--- kdesdk/umbrello/umbrello/classifierwidget.h  #1.4:1.5
@@ -170,4 +170,10 @@ protected:
         virtual void updateSigs();
 
+        /**
+         * Return the number of displayed members of the given Object_Type.
+         * Takes into consideration m_bShowPublicOnly but not other settings,
+         */
+        int displayedMembers(Uml::Object_Type ot);
+
         bool m_bShowOperations;            ///< Loaded/saved item.
         bool m_bShowPublicOnly;            ///< Loaded/saved item.

--- kdesdk/umbrello/umbrello/classwidget.cpp  #1.35:1.36
@@ -55,12 +55,5 @@ int ClassWidget::displayedAttributes() {
         if (!m_bShowAttributes)
                 return 0;
-        UMLClassifier *c = static_cast<UMLClassifier*>(m_pObject);
-        int count = 0;
-        UMLClassifierListItemList list = c->getFilteredList(Uml::ot_Attribute);
-        for (UMLClassifierListItem *m = list.first(); m; m = list.next()) {
-                if (!(m_bShowPublicOnly && m->getScope() != Uml::Public))
-                        count++;
-        }
-        return count;
+        return ClassifierWidget::displayedMembers(Uml::ot_Attribute);
 }
 






More information about the umbrello-devel mailing list