[umbrello] [Bug 413574] New: Cleanup of c++ code
Ralf Habacker
bugzilla_noreply at kde.org
Mon Oct 28 23:31:22 GMT 2019
https://bugs.kde.org/show_bug.cgi?id=413574
Bug ID: 413574
Summary: Cleanup of c++ code
Product: umbrello
Version: 2.29.2 (KDE Applications 19.08.2)
Platform: Other
OS: All
Status: REPORTED
Severity: normal
Priority: NOR
Component: exporter
Assignee: umbrello-devel at kde.org
Reporter: ralf.habacker at freenet.de
Target Milestone: ---
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 () {
}
-------------------------------
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the umbrello-devel
mailing list