Bug 425249

Summary: Consolidate constructors in class UMLDatatypeWidget
Product: [Applications] umbrello Reporter: Robert Hairgrove <code>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: REPORTED ---    
Severity: minor CC: ralf.habacker
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Robert Hairgrove 2020-08-12 09:51:09 UTC
SUMMARY
There are five constructors in UMLDatatypeWidget that do mostly the same thing. It makes it difficult for clients to know which one to use. However, if a change is introduced in one of them, e.g. adding templates to the list, it doesn't apply to others which should also reflect the change. They should be more unified.

SOFTWARE/OS VERSIONS
all

ADDITIONAL INFORMATION
Comment 1 Ralf Habacker 2020-08-12 10:59:08 UTC
For the record: The implementation of this widget was created from a summary of various implementations scattered throughout the code base, which can be nicely seen in the following methods:

    void insertTypesFromConcepts(QStringList &types, bool fullName = true);
    void insertTypesFromDatatatypes(QStringList &types);
    void insertTypesSortedAttribute(const QString &type);
    void insertTypesSortedEntityAttribute(const QString &type);
    void insertTypesSortedOperation(const QString &type);
    void insertTypesSortedParameter(const QString &type);
    void insertTypesSortedTemplate(const QString &type);

In order not to break anything, corresponding class attributes were created and the original methods were integrated. With a revision/summary it must be ensured that e.g. the insertTypesFrom... methods function in the same way. Since a corresponding change affects the interface, a merge request for master would have to be created.