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

Andi Fischer andi.fischer at hispeed.ch
Sat Jan 7 16:48:29 UTC 2012


SVN commit 1272343 by fischer:

Some getters renamed.

 M  +3 -3      dialogs/umlviewdialog.cpp  
 M  +3 -3      docwindow.cpp  
 M  +32 -6     umlview.cpp  
 M  +5 -38     umlview.h  
 M  +8 -8      umlviewimageexportermodel.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umlviewdialog.cpp #1272342:1272343
@@ -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>                  *
  ***************************************************************************/
 
@@ -105,7 +105,7 @@
     m_diagramProperties->ui_gridSpaceX->setValue( m_pView->getSnapX());
     m_diagramProperties->ui_gridSpaceY->setValue( m_pView->getSnapY());
     m_diagramProperties->ui_lineWidth->setValue( m_pView->getLineWidth());
-    m_diagramProperties->ui_documentation->setText(m_pView->getDoc());
+    m_diagramProperties->ui_documentation->setText(m_pView->documentation());
 }
 
 /**
@@ -167,7 +167,7 @@
     {
         checkName();
         m_pView->setZoom( m_diagramProperties->ui_zoom->value() );
-        m_pView->setDoc( m_diagramProperties->ui_documentation->toPlainText() );
+        m_pView->setDocumentation( m_diagramProperties->ui_documentation->toPlainText() );
         m_pView->setSnapX( m_diagramProperties->ui_gridSpaceX->value() );
         m_pView->setSnapY( m_diagramProperties->ui_gridSpaceY->value() );
         m_pView->setLineWidth( m_diagramProperties->ui_lineWidth->value() );
--- trunk/KDE/kdesdk/umbrello/umbrello/docwindow.cpp #1272342:1272343
@@ -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>                  *
  ***************************************************************************/
 
@@ -110,7 +110,7 @@
         return;
     }
     m_pUMLView = view;
-    m_pDocTE->setText( m_pUMLView->umlScene()->getDoc() );
+    m_pDocTE->setText( m_pUMLView->umlScene()->documentation() );
     m_modified = false;
 }
 
@@ -181,7 +181,7 @@
         if( m_pUMLObject ) {
             m_pUMLObject->setDoc( m_pDocTE->toPlainText() );
         } else if( m_pUMLView ) {
-            m_pUMLView->umlScene()->setDoc( m_pDocTE->toPlainText() );
+            m_pUMLView->umlScene()->setDocumentation( m_pDocTE->toPlainText() );
         } else if ( m_pUMLWidget ) {
             m_pUMLWidget->setDocumentation( m_pDocTE->toPlainText() );
         } else if ( m_pAssocWidget ) {
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #1272342:1272343
@@ -215,11 +215,17 @@
     delete canvas();
 }
 
+/**
+ * Return the name of the diagram.
+ */
 QString UMLView::name() const
 {
     return m_Name;
 }
 
+/**
+ * Set the name of the diagram.
+ */
 void UMLView::setName(const QString &name)
 {
     m_Name = name;
@@ -274,7 +280,7 @@
     height = pPrinter->height() - top - bottom;
 
     //get the smallest rect holding the diagram
-    QRect rect = getDiagramRect();
+    QRect rect = diagramRect();
     //now draw to printer
 
 #if 0
@@ -555,6 +561,9 @@
     }
 }
 
+/**
+ * Override standard method.
+ */
 void UMLView::dragEnterEvent(QDragEnterEvent *e)
 {
     UMLDragData::LvTypeAndID_List tidList;
@@ -656,12 +665,17 @@
     }
 }
 
+/**
+ * Override standard method.
+ */
 void UMLView::dragMoveEvent(QDragMoveEvent* e)
 {
     e->accept();
 }
 
-
+/**
+ * Override standard method.
+ */
 void UMLView::dropEvent(QDropEvent *e)
 {
     UMLDragData::LvTypeAndID_List tidList;
@@ -941,7 +955,12 @@
     m_pToolBarState->mouseDoubleClick(static_cast<UMLSceneMouseEvent*>(ome));
 }
 
-QRect UMLView::getDiagramRect()
+/**
+ * Gets the smallest area to print.
+ *
+ * @return Returns the smallest area to print.
+ */
+QRect UMLView::diagramRect()
 {
     int startx, starty, endx, endy;
     startx = starty = INT_MAX;
@@ -1945,6 +1964,9 @@
 
 }
 
