Fix issues:

+ improve formatting
+ remove superfluous semicolons
+ comment unused parameters
+ rename Initialisation to Initialization
+ rename Deinitialisation to Finalization
+ remove spaces
This commit is contained in:
wmayer 2016-10-08 12:04:49 +02:00
parent 3a51404dd5
commit 9ac1810ea3
24 changed files with 147 additions and 148 deletions

View File

@ -1136,15 +1136,15 @@ void Application::initTypes(void)
App ::PropertyExpressionEngine ::init(); App ::PropertyExpressionEngine ::init();
// Extension classes // Extension classes
App ::Extension ::init(); App ::Extension ::init();
App ::ExtensionContainer ::init(); App ::ExtensionContainer ::init();
App ::DocumentObjectExtension ::init(); App ::DocumentObjectExtension ::init();
App ::GroupExtension ::init(); App ::GroupExtension ::init();
App ::GroupExtensionPython ::init(); App ::GroupExtensionPython ::init();
App ::GeoFeatureGroupExtension ::init(); App ::GeoFeatureGroupExtension ::init();
App ::GeoFeatureGroupExtensionPython::init(); App ::GeoFeatureGroupExtensionPython::init();
App ::OriginGroupExtension ::init(); App ::OriginGroupExtension ::init();
App ::OriginGroupExtensionPython::init(); App ::OriginGroupExtensionPython ::init();
// Document classes // Document classes
App ::TransactionalObject ::init(); App ::TransactionalObject ::init();

View File

@ -95,10 +95,10 @@ DocumentObjectExecReturn *DocumentObject::execute(void)
{ {
//call all extensions //call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>(); auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector) for(auto ext : vector) {
if(ext->extensionMustExecute()) if(ext->extensionMustExecute())
ext->extensionExecute(); ext->extensionExecute();
}
return StdReturn; return StdReturn;
} }
@ -109,10 +109,10 @@ short DocumentObject::mustExecute(void) const
//ask all extensions //ask all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>(); auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector) for(auto ext : vector) {
if(ext->extensionMustExecute()) if(ext->extensionMustExecute())
return 1; return 1;
}
return 0; return 0;
} }
@ -388,24 +388,24 @@ void DocumentObject::connectRelabelSignals()
} }
} }
void DocumentObject::onSettingDocument() { void DocumentObject::onSettingDocument()
{
//call all extensions //call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>(); auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector) for(auto ext : vector)
ext->onExtendedSettingDocument(); ext->onExtendedSettingDocument();
} }
void DocumentObject::setupObject() { void DocumentObject::setupObject()
{
//call all extensions //call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>(); auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector) for(auto ext : vector)
ext->onExtendedSetupObject(); ext->onExtendedSetupObject();
} }
void DocumentObject::unsetupObject() { void DocumentObject::unsetupObject()
{
//call all extensions //call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>(); auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector) for(auto ext : vector)

View File

@ -64,7 +64,7 @@ public:
/// returns the type name of the ViewProviderExtension which is automatically attached /// returns the type name of the ViewProviderExtension which is automatically attached
/// to the viewprovider object when it is initiated /// to the viewprovider object when it is initiated
virtual const char* getViewProviderExtensionName(void) const {return "";}; virtual const char* getViewProviderExtensionName(void) const {return "";}
}; };
} //App } //App

View File

@ -39,12 +39,12 @@ std::string DocumentObjectExtensionPy::representation(void) const
return std::string("<document object extension>"); return std::string("<document object extension>");
} }
PyObject *DocumentObjectExtensionPy::getCustomAttributes(const char* attr) const PyObject *DocumentObjectExtensionPy::getCustomAttributes(const char* /*attr*/) const
{ {
return 0; return 0;
} }
int DocumentObjectExtensionPy::setCustomAttributes(const char* attr, PyObject *obj) int DocumentObjectExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/)
{ {
return 0; return 0;
} }

View File

@ -46,7 +46,7 @@ public:
/// returns the type name of the ViewProvider /// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const { virtual const char* getViewProviderName(void) const {
return "Gui::ViewProviderDocumentObjectGroup"; return "Gui::ViewProviderDocumentObjectGroup";
}; }
virtual PyObject *getPyObject(void); virtual PyObject *getPyObject(void);
}; };

View File

