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

Ralf Habacker ralf.habacker at gmail.com
Sun Apr 1 09:53:32 UTC 2012


SVN commit 1287810 by habacker:

Removed get prefix from snap related methods.

 M  +4 -4      dialogs/umlviewdialog.cpp  
 M  +1 -1      listpopupmenu.cpp  
 M  +2 -2      uml.cpp  
 M  +14 -14    umlscene.cpp  
 M  +4 -11     umlscene.h  
 M  +1 -1      widgets/associationwidget.cpp  
 M  +8 -8      widgets/umlwidget.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umlviewdialog.cpp #1287809:1287810
@@ -100,11 +100,11 @@
     m_diagramProperties->ui_showOpSigs->setChecked( m_pScene->getShowOpSig() );
 
     m_diagramProperties->ui_checkBoxShowGrid->setChecked(m_pScene->isSnapGridVisible());
-    m_diagramProperties->ui_snapToGrid->setChecked(m_pScene->getSnapToGrid());
-    m_diagramProperties->ui_snapComponentSizeToGrid->setChecked(m_pScene->getSnapComponentSizeToGrid());
+    m_diagramProperties->ui_snapToGrid->setChecked(m_pScene->snapToGrid());
+    m_diagramProperties->ui_snapComponentSizeToGrid->setChecked(m_pScene->snapComponentSizeToGrid());
 
-    m_diagramProperties->ui_gridSpaceX->setValue( m_pScene->getSnapX());
-    m_diagramProperties->ui_gridSpaceY->setValue( m_pScene->getSnapY());
+    m_diagramProperties->ui_gridSpaceX->setValue( m_pScene->snapX());
+    m_diagramProperties->ui_gridSpaceY->setValue( m_pScene->snapY());
     m_diagramProperties->ui_lineWidth->setValue( m_pScene->lineWidth());
     m_diagramProperties->ui_documentation->setText(m_pScene->documentation());
 }
--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.cpp #1287809:1287810
@@ -1738,7 +1738,7 @@
         uWarning() << "Could not add autolayout entries because graphviz installation has not been found.";
     }
     insert(mt_SnapToGrid, i18n("Snap to Grid"), CHECKABLE);
-    setActionChecked(mt_SnapToGrid, view->umlScene()->getSnapToGrid() );
+    setActionChecked(mt_SnapToGrid, view->umlScene()->snapToGrid() );
     insert(mt_ShowSnapGrid, i18n("Show Grid"), CHECKABLE);
     setActionChecked(mt_ShowSnapGrid, view->umlScene()->isSnapGridVisible() );
     insert(mt_Properties);
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #1287809:1287810
@@ -2317,7 +2317,7 @@
 void UMLApp::slotCurrentViewToggleSnapToGrid()
 {
     currentView()->umlScene()->toggleSnapToGrid();
-    viewSnapToGrid->setChecked( currentView()->umlScene()->getSnapToGrid() );
+    viewSnapToGrid->setChecked( currentView()->umlScene()->snapToGrid() );
 }
 
 /**
@@ -2368,7 +2368,7 @@
     viewProperties->setEnabled( bState );
     filePrint->setEnabled( bState );
     if ( currentView() ) {
-        viewSnapToGrid->setChecked( currentView()->umlScene()->getSnapToGrid() );
+        viewSnapToGrid->setChecked( currentView()->umlScene()->snapToGrid() );
         viewShowGrid->setChecked( currentView()->umlScene()->isSnapGridVisible() );
     }
 }
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.cpp #1287809:1287810
@@ -3570,7 +3570,7 @@
  */
 void UMLScene::toggleSnapToGrid()
 {
-    setSnapToGrid(!getSnapToGrid());
+    setSnapToGrid(!snapToGrid());
 }
 
 /**
@@ -3579,7 +3579,7 @@
  */
 void UMLScene::toggleSnapComponentSizeToGrid()
 {
-    setSnapComponentSizeToGrid(!getSnapComponentSizeToGrid());
+    setSnapComponentSizeToGrid(!snapComponentSizeToGrid());
 }
 
 /**
@@ -3594,7 +3594,7 @@
 /**
  * Return whether to use snap to grid.
  */
-bool UMLScene::getSnapToGrid() const
+bool UMLScene::snapToGrid() const
 {
     return m_bUseSnapToGrid;
 }
@@ -3605,13 +3605,13 @@
 void UMLScene::setSnapToGrid(bool bSnap)
 {
     m_bUseSnapToGrid = bSnap;
-    emit sigSnapToGridToggled(getSnapToGrid());
+    emit sigSnapToGridToggled(snapToGrid());
 }
 
 /**
  * Return whether to use snap to grid for component size.
  */
