Bug 425249 - Consolidate constructors in class UMLDatatypeWidget
Summary: Consolidate constructors in class UMLDatatypeWidget
Status: REPORTED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-12 09:51 UTC by Robert Hairgrove
Modified: 2020-08-12 10:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.