+/**
+ * Override standard method.
+ */
 void UMLView::closeEvent(QCloseEvent * e)
 {
     QWidget::closeEvent(e);
@@ -2465,7 +2487,7 @@
 void UMLView::copyAsImage(QPixmap*& pix)
 {
     //get the smallest rect holding the diagram
-    QRect rect = getDiagramRect();
+    QRect rect = diagramRect();
     QPixmap diagram(rect.width(), rect.height());
 
     //only draw what is selected
@@ -2518,7 +2540,7 @@
         findMaxBoundingRectangle(changeB, px, py, qx, qy);
     }//end foreach
 
-    QRect imageRect;  //area with respect to getDiagramRect()
+    QRect imageRect;  //area with respect to diagramRect()
     //i.e. all widgets on the canvas.  Was previously with
     //respect to whole canvas
 
@@ -3082,7 +3104,7 @@
 
 void UMLView::resizeCanvasToItems()
 {
-    QRect canvasSize = getDiagramRect();
+    QRect canvasSize = diagramRect();
     int canvasWidth = canvasSize.right() + 5;
     int canvasHeight = canvasSize.bottom() + 5;
 
@@ -3103,6 +3125,10 @@
     setCanvasSize(canvasWidth, canvasHeight);
 }
 
+/**
+ * Overrides standard method from QWidget to resize canvas when
+ * it's shown.
+ */
 void UMLView::show()
 {
     QWidget::show();
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.h #1272342:1272343
@@ -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>                  *
  ***************************************************************************/
 
@@ -100,25 +100,18 @@
     /**
      * Return the documentation of the diagram.
      */
-    QString getDoc() const {
+    QString documentation() const {
         return m_Documentation;
     }
 
     /**
      * Set the documentation of the diagram.
      */
-    void setDoc( const QString &doc ) {
+    void setDocumentation(const QString &doc) {
         m_Documentation = doc;
     }
 
-    /**
-     * Return the name of the diagram.
-     */
     QString name() const;
-
-    /**
-     * Set the name of the diagram.
-     */
     void setName(const QString &name);
 
     /**
@@ -1047,32 +1040,12 @@
     // End of methods and members related to loading/saving
     ////////////////////////////////////////////////////////////////////////
 
-    /**
-     * Override standard method.
-     */
     void closeEvent(QCloseEvent * e);
-
-    /**
-     * Override standard method.
-     */
     void dragEnterEvent(QDragEnterEvent* enterEvent);
-
-    /**
-     * Override standard method.
-     */
     void dragMoveEvent(QDragMoveEvent* moveEvent);
-
-    /**
-     * Override standard method.
-     */
     void dropEvent(QDropEvent* dropEvent);
 
-    /**
-     * Gets the smallest area to print.
-     *
-     * @return Returns the smallest area to print.
-     */
-    QRect getDiagramRect();
+    QRect diagramRect();
 
     /**
      * Overrides the standard operation.
@@ -1293,9 +1266,9 @@
     void sortWidgetList(UMLWidgetList &widgetList, Compare comp);
 
 public slots:
-
     void zoomIn();
     void zoomOut();
+    void show();
 
     /**
      * Changes the current tool to the selected tool.
@@ -1339,12 +1312,6 @@
     void slotShowView();
 
     /**
-     * Overrides standard method from QWidget to resize canvas when
-     * it's shown.
-     */
-    void show();
-
-    /**
      * Left Alignment
      */
     void alignLeft();
--- trunk/KDE/kdesdk/umbrello/umbrello/umlviewimageexportermodel.cpp #1272342:1272343
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2006-2011                                               *
+ *   copyright (C) 2006-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -235,7 +235,7 @@
         fileName = tmpFile.fileName();
     }
 
-    QRectF rect = scene->getDiagramRect();
+    QRectF rect = scene->diagramRect();
     if (rect.isEmpty()) {
         return i18n("Can not save an empty diagram");
     }
@@ -250,7 +250,7 @@
         if (!KIO::NetAccess::upload(tmpFile.fileName(), url, UMLApp::app())) {
             return i18n("There was a problem saving file: %1", url.path());
         }
-    } //!isLocalFile
+    }
 
     return QString();
 }
@@ -388,11 +388,11 @@
     QPainter *painter = new QPainter(printer);
 
     // make sure the widget sizes will be according to the
-    // actually used printer font, important for getDiagramRect()
+    // actually used printer font, important for diagramRect()
     // and the actual painting
     scene->forceUpdateWidgetFontMetrics(painter);
 
-    QRect rect = scene->getDiagramRect();
+    QRect rect = scene->diagramRect();
     painter->translate(-rect.x(), -rect.y());
     scene->getDiagram(rect, *painter);
 
@@ -482,7 +482,7 @@
     }
 
     bool exportSuccessful;
-    QRect rect = scene->getDiagramRect();
+    QRect rect = scene->diagramRect();
 
     QSvgGenerator generator;
     generator.setFileName(fileName);
@@ -491,7 +491,7 @@
     QPainter painter(&generator);
 
     // make sure the widget sizes will be according to the
-    // actually used printer font, important for getDiagramRect()
+    // actually used printer font, important for diagramRect()
     // and the actual painting
 //    scene->forceUpdateWidgetFontMetrics(&painter);
     //Note: The above was commented out because other exportViewTo...
@@ -531,7 +531,7 @@
     }
 
     bool exportSuccessful;
-    QRect rect = scene->getDiagramRect();
+    QRect rect = scene->diagramRect();
     QPixmap diagram(rect.width(), rect.height());
     scene->getDiagram(rect, diagram);
     exportSuccessful = diagram.save(fileName, qPrintable(imageType.toUpper()));




More information about the umbrello-devel mailing list