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

Ralf Habacker ralf.habacker at gmail.com
Mon Apr 2 20:38:38 UTC 2012


SVN commit 1288036 by habacker:

Rename getSelected() to isSelected(), which reduces differences to soc-umbrello branch.

 M  +1 -1      controller/floatingtextwidgetcontroller.cpp  
 M  +1 -1      controller/umlwidgetcontroller.cpp  
 M  +12 -12    umlscene.cpp  
 M  +19 -9     widgets/associationwidget.cpp  
 M  +1 -9      widgets/associationwidget.h  
 M  +2 -2      widgets/messagewidget.cpp  
 M  +2 -2      widgets/umlwidget.cpp  
 M  +1 -1      widgets/umlwidget.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/controller/floatingtextwidgetcontroller.cpp #1288035:1288036
@@ -96,7 +96,7 @@
         return;
 
     if (m_floatingTextWidget->textRole() == Uml::TextRole::Seq_Message
-                    && ((MessageWidget*)m_floatingTextWidget->link())->getSelected()) {
+                    && ((MessageWidget*)m_floatingTextWidget->link())->isSelected()) {
         return;
     }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/controller/umlwidgetcontroller.cpp #1288035:1288036
@@ -249,7 +249,7 @@
     // Move any selected associations.
 
     foreach(AssociationWidget* aw, m_widget->m_scene->selectedAssocs()) {
-        if (aw->getSelected()) {
+        if (aw->isSelected()) {
             aw->moveEntireAssoc(diffX, diffY);
         }
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.cpp #1288035:1288036
@@ -1536,7 +1536,7 @@
 
     // Delete any selected associations.
     foreach(AssociationWidget* assocwidget, m_AssociationList) {
-        if (assocwidget->getSelected())
+        if (assocwidget->isSelected())
             removeAssoc(assocwidget);
         // MARK
     }
@@ -1545,7 +1545,7 @@
 
     /* loop through all messages and check the selection state */
     foreach(MessageWidget* cur_msgWgt, m_MessageList) {
-        if (cur_msgWgt->getSelected() == true) {
+        if (cur_msgWgt->isSelected()) {
             removeWidget(cur_msgWgt);  // Remove message - it is selected.
         }
     }
@@ -1713,8 +1713,8 @@
     //now do the same for the messagewidgets
 
     foreach(MessageWidget *w, m_MessageList) {
-        if (w->objectWidget(A)->getSelected() &&
-                w->objectWidget(B)->getSelected()) {
+        if (w->objectWidget(A)->isSelected() &&
+                w->objectWidget(B)->isSelected()) {
             makeSelected(w);
         }//end if
     }//end foreach
@@ -1934,7 +1934,7 @@
     AssociationWidgetList assocWidgetList;
 
     foreach(AssociationWidget* assocwidget, m_AssociationList) {
-        if (assocwidget->getSelected())
+        if (assocwidget->isSelected())
             assocWidgetList.append(assocwidget);
     }
     return assocWidgetList;
@@ -2976,7 +2976,7 @@
     //This needs to be reimplemented to increase the rectangle
     //if a part of any association is not included
     foreach(AssociationWidget *a , m_AssociationList) {
-        if (! a->getSelected())
+        if (! a->isSelected())
             continue;
         const FloatingTextWidget* multiA = const_cast<FloatingTextWidget*>(a->multiplicityWidget(A));
         const FloatingTextWidget* multiB = const_cast<FloatingTextWidget*>(a->multiplicityWidget(B));
@@ -3496,15 +3496,15 @@
     UMLWidget * pWA = 0, * pWB = 0;
     //check messages
     foreach(UMLWidget *pTemp , m_SelectedList) {
-        if (pTemp->baseType() == WidgetBase::wt_Message && pTemp->getSelected()) {
+        if (pTemp->baseType() == WidgetBase::wt_Message && pTemp->isSelected()) {
             MessageWidget * pMessage = static_cast<MessageWidget *>(pTemp);
             pWA = pMessage->objectWidget(A);
             pWB = pMessage->objectWidget(B);
-            if (!pWA->getSelected()) {
+            if (!pWA->isSelected()) {
                 pWA->setSelectedFlag(true);
                 m_SelectedList.append(pWA);
             }
-            if (!pWB->getSelected()) {
+            if (!pWB->isSelected()) {
                 pWB->setSelectedFlag(true);
                 m_SelectedList.append(pWB);
             }
@@ -3513,14 +3513,14 @@
     //check Associations
 
     foreach(AssociationWidget *pAssoc , m_AssociationList) {
-        if (pAssoc->getSelected()) {
+        if (pAssoc->isSelected()) {
             pWA = pAssoc->widgetForRole(A);
             pWB = pAssoc->widgetForRole(B);
-            if (!pWA->getSelected()) {
+            if (!pWA->isSelected()) {
                 pWA->setSelectedFlag(true);
                 m_SelectedList.append(pWA);
             }
-            if (!pWB->getSelected()) {
+            if (!pWB->isSelected()) {
                 pWB->setSelectedFlag(true);
                 m_SelectedList.append(pWB);
             }
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.cpp #1288035:1288036
@@ -1892,40 +1892,40 @@
             m_associationLine->setPoint( i, p );
         }
 
-        if ( m_pName && !m_pName->getSelected() ) {
+        if ( m_pName && !m_pName->isSelected() ) {
             setTextPositionRelatively(TextRole::Name, m_oldNamePoint);
         }
 
     }//end if widgetA = widgetB
     else if (m_role[A].m_pWidget==widget) {
-        if (m_pName && m_unNameLineSegment == 0 && !m_pName->getSelected() ) {
+        if (m_pName && m_unNameLineSegment == 0 && !m_pName->isSelected() ) {
             //only calculate position and move text if the segment it is on is moving
             setTextPositionRelatively(TextRole::Name, m_oldNamePoint);
         }
     }//end if widgetA moved
     else if (m_role[B].m_pWidget==widget) {
-        if (m_pName && (m_unNameLineSegment == pos-1) && !m_pName->getSelected() ) {
+        if (m_pName && (m_unNameLineSegment == pos-1) && !m_pName->isSelected() ) {
             //only calculate position and move text if the segment it is on is moving
             setTextPositionRelatively(TextRole::Name, m_oldNamePoint);
         }
     }//end if widgetB moved
 
-    if ( m_role[A].m_pRole && !m_role[A].m_pRole->getSelected() ) {
+    if ( m_role[A].m_pRole && !m_role[A].m_pRole->isSelected() ) {
         setTextPositionRelatively(TextRole::RoleAName, m_oldRoleAPoint);
     }
-    if ( m_role[B].m_pRole && !m_role[B].m_pRole->getSelected() ) {
+    if ( m_role[B].m_pRole && !m_role[B].m_pRole->isSelected() ) {
         setTextPositionRelatively(TextRole::RoleBName, m_oldRoleBPoint);
     }
-    if ( m_role[A].m_pMulti && !m_role[A].m_pMulti->getSelected() ) {
+    if ( m_role[A].m_pMulti && !m_role[A].m_pMulti->isSelected() ) {
         setTextPositionRelatively(TextRole::MultiA, m_oldMultiAPoint);
     }
-    if ( m_role[B].m_pMulti && !m_role[B].m_pMulti->getSelected() ) {
+    if ( m_role[B].m_pMulti && !m_role[B].m_pMulti->isSelected() ) {
         setTextPositionRelatively(TextRole::MultiB, m_oldMultiBPoint);
     }
-    if ( m_role[A].m_pChangeWidget && !m_role[A].m_pChangeWidget->getSelected() ) {
+    if ( m_role[A].m_pChangeWidget && !m_role[A].m_pChangeWidget->isSelected() ) {
         setTextPositionRelatively(TextRole::ChangeA, m_oldChangeAPoint);
     }
-    if ( m_role[B].m_pChangeWidget && !m_role[B].m_pChangeWidget->getSelected() ) {
+    if ( m_role[B].m_pChangeWidget && !m_role[B].m_pChangeWidget->isSelected() ) {
         setTextPositionRelatively(TextRole::ChangeB, m_oldChangeBPoint);
     }
 }//end method widgetMoved
@@ -3708,6 +3708,16 @@
 }
 
 /**
+ * Returns the state of whether the widget is selected.
+ *
+ * @return  Returns the state of whether the widget is selected.
+ */
+bool AssociationWidget::isSelected() const
+{
+    return m_selected;
+}
+
+/**
  * Sets the state of whether the widget is selected.
  *
  * @param _select   The state of whether the widget is selected.
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.h #1288035:1288036
@@ -152,17 +152,9 @@
     bool isActivated();
     void setActivated(bool active /*=true*/);
 
+    bool isSelected() const;
     void setSelected(bool _select = true);
 
-    /**
-     * Returns the state of whether the widget is selected.
-     *
-     * @return  Returns the state of whether the widget is selected.
-     */
-    bool getSelected() const {
-        return m_selected;
-    }
-
     AssociationLine* associationLine() const;
 
     void widgetMoved(UMLWidget* widget, int x, int y);
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/messagewidget.cpp #1288035:1288036
@@ -973,9 +973,9 @@
     UMLWidget::setSelected( _select );
     if( !m_pFText || m_pFText->displayText().isEmpty())
         return;
-    if( m_selected && m_pFText -> getSelected() )
+    if( m_selected && m_pFText->isSelected() )
         return;
-    if( !m_selected && !m_pFText -> getSelected() )
+    if( !m_selected && !m_pFText->isSelected() )
         return;
 
     m_scene -> setSelected( m_pFText, 0 );
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp #1288035:1288036
@@ -840,12 +840,12 @@
 {
     foreach(AssociationWidget* assocwidget , m_Assocs) {
 
-        if (!assocwidget->getSelected())
+        if (!assocwidget->isSelected())
             assocwidget->saveIdealTextPositions();
     }
 
     foreach(AssociationWidget* assocwidget , m_Assocs) {
-        if (!assocwidget->getSelected())
+        if (!assocwidget->isSelected())
             assocwidget->widgetMoved(this, x, y);
     }
 }
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.h #1288035:1288036
@@ -89,7 +89,7 @@
      *
      * @return Returns the state of whether the widget is selected.
      */
-    bool getSelected() const {
+    bool isSelected() const {
         return m_selected;
     }
 




More information about the umbrello-devel mailing list