[Uml-devel] branches/work/soc-umbrello/umbrello

Andi Fischer andi.fischer at hispeed.ch
Sun Feb 5 18:17:33 UTC 2012


SVN commit 1278209 by fischer:

Changes from trunk applied.

 M  +1 -1      dialogs/codeeditor.cpp  
 M  +5 -0      package.cpp  
 M  +6 -6      uml.cpp  
 M  +1 -1      uml.h  
 M  +2 -2      umllistview.cpp  
 M  +14 -3     umlobject.cpp  
 M  +3 -2      umlobject.h  
 M  +1 -1      widgets/widgetbase.cpp  


--- branches/work/soc-umbrello/umbrello/dialogs/codeeditor.cpp #1278208:1278209
@@ -173,7 +173,7 @@
                     delete dlg;
                 }
                 else if ( (dynamic_cast<UMLClassifier*>(obj)) ) {
-                    if (obj->showProperties()) {
+                    if (obj->showPropertiesPagedDialog()) {
                         rebuildView(para);
                     }
                 }
--- branches/work/soc-umbrello/umbrello/package.cpp #1278208:1278209
@@ -133,6 +133,11 @@
         uError() << "is called with a NULL object";
         return false;
     }
+    if (pObject == this) {
+        uError() << "adding myself as child is not allowed";
+        return false;
+    }
+
     if (m_objects.indexOf(pObject) != -1) {
         uDebug() << pObject->name() << " is already there";
         return false;
--- branches/work/soc-umbrello/umbrello/uml.cpp #1278208:1278209
@@ -130,7 +130,7 @@
     m_view(0),
     m_doc(new UMLDoc()),
     m_listView(0),
-    m_pDocWindow(0),
+    m_docWindow(0),
     m_refactoringAssist(0),
     m_clipTimer(0),
     m_copyTimer(0),
@@ -803,9 +803,9 @@
     m_documentationDock = new QDockWidget( i18n("Doc&umentation"), this );
     m_documentationDock->setObjectName("DocumentationDock");
     addDockWidget(Qt::LeftDockWidgetArea, m_documentationDock);
-    m_pDocWindow = new DocWindow(m_doc, m_documentationDock);
-    m_pDocWindow->setObjectName("DOCWINDOW");
-    m_documentationDock->setWidget(m_pDocWindow);
+    m_docWindow = new DocWindow(m_doc, m_documentationDock);
+    m_docWindow->setObjectName("DOCWINDOW");
+    m_documentationDock->setWidget(m_docWindow);
 
     m_doc->setupSignals(); // make sure gets signal from list view
 
@@ -1625,7 +1625,7 @@
  */
 DocWindow* UMLApp::docWindow() const
 {
-    return m_pDocWindow;
+    return m_docWindow;
 }
 
 /**
@@ -2635,7 +2635,7 @@
 {
     switch(e->key()) {
     case Qt::Key_Backspace:
-        if (!m_pDocWindow->isTyping()) {
+        if (!m_docWindow->isTyping()) {
             m_toolsbar->setOldTool();
         }
         e->accept();
--- branches/work/soc-umbrello/umbrello/uml.h #1278208:1278209
@@ -342,7 +342,7 @@
     QDockWidget* m_cmdHistoryDock;     ///< Contains the undo/redo viewer widget.
     QDockWidget* m_propertyDock;       ///< Contains the property browser widget.
 
-    DocWindow*   m_pDocWindow;         ///< Documentation window.
+    DocWindow*   m_docWindow;         ///< Documentation window.
     QUndoView*   m_pQUndoView;         ///< Undo / Redo Viewer
     RefactoringAssistant* m_refactoringAssist;  ///< Refactoring assistant.
 
--- branches/work/soc-umbrello/umbrello/umllistview.cpp #1278208:1278209
@@ -598,7 +598,7 @@
             umlType = object->baseType();
 
             if (Model_Utils::typeIsCanvasWidget(lvt)) {
-                object->showProperties(ClassPropDlg::page_gen);
+                object->showPropertiesPagedDialog(ClassPropDlg::page_gen);
             } else if (umlType == UMLObject::ot_EnumLiteral) {
                 // Show the Enum Literal Dialog
                 UMLEnumLiteral* selectedEnumLiteral = static_cast<UMLEnumLiteral*>(object);
@@ -1413,7 +1413,7 @@
     }
 
     if (object) {
-        object->showProperties(page);
+        object->showPropertiesPagedDialog(page);
     }
 //:TODO:delete?    item->cancelRename(0);  //double click can cause it to go into rename mode.
 }
--- branches/work/soc-umbrello/umbrello/umlobject.cpp #1278208:1278209
@@ -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>                  *
  ***************************************************************************/
 
@@ -115,7 +115,7 @@
  * @param assoc   Whether to show association page.
  * @return        True if we modified the object.
  */
-bool UMLObject::showProperties(int page, bool assoc)
+bool UMLObject::showPropertiesPagedDialog(int page, bool assoc)
 {
     Q_UNUSED(page);
     DocWindow *docwindow = UMLApp::app()->docWindow();
@@ -530,10 +530,21 @@
  *
  * @param pPkg   Pointer to the class' UMLPackage.
  */
-void UMLObject::setUMLPackage(UMLPackage* pPkg)
+bool UMLObject::setUMLPackage(UMLPackage* pPkg)
 {
+    if (pPkg == this) {
+        uDebug() << "setting parent to myself is not allowed";
+        return false;
+    }
+
+    if (pPkg->umlPackage() == this) {
+        uDebug() << "setting parent to an object of which I'm already the parent is not allowed";
+        return false;
+    }
+
     m_pUMLPackage = pPkg;
     emitModified();
+    return true;
 }
 
 /**
--- branches/work/soc-umbrello/umbrello/umlobject.h #1278208:1278209
@@ -112,7 +112,7 @@
     QString package(const QString& separator = QString(),
                     bool includeRoot = false);
 
-    void setUMLPackage(UMLPackage* pPkg);
+    bool setUMLPackage(UMLPackage* pPkg);
     UMLPackage* umlPackage();
 
     UMLPackageList packages(bool includeRoot = false) const;
@@ -129,7 +129,8 @@
 
     void setInPaste(bool bInPaste = true);
 
-    virtual bool showProperties(int page = 0, bool assoc = false);
+    // FIXME: merge with showPropertiesDialog()
+    virtual bool showPropertiesPagedDialog(int page = 0, bool assoc = false);
 
     virtual bool resolveRef();
 
--- branches/work/soc-umbrello/umbrello/widgets/widgetbase.cpp #1278208:1278209
@@ -922,7 +922,7 @@
             showPropertiesDialog();
 
         } else if (wt == WidgetBase::wt_Object) {
-            m_umlObject->showProperties();
+            m_umlObject->showPropertiesPagedDialog();
         } else {
             uWarning() << "making properties dialog for unknown widget type";
         }




More information about the umbrello-devel mailing list