[umbrello] [Bug 427532] On changing Code -> Active Language the previous default data types are not removed

Oliver Kellogg bugzilla_noreply at kde.org
Sun Oct 11 21:57:22 BST 2020


--- Comment #2 from Oliver Kellogg <okellogg at users.sourceforge.net> ---
Git commit 9817ffc9eeef527181ee40904e76352796f4955a by Oliver Kellogg.
Committed on 11/10/2020 at 20:54.
Pushed by okellogg into branch 'master'.

Remove default datatypes of previous Active Language:

- Add member variable m_isActive initialized to true by constructor.
- Add accessor functions setActive(bool active = true), isActive().
- Peripheral cleanup: Override function load1 in lieu of loadFromXMI1.

- In function load1, set m_isActive true if XMI attribute "isActive"
  does not exist or if its value is not "false".
- In function saveToXMI1, setAttribute "isActive" to "false" on the
  classifierElement if m_isActive is false.

- At function containedObjects add optional argument includeInactive
  of type bool defaulting to false.  If includeInactive is true then
  include datatypes with isActive() false in the returned list.

- In function removeObject do not delete a datatype from its package
  but just set its isActive flag false.

- In function load1 avoid duplicate creation of datatype when its name
  already exists in m_objects.

- At function datatypes() add optional argument includeInactive of type
  bool defaulting to false.  If includeInactive is true then include
  datatypes which have isActive() == false in the returned list.
- New function removeDatatype(const QString &name) removes a datatype
  from m_datatypeRoot->containedObjects() by name.

- In function createDatatype,
  - at call to m_datatypeRoot->containedObjects() provide argument
    includeInactive = true;
  - if Model_Utils::findUMLObject() returns non null and the retuned
    object is a UMLDatatype then set its isActive flag to true and emit
    sigObjectCreated; do not call Object_Factory::createUMLObject().

- In function setGenerator, if m_codegen is non null on entry then query
  m_codegen->defaultDatatypes() and call m_doc->removeDatatype() for
  each name returned.

- In function slotObjectCreated, if object->baseType() is ot_Datatype
  then check that the isActive flag is true; else refuse to create the

- At function initDocument :
  - Add argument progLang of type Uml::ProgrammingLanguage::Enum.
  - If UMLApp::app()->newDocument() is called then follow it by
  - If a file shall be opened, the programming language set by the
    <XMI.extensions> <codegeneration> element in the file shall take
    precedence over the language set via command line parameter,
    therefore do not call UMLApp::app()->setActiveLanguage.
- Adjust main program to change of function initDocument.

- Increase XMI_FILE_VERSION to "1.6.19" due to the <UML:DataType> new
  attribute "isActive".

M  +4    -4    umbrello/main.cpp
M  +5    -0    umbrello/uml.cpp
M  +29   -7    umbrello/uml1model/datatype.cpp
M  +5    -1    umbrello/uml1model/datatype.h
M  +17   -0    umbrello/uml1model/folder.cpp
M  +39   -4    umbrello/uml1model/package.cpp
M  +1    -1    umbrello/uml1model/package.h
M  +31   -5    umbrello/umldoc.cpp
M  +2    -1    umbrello/umldoc.h
M  +9    -1    umbrello/umllistview.cpp
M  +1    -1    umbrello/version.h


You are receiving this mail because:
You are the assignee for the bug.

More information about the umbrello-devel mailing list