| Summary: |
Cleanup of generated c++ code |
| Product: |
[Applications] umbrello
|
Reporter: |
Ralf Habacker <ralf.habacker> |
| Component: |
exporter | Assignee: |
Umbrello Development Group <umbrello-devel> |
| Status: |
RESOLVED
FIXED
|
|
|
| Severity: |
normal
|
|
|
| Priority: |
NOR
|
|
|
| Version First Reported In: |
2.29.2 (KDE Applications 19.08.2) | |
|
| Target Milestone: |
--- | |
|
| Platform: |
Other | |
|
| OS: |
All | |
|
|
Latest Commit:
|
https://commits.kde.org/umbrello/a6f00ce109f8b834eaa8aaefc7a9408a86ef6f33
|
Version Fixed/Implemented In:
|
2.29.3 (KDE Applications 19.08.3)
|
|
Sentry Crash Report:
|
|
| |
| Bug Depends on: |
|
|
|
| Bug Blocks: |
281170
|
|
|
The code generated by c++ exporter looks partly ugly and need to be cleaned up. STEPS TO REPRODUCE 1. start umbrello 2. add c++ class with attributes and methods (public) 3. export code OBSERVED RESULT The generated code contains repeated visibility tokens and the generated cpp file uses different styles for '{', ';' and '()'. Also indention inside body is partial different as shown by the following example. EXPECTED RESULT The code style should be cleaned up. ----------------------------------------------------------------- #ifndef TRUCK_H #define TRUCK_H #include <string> #include <vector> #include "Test.h" #include "Engine.h" class Truck { public: // Constructors/Destructors // /** * Empty Constructor */ Truck (); /** * Empty Destructor */ virtual ~Truck (); Test * m_mytest; /** * Set the value of m_mytest * @param new_var the new value of m_mytest */ void setMyTest (Test * new_var); /** * Get the value of m_mytest * @return the value of m_mytest */ Test * getMyTest (); protected: public: protected: public: protected: private: // Private attributes // Engine myEngine; Engine * m_myengine; public: private: public: // Private attribute accessor methods // /** * Set the value of myEngine * @param new_var the new value of myEngine */ void setMyEngine (Engine new_var) { myEngine = new_var; } /** * Get the value of myEngine * @return the value of myEngine */ Engine getMyEngine () { return myEngine; } private: /** * Set the value of m_myengine * @param new_var the new value of m_myengine */ void setMyEngine (Engine new_var); /** * Get the value of m_myengine * @return the value of m_myengine */ Engine getMyEngine (); void initAttributes () ; }; #endif // TRUCK_H ------------------------------------------------------------------ ------------------------------------------------------------------ #include "Truck.h" // Constructors/Destructors // Truck::Truck () { initAttributes(); } Truck::~Truck () { } // // Methods // // Accessor methods // /** * Set the value of m_mytest * @param new_var the new value of m_mytest */ void Truck::setMyTest (Test * new_var) { m_mytest = new_var; } /** * Get the value of m_mytest * @return the value of m_mytest */ Test * Truck::getMyTest () { return m_mytest; } /** * Set the value of m_myengine * @param new_var the new value of m_myengine */ void Truck::setMyEngine (Engine * new_var) { m_myengine = new_var; } /** * Get the value of m_myengine * @return the value of m_myengine */ Engine * Truck::getMyEngine () { return m_myengine; } void Truck::initAttributes () { } -------------------------------