-bool UMLScene::getSnapComponentSizeToGrid() const
+bool UMLScene::snapComponentSizeToGrid() const
 {
     return m_bUseSnapComponentSizeToGrid;
 }
@@ -3623,13 +3623,13 @@
 {
     m_bUseSnapComponentSizeToGrid = bSnap;
     updateComponentSizes();
-    emit sigSnapComponentSizeToGridToggled(getSnapComponentSizeToGrid());
+    emit sigSnapComponentSizeToGridToggled(snapComponentSizeToGrid());
 }
 
 /**
  * Returns the x grid size.
  */
-int UMLScene::getSnapX() const
+int UMLScene::snapX() const
 {
     return m_nSnapX;
 }
@@ -3637,7 +3637,7 @@
 /**
  * Returns the y grid size.
  */
-int UMLScene::getSnapY() const
+int UMLScene::snapY() const
 {
     return m_nSnapY;
 }
@@ -3665,8 +3665,8 @@
  */
 int UMLScene::snappedX(int x)
 {
-    if (getSnapToGrid()) {
-        int gridX = getSnapX();
+    if (snapToGrid()) {
+        int gridX = snapX();
         int modX = x % gridX;
         x -= modX;
         if (modX >= gridX / 2)
@@ -3680,8 +3680,8 @@
  */
 int UMLScene::snappedY(int y)
 {
-    if (getSnapToGrid()) {
-        int gridY = getSnapY();
+    if (snapToGrid()) {
+        int gridY = snapY();
         int modY = y % gridY;
         y -= modY;
         if (modY >= gridY / 2)
@@ -3816,8 +3816,8 @@
     Q_UNUSED(clip);
     if( isSnapGridVisible() ) {
         painter.setPen( gridDotColor() );
-        int gridX = getSnapX();
-        int gridY = getSnapY();
+        int gridX = snapX();
+        int gridY = snapY();
         int numX = view()->width() / gridX;
         int numY = view()->height() / gridY;
         for( int x = 0; x <= numX; x++ )
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.h #1287809:1287810
@@ -149,21 +149,14 @@
         return m_nCanvasWidth;
     }
 
-    /**
-     * Sets the height of the diagram.
-     */
-    void setCanvasWidth(int width) {
-        m_nCanvasWidth = width;
-    }
-
-    bool getSnapToGrid() const;
+    bool snapToGrid() const;
     void setSnapToGrid(bool bSnap);
 
-    bool getSnapComponentSizeToGrid() const;
+    bool snapComponentSizeToGrid() const;
     void setSnapComponentSizeToGrid(bool bSnap);
 
-    int getSnapX() const;
-    int getSnapY() const;
+    int snapX() const;
+    int snapY() const;
     void setSnapX(int x);
     void setSnapY(int y);
 
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.cpp #1287809:1287810
@@ -3218,7 +3218,7 @@
     QPoint p = me->pos();
     QPoint oldp = m_associationLine->point(m_nMovingPoint);
 
-    if( m_scene->getSnapToGrid() ) {
+    if( m_scene->snapToGrid() ) {
         int newX = m_scene->snappedX( p.x() );
         int newY = m_scene->snappedY( p.y() );
         p.setX(newX);
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp #1287809:1287810
@@ -1252,22 +1252,22 @@
 
 /**
  * Sets the size.
- * If m_scene->getSnapComponentSizeToGrid() is true, then
+ * If m_scene->snapComponentSizeToGrid() is true, then
  * set the next larger size that snaps to the grid.
  */
 void UMLWidget::setSize(int width, int height)
 {
     // snap to the next larger size that is a multiple of the grid
     if (!m_ignoreSnapComponentSizeToGrid
-            && m_scene->getSnapComponentSizeToGrid()) {
+            && m_scene->snapComponentSizeToGrid()) {
         // integer divisions
-        int numX = width / m_scene->getSnapX();
-        int numY = height / m_scene->getSnapY();
+        int numX = width / m_scene->snapX();
+        int numY = height / m_scene->snapY();
         // snap to the next larger valid value
-        if (width > numX * m_scene->getSnapX())
-            width = (numX + 1) * m_scene->getSnapX();
-        if (height > numY * m_scene->getSnapY())
-            height = (numY + 1) * m_scene->getSnapY();
+        if (width > numX * m_scene->snapX())
+            width = (numX + 1) * m_scene->snapX();
+        if (height > numY * m_scene->snapY())
+            height = (numY + 1) * m_scene->snapY();
     }
 
     UMLSceneRectItem::setSize(width, height);




More information about the umbrello-devel mailing list