@ -9,7 +9,7 @@
Namespace="App" Namespace="App"
FatherInclude="App/PropertyContainerPy.h" FatherInclude="App/PropertyContainerPy.h"
FatherNamespace="App" FatherNamespace="App"
Initialisation="true" Initialization="true"
Constructor = "true"> Constructor = "true">
<Documentation> <Documentation>
<Author Licence="LGPL" Name="Stefan Troeger" EMail="stefantroeger@gmx.net" /> <Author Licence="LGPL" Name="Stefan Troeger" EMail="stefantroeger@gmx.net" />

View File

@ -31,8 +31,8 @@
#include "DocumentObject.h" #include "DocumentObject.h"
// inclution of the generated files (generated out of PropertyContainerPy.xml) // inclution of the generated files (generated out of PropertyContainerPy.xml)
#include "ExtensionContainerPy.h" #include <App/ExtensionContainerPy.h>
#include "ExtensionContainerPy.cpp" #include <App/ExtensionContainerPy.cpp>
using namespace App; using namespace App;
@ -42,7 +42,7 @@ std::string ExtensionContainerPy::representation(void) const
return std::string("<extension>"); return std::string("<extension>");
} }
int ExtensionContainerPy::initialisation() { int ExtensionContainerPy::initialization() {
if (this->ob_type->tp_dict == NULL) { if (this->ob_type->tp_dict == NULL) {
if (PyType_Ready(this->ob_type) < 0) if (PyType_Ready(this->ob_type) < 0)
@ -69,7 +69,7 @@ int ExtensionContainerPy::initialisation() {
return 1; return 1;
} }
int ExtensionContainerPy::deinitialisation() { int ExtensionContainerPy::finalization() {
/* /*
//we need to delete all added python extensions, as we are the owner! //we need to delete all added python extensions, as we are the owner!
ExtensionContainer::ExtensionIterator it = this->getExtensionContainerPtr()->extensionBegin(); ExtensionContainer::ExtensionIterator it = this->getExtensionContainerPtr()->extensionBegin();
@ -78,7 +78,7 @@ int ExtensionContainerPy::deinitialisation() {
delete (*it).second; delete (*it).second;
}*/ }*/
return 1; return 1;
}; }
PyObject* ExtensionContainerPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper PyObject* ExtensionContainerPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
{ {
@ -92,12 +92,12 @@ int ExtensionContainerPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
return 0; return 0;
} }
PyObject *ExtensionContainerPy::getCustomAttributes(const char* attr) const PyObject *ExtensionContainerPy::getCustomAttributes(const char* /*attr*/) const
{ {
return 0; return 0;
} }
int ExtensionContainerPy::setCustomAttributes(const char* attr, PyObject *obj) int ExtensionContainerPy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/)
{ {
return 0; return 0;
} }

View File

@ -30,8 +30,8 @@
#include "Application.h" #include "Application.h"
// inclution of the generated files (generated out of PropertyContainerPy.xml) // inclution of the generated files (generated out of PropertyContainerPy.xml)
#include "ExtensionPy.h" #include <App/ExtensionPy.h>
#include "ExtensionPy.cpp" #include <App/ExtensionPy.cpp>
using namespace App; using namespace App;
@ -41,12 +41,12 @@ std::string ExtensionPy::representation(void) const
return std::string("<extension>"); return std::string("<extension>");
} }
PyObject *ExtensionPy::getCustomAttributes(const char* attr) const PyObject *ExtensionPy::getCustomAttributes(const char* /*attr*/) const
{ {
return 0; return 0;
} }
int ExtensionPy::setCustomAttributes(const char* attr, PyObject *obj) int ExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/)
{ {
return 0; return 0;
} }

View File

@ -35,7 +35,6 @@
#pragma warning( disable : 4275 ) #pragma warning( disable : 4275 )
#pragma warning( disable : 4503 ) #pragma warning( disable : 4503 )
#pragma warning( disable : 4786 ) // specifier longer then 255 chars #pragma warning( disable : 4786 ) // specifier longer then 255 chars
#pragma warning( disable : 4250 ) // virtual inheritance warning
#endif #endif
// standard // standard

View File

