Skip to content
  • Oliver Kellogg's avatar
    https://bugs.kde.org/show_bug.cgi?id=427532#c1 · 9817ffc9
    Oliver Kellogg authored
    Remove default datatypes of previous Active Language:
    
    umbrello/uml1model/datatype.{h,cpp}
    - 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.
    
    umbrello/uml1model/datatype.cpp
    - 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.
    
    umbrello/uml1model/package.{h,cpp}
    - 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.
    
    umbrello/uml1model/package.cpp
    - In function removeObject do not delete a datatype from its package
      but just set its isActive flag false.
    
    umbrello/uml1model/folder.cpp
    - In function load1 avoid duplicate creation of datatype when its name
      already exists in m_objects.
    
    umbrello/umldoc.{h,cpp}
    - 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.
    
    umbrello/umldoc.cpp
    - 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().
    
    umbrello/uml.cpp
    - 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.
    
    umbrello/umllistview.cpp
    - In function slotObjectCreated, if object->baseType() is ot_Datatype
      then check that the isActive flag is true; else refuse to create the
      UMLListViewItem.
    
    umbrello/main.cpp
    - At function initDocument :
      - Add argument progLang of type Uml::ProgrammingLanguage::Enum.
      - If UMLApp::app()->newDocument() is called then follow it by
        UMLApp::app()->setActiveLanguage(progLang).
      - 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.
    
    umbrello/version.h
    - Increase XMI_FILE_VERSION to "1.6.19" due to the <UML:DataType> new
      attribute "isActive".
    
    CCBUG: 427532
    9817ffc9