Bug 203476 - Umbrello does not generate valid C++ code
Summary: Umbrello does not generate valid C++ code
Status: CONFIRMED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-11 22:28 UTC by Diederik van der Boor
Modified: 2022-12-28 11:03 UTC (History)
2 users (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 Diederik van der Boor 2009-08-11 22:28:14 UTC
Version:           2.3.0 (using 4.3.00 (KDE 4.3.0) "release 152", KDE:KDE4:Factory:Desktop / openSUSE_11.1)
Compiler:          gcc
OS:                Linux (i686) release 2.6.31-rc5-8-pae

Umbrello does not generate valid C++ code.

Things which go wrong:
- .h files have all inline methods
- there are many public/private sections without any contents.
- private properties are generated as private methods
- the 'string' type is translated
- QPtrList does not exist in Qt 4.

Wishes:
- have a standard header on top of the file (like KDevelop)
- generate file names in lower case.
- be able to specify "const value &" as type.
- support for Qt types, like QString
- avoid adding #include <QString> everywhere.
Comment 1 kde.berknapp 2010-03-09 14:11:33 UTC
I don't completely agree with the wishes:

- The code generator already *does* already include a standard header if told so.
- File names should not be in lower case, but exactly written the class name is.
- Something like const typename & should not be a type as should only one type with that name.

I'm helping myself by writing the "modifiers" before the name of the component or parameter name, but unfortunately the code generator replaces them with nothing and spaces with underscores, so "const & myParamName" becomes "const_myParamName", which is useless then.

These names should go unmodified to the code. Do not replace spaces or any characters as long as there no possiblities to define these things as properties.

For class members "composition" and "aggregation" are ignored btw. so the only way is to put the asterisk before the members name. Putting it to the class or type name results in two different classes with the same content, which cannot be right.

Why does the code-generator not produce code for enumerations?
Comment 2 Andrew Crouthamel 2018-11-02 23:05:39 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Andrew Crouthamel 2018-11-16 05:34:52 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 4 Justin Zobel 2022-12-13 02:54:21 UTC
Thank you for reporting this issue in KDE software. As it was reported on an older version, can we please ask you to see if you cazn reproduce the issue with a more recent software version?  
  
If you can confirm this issue still exists in a recent version, please change the version field and the status to "REPORTED" when replying. Thank you!
Comment 5 Bug Janitor Service 2022-12-28 05:24:00 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Oliver Kellogg 2022-12-28 10:42:31 UTC
(In reply to kde.berknapp from comment #1)
> [...]
> Why does the code-generator not produce code for enumerations?

Wow, good point. I wonder how this could go unnoticed for so many years.
I did dome digging and found that it dates back to the following commit,

    commit eb1a740a68f62c6f06cb269927a8928ecf31991d
    Author: Jonathan Riddell <jr@jriddell.org>
    Date:   Sun Oct 26 13:58:05 2003 +0000

        replace getConcepts() with getClassesAndInterfaces() for codegeneration
        to prevent it generating code for datatypes.
    
        svn path=/trunk/kdesdk/umbrello/; revision=262158

    M       umbrello/codegenerators/simplecodegenerator.cpp
Comment 7 Oliver Kellogg 2022-12-28 11:03:33 UTC
Git commit 3487fe8dab859fac676b190bf1de1b38c491a6c6 by Oliver Kellogg.
Committed on 28/12/2022 at 11:02.
Pushed by okellogg into branch 'master'.

Address https://bugs.kde.org/show_bug.cgi?id=203476#c6 : In umbrello/umlmodel/package.cpp function appendClassesAndInterfaces also append objects of type ot_Enum.

M  +1    -1    umbrello/umldoc.cpp
M  +2    -2    umbrello/umlmodel/package.cpp

https://invent.kde.org/sdk/umbrello/commit/3487fe8dab859fac676b190bf1de1b38c491a6c6