@ -310,7 +310,7 @@ public:
//restoring the object from document: this may itnerest extensions, hence call them //restoring the object from document: this may itnerest extensions, hence call them
virtual void Restore(Base::XMLReader& reader); virtual void Restore(Base::XMLReader& reader);
bool isRestoring() {return testStatus(Gui::isRestoring);}; bool isRestoring() {return testStatus(Gui::isRestoring);}
/** @name Display mask modes /** @name Display mask modes

View File

@ -65,16 +65,16 @@ public:
virtual void extensionDropObject(App::DocumentObject*) { } virtual void extensionDropObject(App::DocumentObject*) { }
/// Hides the view provider /// Hides the view provider
virtual void extensionHide(void) { }; virtual void extensionHide(void) { }
/// Shows the view provider /// Shows the view provider
virtual void extensionShow(void) { }; virtual void extensionShow(void) { }
virtual SoSeparator* extensionGetFrontRoot(void) const {return nullptr;} virtual SoSeparator* extensionGetFrontRoot(void) const {return nullptr;}
virtual SoGroup* extensionGetChildRoot(void) const {return nullptr;} virtual SoGroup* extensionGetChildRoot(void) const {return nullptr;}
virtual SoSeparator* extensionGetBackRoot(void) const {return nullptr;} virtual SoSeparator* extensionGetBackRoot(void) const {return nullptr;}
virtual void extensionAttach(App::DocumentObject* pcObject) { }; virtual void extensionAttach(App::DocumentObject* pcObject) { }
virtual void extensionSetDisplayMode(const char* ModeName) { }; virtual void extensionSetDisplayMode(const char* ModeName) { }
virtual std::vector<std::string> extensionGetDisplayModes(void) const {return std::vector<std::string>();}; virtual std::vector<std::string> extensionGetDisplayModes(void) const {return std::vector<std::string>();}
//update data of extended opject //update data of extended opject
virtual void extensionUpdateData(const App::Property*); virtual void extensionUpdateData(const App::Property*);

View File

@ -92,7 +92,6 @@ bool ViewProviderGroupExtension::extensionCanDropObject(App::DocumentObject* obj
return true; return true;
return false; return false;
} }
void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj) { void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj) {
@ -135,7 +134,6 @@ std::vector< App::DocumentObject* > ViewProviderGroupExtension::extensionClaimCh
return std::vector<App::DocumentObject*>(group->Group.getValues()); return std::vector<App::DocumentObject*>(group->Group.getValues());
} }
void ViewProviderGroupExtension::extensionShow(void) { void ViewProviderGroupExtension::extensionShow(void) {
// when reading the Visibility property from file then do not hide the // when reading the Visibility property from file then do not hide the

View File

@ -79,7 +79,7 @@ namespace Gui { namespace PropertyEditor {
} }
} }
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyItem, Base::BaseClass); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyItem, Base::BaseClass)
PropertyItem::PropertyItem() : parentItem(0), readonly(false), cleared(false) PropertyItem::PropertyItem() : parentItem(0), readonly(false), cleared(false)
{ {
@ -475,7 +475,7 @@ void PropertyItem::bind(const App::Property& prop) {
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyStringItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyStringItem, Gui::PropertyEditor::PropertyItem)
PropertyStringItem::PropertyStringItem() PropertyStringItem::PropertyStringItem()
{ {
@ -521,7 +521,7 @@ QVariant PropertyStringItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFontItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFontItem, Gui::PropertyEditor::PropertyItem)
PropertyFontItem::PropertyFontItem() PropertyFontItem::PropertyFontItem()
{ {
@ -571,7 +571,7 @@ QVariant PropertyFontItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertySeparatorItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertySeparatorItem, Gui::PropertyEditor::PropertyItem)
QWidget* PropertySeparatorItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const QWidget* PropertySeparatorItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const
{ {
@ -583,7 +583,7 @@ QWidget* PropertySeparatorItem::createEditor(QWidget* parent, const QObject* rec
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerItem, Gui::PropertyEditor::PropertyItem)
PropertyIntegerItem::PropertyIntegerItem() PropertyIntegerItem::PropertyIntegerItem()
{ {
@ -650,7 +650,7 @@ QVariant PropertyIntegerItem::toString(const QVariant& v) const {
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerConstraintItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerConstraintItem, Gui::PropertyEditor::PropertyItem)
PropertyIntegerConstraintItem::PropertyIntegerConstraintItem() PropertyIntegerConstraintItem::PropertyIntegerConstraintItem()
{ {
@ -733,7 +733,7 @@ QVariant PropertyIntegerConstraintItem::toString(const QVariant& v) const {
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatItem, Gui::PropertyEditor::PropertyItem)
PropertyFloatItem::PropertyFloatItem() PropertyFloatItem::PropertyFloatItem()
{ {
@ -802,7 +802,7 @@ QVariant PropertyFloatItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyUnitItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyUnitItem, Gui::PropertyEditor::PropertyItem)
PropertyUnitItem::PropertyUnitItem() PropertyUnitItem::PropertyUnitItem()
{ {
@ -876,7 +876,7 @@ QVariant PropertyUnitItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyUnitConstraintItem, Gui::PropertyEditor::PropertyUnitItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyUnitConstraintItem, Gui::PropertyEditor::PropertyUnitItem)
PropertyUnitConstraintItem::PropertyUnitConstraintItem() PropertyUnitConstraintItem::PropertyUnitConstraintItem()
{ {
@ -912,7 +912,7 @@ void PropertyUnitConstraintItem::setEditorData(QWidget *editor, const QVariant&
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatConstraintItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatConstraintItem, Gui::PropertyEditor::PropertyItem)
PropertyFloatConstraintItem::PropertyFloatConstraintItem() PropertyFloatConstraintItem::PropertyFloatConstraintItem()
{ {
@ -994,7 +994,7 @@ QVariant PropertyFloatConstraintItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyAngleItem, Gui::PropertyEditor::PropertyFloatItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyAngleItem, Gui::PropertyEditor::PropertyFloatItem)
PropertyAngleItem::PropertyAngleItem() PropertyAngleItem::PropertyAngleItem()
{ {
@ -1036,7 +1036,7 @@ QVariant PropertyAngleItem::toString(const QVariant& prop) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyBoolItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyBoolItem, Gui::PropertyEditor::PropertyItem)
PropertyBoolItem::PropertyBoolItem() PropertyBoolItem::PropertyBoolItem()
{ {
@ -1084,7 +1084,7 @@ QVariant PropertyBoolItem::editorData(QWidget *editor) const
// --------------------------------------------------------------- // ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyVectorItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyVectorItem, Gui::PropertyEditor::PropertyItem)
PropertyVectorItem::PropertyVectorItem() PropertyVectorItem::PropertyVectorItem()
{ {
@ -1197,7 +1197,7 @@ void PropertyVectorItem::propertyBound() {
// --------------------------------------------------------------- // ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyVectorDistanceItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyVectorDistanceItem, Gui::PropertyEditor::PropertyItem)
PropertyVectorDistanceItem::PropertyVectorDistanceItem() PropertyVectorDistanceItem::PropertyVectorDistanceItem()
{ {
@ -1312,7 +1312,7 @@ void PropertyVectorDistanceItem::propertyBound() {
// --------------------------------------------------------------- // ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMatrixItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMatrixItem, Gui::PropertyEditor::PropertyItem)
PropertyMatrixItem::PropertyMatrixItem() PropertyMatrixItem::PropertyMatrixItem()
{ {
@ -1733,7 +1733,7 @@ void PlacementEditor::updateValue(const QVariant& v, bool incr, bool data)
} }
} }
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyPlacementItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyPlacementItem, Gui::PropertyEditor::PropertyItem)
PropertyPlacementItem::PropertyPlacementItem() : init_axis(false), changed_value(false), rot_angle(0), rot_axis(0,0,1) PropertyPlacementItem::PropertyPlacementItem() : init_axis(false), changed_value(false), rot_angle(0), rot_axis(0,0,1)
{ {
@ -1952,7 +1952,7 @@ void PropertyPlacementItem::propertyBound() {
// --------------------------------------------------------------- // ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyEnumItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyEnumItem, Gui::PropertyEditor::PropertyItem)
PropertyEnumItem::PropertyEnumItem() PropertyEnumItem::PropertyEnumItem()
{ {
@ -2037,7 +2037,7 @@ QVariant PropertyEnumItem::editorData(QWidget *editor) const
// --------------------------------------------------------------- // ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyStringListItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyStringListItem, Gui::PropertyEditor::PropertyItem)
PropertyStringListItem::PropertyStringListItem() PropertyStringListItem::PropertyStringListItem()
{ {
@ -2109,7 +2109,7 @@ void PropertyStringListItem::setValue(const QVariant& value)
// --------------------------------------------------------------- // ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatListItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatListItem, Gui::PropertyEditor::PropertyItem)
PropertyFloatListItem::PropertyFloatListItem() PropertyFloatListItem::PropertyFloatListItem()
{ {
@ -2183,7 +2183,7 @@ void PropertyFloatListItem::setValue(const QVariant& value)
// --------------------------------------------------------------- // ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerListItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerListItem, Gui::PropertyEditor::PropertyItem)
PropertyIntegerListItem::PropertyIntegerListItem() PropertyIntegerListItem::PropertyIntegerListItem()
{ {
@ -2258,7 +2258,7 @@ void PropertyIntegerListItem::setValue(const QVariant& value)
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyColorItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyColorItem, Gui::PropertyEditor::PropertyItem)
PropertyColorItem::PropertyColorItem() PropertyColorItem::PropertyColorItem()
{ {
@ -2345,7 +2345,7 @@ namespace Gui { namespace PropertyEditor {
Q_DECLARE_METATYPE(Gui::PropertyEditor::Material) Q_DECLARE_METATYPE(Gui::PropertyEditor::Material)
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMaterialItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMaterialItem, Gui::PropertyEditor::PropertyItem)
PropertyMaterialItem::PropertyMaterialItem() PropertyMaterialItem::PropertyMaterialItem()
{ {
@ -2657,7 +2657,7 @@ QVariant PropertyMaterialItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMaterialListItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMaterialListItem, Gui::PropertyEditor::PropertyItem)
PropertyMaterialListItem::PropertyMaterialListItem() PropertyMaterialListItem::PropertyMaterialListItem()
{ {
@ -3122,7 +3122,7 @@ QVariant PropertyMaterialListItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFileItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFileItem, Gui::PropertyEditor::PropertyItem)
PropertyFileItem::PropertyFileItem() PropertyFileItem::PropertyFileItem()
{ {
@ -3173,7 +3173,7 @@ QVariant PropertyFileItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyPathItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyPathItem, Gui::PropertyEditor::PropertyItem)
PropertyPathItem::PropertyPathItem() PropertyPathItem::PropertyPathItem()
{ {
@ -3225,7 +3225,7 @@ QVariant PropertyPathItem::editorData(QWidget *editor) const
// -------------------------------------------------------------------- // --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyTransientFileItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyTransientFileItem, Gui::PropertyEditor::PropertyItem)
PropertyTransientFileItem::PropertyTransientFileItem() PropertyTransientFileItem::PropertyTransientFileItem()
{ {
@ -3346,7 +3346,7 @@ void LinkLabel::onLinkActivated (const QString& s)
} }
} }
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyLinkItem, Gui::PropertyEditor::PropertyItem); TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyLinkItem, Gui::PropertyEditor::PropertyItem)
PropertyLinkItem::PropertyLinkItem() PropertyLinkItem::PropertyLinkItem()
{ {
@ -3379,8 +3379,9 @@ QVariant PropertyLinkItem::value(const App::Property* prop) const
App::DocumentObject* obj = static_cast<App::DocumentObject*>(c); App::DocumentObject* obj = static_cast<App::DocumentObject*>(c);
list << QString::fromLatin1(obj->getDocument()->getName()); list << QString::fromLatin1(obj->getDocument()->getName());
} }
else else {
list << QString::fromLatin1(""); list << QString::fromLatin1("");
}
// the internal object name // the internal object name
list << QString::fromLatin1("Null"); list << QString::fromLatin1("Null");
@ -3393,8 +3394,9 @@ QVariant PropertyLinkItem::value(const App::Property* prop) const
App::DocumentObject* obj = static_cast<App::DocumentObject*>(c); App::DocumentObject* obj = static_cast<App::DocumentObject*>(c);
list << QString::fromLatin1(obj->getNameInDocument()); list << QString::fromLatin1(obj->getNameInDocument());
} }
else else {
list << QString::fromLatin1("Null"); list << QString::fromLatin1("Null");
}
return QVariant(list); return QVariant(list);
} }

View File

@ -216,7 +216,7 @@ class GenerateModel:
class PythonExport: class PythonExport:
subclass = None subclass = None
def __init__(self, FatherNamespace='', RichCompare=0, Name='', Reference=0, FatherInclude='', Father='', Namespace='', Twin='', Constructor=0, TwinPointer='', Include='', NumberProtocol=0, Delete=0, Documentation=None, Methode=None, Attribute=None, Sequence=None, CustomAttributes='', ClassDeclarations='', Initialisation=0): def __init__(self, FatherNamespace='', RichCompare=0, Name='', Reference=0, FatherInclude='', Father='', Namespace='', Twin='', Constructor=0, TwinPointer='', Include='', NumberProtocol=0, Delete=0, Documentation=None, Methode=None, Attribute=None, Sequence=None, CustomAttributes='', ClassDeclarations='', Initialization=0):
self.FatherNamespace = FatherNamespace self.FatherNamespace = FatherNamespace
self.RichCompare = RichCompare self.RichCompare = RichCompare
self.Name = Name self.Name = Name
@ -231,7 +231,7 @@ class PythonExport:
self.NumberProtocol = NumberProtocol self.NumberProtocol = NumberProtocol
self.Delete = Delete self.Delete = Delete
self.Documentation = Documentation self.Documentation = Documentation
self.Initialisation = Initialisation self.Initialization = Initialization
if Methode is None: if Methode is None:
self.Methode = [] self.Methode = []
else: else:
@ -249,8 +249,8 @@ class PythonExport:
else: else:
return PythonExport(*args_, **kwargs_) return PythonExport(*args_, **kwargs_)
factory = staticmethod(factory) factory = staticmethod(factory)
def getInitialisation(self): return self.Initialisation def getInitialization(self): return self.Initialization
def setInitialisation(self, Initialisation): self.Initialisation = Initialisation def setInitialization(self, Initialization): self.Initialization = Initialization
def getDocumentation(self): return self.Documentation def getDocumentation(self): return self.Documentation
def setDocumentation(self, Documentation): self.Documentation = Documentation def setDocumentation(self, Documentation): self.Documentation = Documentation
def getMethode(self): return self.Methode def getMethode(self): return self.Methode
@ -314,8 +314,8 @@ class PythonExport:
outfile.write(' Twin="%s"' % (self.getTwin(), )) outfile.write(' Twin="%s"' % (self.getTwin(), ))
if self.getConstructor() is not None: if self.getConstructor() is not None:
outfile.write(' Constructor="%s"' % (self.getConstructor(), )) outfile.write(' Constructor="%s"' % (self.getConstructor(), ))
if self.getInitialisation() is not None: if self.getInitialization() is not None:
outfile.write(' Initialisation="%s"' % (self.getInitialisation(), )) outfile.write(' Initialization="%s"' % (self.getInitialization(), ))
outfile.write(' TwinPointer="%s"' % (self.getTwinpointer(), )) outfile.write(' TwinPointer="%s"' % (self.getTwinpointer(), ))
outfile.write(' Include="%s"' % (self.getInclude(), )) outfile.write(' Include="%s"' % (self.getInclude(), ))
if self.getNumberprotocol() is not None: if self.getNumberprotocol() is not None:
@ -359,7 +359,7 @@ class PythonExport:
showIndent(outfile, level) showIndent(outfile, level)
outfile.write('Constructor = "%s",\n' % (self.getConstructor(),)) outfile.write('Constructor = "%s",\n' % (self.getConstructor(),))
showIndent(outfile, level) showIndent(outfile, level)
outfile.write('Initialisation = "%s",\n' % (self.getInitialisation(),)) outfile.write('Initialization = "%s",\n' % (self.getInitialization(),))
outfile.write('TwinPointer = "%s",\n' % (self.getTwinpointer(),)) outfile.write('TwinPointer = "%s",\n' % (self.getTwinpointer(),))
showIndent(outfile, level) showIndent(outfile, level)
outfile.write('Include = "%s",\n' % (self.getInclude(),)) outfile.write('Include = "%s",\n' % (self.getInclude(),))
@ -448,13 +448,13 @@ class PythonExport:
self.Constructor = 0 self.Constructor = 0
else: else:
raise ValueError('Bad boolean attribute (Constructor)') raise ValueError('Bad boolean attribute (Constructor)')
if attrs.get('Initialisation'): if attrs.get('Initialization'):
if attrs.get('Initialisation').value in ('true', '1'): if attrs.get('Initialization').value in ('true', '1'):
self.Initialisation = 1 self.Initialization = 1
elif attrs.get('Initialisation').value in ('false', '0'): elif attrs.get('Initialization').value in ('false', '0'):
self.Initialisation = 0 self.Initialization = 0
else: else:
raise ValueError('Bad boolean attribute (Initialisation)') raise ValueError('Bad boolean attribute (Initialization)')
if attrs.get('TwinPointer'): if attrs.get('TwinPointer'):
self.TwinPointer = attrs.get('TwinPointer').value self.TwinPointer = attrs.get('TwinPointer').value
if attrs.get('Include'): if attrs.get('Include'):
@ -507,7 +507,7 @@ class PythonExport:
ClassDeclarations_ += text__content_.nodeValue ClassDeclarations_ += text__content_.nodeValue
self.ClassDeclarations = ClassDeclarations_ self.ClassDeclarations = ClassDeclarations_
elif child_.nodeType == Node.ELEMENT_NODE and \ elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'Initialisation': nodeName_ == 'Initialization':
obj_ = Documentation.factory() obj_ = Documentation.factory()
obj_.build(child_) obj_.build(child_)
self.setDocumentation(obj_) self.setDocumentation(obj_)
@ -1845,14 +1845,14 @@ class SaxGeneratemodelHandler(handler.ContentHandler):
obj.setConstructor(0) obj.setConstructor(0)
else: else:
self.reportError('"Constructor" attribute must be boolean ("true", "1", "false", "0")') self.reportError('"Constructor" attribute must be boolean ("true", "1", "false", "0")')
val = attrs.get('Initialisation', None) val = attrs.get('Initialization', None)
if val is not None: if val is not None:
if val in ('true', '1'): if val in ('true', '1'):
obj.setInitialisation(1) obj.setInitialization(1)
elif val in ('false', '0'): elif val in ('false', '0'):
obj.setInitialisation(0) obj.setInitialization(0)
else: else:
self.reportError('"Initialisation" attribute must be boolean ("true", "1", "false", "0")') self.reportError('"Initialization" attribute must be boolean ("true", "1", "false", "0")')
val = attrs.get('TwinPointer', None) val = attrs.get('TwinPointer', None)
if val is not None: if val is not None:
obj.setTwinpointer(val) obj.setTwinpointer(val)

View File

@ -60,7 +60,7 @@ public:
static PyObject * richCompare(PyObject *v, PyObject *w, int op); static PyObject * richCompare(PyObject *v, PyObject *w, int op);
- -
static PyGetSetDef GetterSetter[]; static PyGetSetDef GetterSetter[];
virtual PyTypeObject *GetType(void) {return &Type;}; virtual PyTypeObject *GetType(void) {return &Type;}
public: public:
@self.export.Name@(@self.export.TwinPointer@ *pcObject, PyTypeObject *T = &Type); @self.export.Name@(@self.export.TwinPointer@ *pcObject, PyTypeObject *T = &Type);
@ -68,9 +68,9 @@ public:
virtual int PyInit(PyObject* args, PyObject*k); virtual int PyInit(PyObject* args, PyObject*k);
~@self.export.Name@(); ~@self.export.Name@();
+ if (self.export.Initialisation): + if (self.export.Initialization):
int initialisation(); int initialization();
int deinitialisation(); int finalization();
- -
typedef @self.export.TwinPointer@* PointerType ; typedef @self.export.TwinPointer@* PointerType ;
@ -612,8 +612,8 @@ int @self.export.Name@::staticCallback_set@i.Name@ (PyObject *self, PyObject *va
pcObject->ref(); pcObject->ref();
- -
+ if (self.export.Initialisation): + if (self.export.Initialization):
initialisation(); initialization();
- -
} }
@ -645,8 +645,8 @@ int @self.export.Name@::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
@self.export.Name@::PointerType ptr = static_cast<@self.export.Name@::PointerType>(_pcTwinPointer); @self.export.Name@::PointerType ptr = static_cast<@self.export.Name@::PointerType>(_pcTwinPointer);
delete ptr; delete ptr;
- -
+ if (self.export.Initialisation): + if (self.export.Initialization):
deinitialisation(); finalization();
- -
} }
@ -820,12 +820,12 @@ int @self.export.Name@::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
} }
- -
+ if (self.export.Initialisation): + if (self.export.Initialization):
int @self.export.Name@::initialisation() int @self.export.Name@::initialization()
{ {
return 0; return 0;
} }
int @self.export.Name@::deinitialisation() int @self.export.Name@::finalization()
{ {
return 0; return 0;
} }