Bug 413991 - When creating code for attribute access, the C++ code generator produces unexpected code
Summary: When creating code for attribute access, the C++ code generator produces unex...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: exporter (show other bugs)
Version: 2.29.3 (KDE Applications 19.08.3)
Platform: Other All
: NOR wishlist
Target Milestone: 2.30 (KDE releases 19.12)
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks: 57583
  Show dependency treegraph
 
Reported: 2019-11-10 00:15 UTC by Ralf Habacker
Modified: 2019-11-23 13:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.29.80 (KDE Applications 19.11.80)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2019-11-10 00:15:16 UTC
Creating code for attribute accessors the c++ code generator generates  unexpected code.

STEPS TO REPRODUCE
1. start umbrello
2. create class
   class Test {
     private:
     int m_attribute;
   };

3. generate code
4. inspect generated code

OBSERVED RESULT

class Test {
  void setM_attribute(...);
  int getM_attribute();
};

EXPECTED RESULT

class Test {
  void setAttribute(...);
  int attribute();
};

ADDITIONAL INFORMATION
To support the expected code style the following code policies need to be implemented:

  - Getters with/without 'get' prefix
  - Remove prefix '[a-zA-Z]_' from attributed on generating accessor methods
  - Accessor methods start with/without capital letters
Comment 1 Ralf Habacker 2019-11-10 00:22:43 UTC
Git commit a611d2f5b91ede55e612ac4254c044d35796b53c by Ralf Habacker.
Committed on 10/11/2019 at 00:25.
Pushed by habacker into branch 'release/19.12'.

Add additional c++ code generation policies to fix unexpected code generation

- Getters with/without 'get' prefix
- Remove prefix '[a-zA-Z]_' from accessor methods
- Accessor methods start with/without capital letters
FIXED-IN:2.29.80 (KDE Applications 19.11.80)

M  +76   -0    umbrello/codegenerators/cpp/cppcodegenerationform.cpp
M  +9    -0    umbrello/codegenerators/cpp/cppcodegenerationform.h
M  +42   -0    umbrello/codegenerators/cpp/cppcodegenerationpolicy.cpp
M  +9    -1    umbrello/codegenerators/cpp/cppcodegenerationpolicy.h
M  +6    -0    umbrello/codegenerators/cpp/cppcodegenerationpolicypage.cpp
M  +9    -7    umbrello/codegenerators/cpp/cppwriter.cpp
M  +3    -0    umbrello/optionstate.cpp
M  +7    -1    umbrello/optionstate.h
M  +15   -0    umbrello/umbrello.kcfg

https://commits.kde.org/umbrello/a611d2f5b91ede55e612ac4254c044d35796b53c
Comment 2 Ralf Habacker 2019-11-10 00:23:53 UTC
Git commit 1c715d386e01655cc3d07571d79b9b2f97f67ef2 by Ralf Habacker.
Committed on 10/11/2019 at 00:27.
Pushed by habacker into branch 'master'.

Add additional c++ code generation policies to fix unexpected code generation

- Getters with/without 'get' prefix
- Remove prefix '[a-zA-Z]_' from accessor methods
- Accessor methods start with/without capital letters
FIXED-IN:2.29.80 (KDE Applications 19.11.80)

M  +76   -0    umbrello/codegenerators/cpp/cppcodegenerationform.cpp
M  +9    -0    umbrello/codegenerators/cpp/cppcodegenerationform.h
M  +42   -0    umbrello/codegenerators/cpp/cppcodegenerationpolicy.cpp
M  +9    -1    umbrello/codegenerators/cpp/cppcodegenerationpolicy.h
M  +6    -0    umbrello/codegenerators/cpp/cppcodegenerationpolicypage.cpp
M  +9    -7    umbrello/codegenerators/cpp/cppwriter.cpp
M  +3    -0    umbrello/optionstate.cpp
M  +7    -1    umbrello/optionstate.h
M  +15   -0    umbrello/umbrello.kcfg

https://commits.kde.org/umbrello/1c715d386e01655cc3d07571d79b9b2f97f67ef2
Comment 3 Ralf Habacker 2019-11-10 16:25:46 UTC
Git commit f0b4fec440f1d91ab24a5be181dcfed6e409eef7 by Ralf Habacker.
Committed on 10/11/2019 at 16:25.
Pushed by habacker into branch 'release/19.12'.

Minor text fix in settings dialog

M  +1    -1    umbrello/codegenerators/cpp/cppcodegenerationform.cpp

https://commits.kde.org/umbrello/f0b4fec440f1d91ab24a5be181dcfed6e409eef7