Commit 793ab495 authored by Jan Möbius's avatar Jan Möbius

Fixed some valgrind warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15707 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e31eb8f9
...@@ -52,7 +52,8 @@ PrimitivesGeneratorPlugin::PrimitivesGeneratorPlugin() : ...@@ -52,7 +52,8 @@ PrimitivesGeneratorPlugin::PrimitivesGeneratorPlugin() :
triMesh_(0), triMesh_(0),
polyMesh_(0), polyMesh_(0),
slices_(50), slices_(50),
stacks_(50) stacks_(50),
primitivesMenu_(0)
{ {
} }
...@@ -60,6 +61,10 @@ PrimitivesGeneratorPlugin::PrimitivesGeneratorPlugin() : ...@@ -60,6 +61,10 @@ PrimitivesGeneratorPlugin::PrimitivesGeneratorPlugin() :
PrimitivesGeneratorPlugin::~PrimitivesGeneratorPlugin() PrimitivesGeneratorPlugin::~PrimitivesGeneratorPlugin()
{ {
if ( OpenFlipper::Options::gui()) {
delete primitivesMenu_;
}
} }
void PrimitivesGeneratorPlugin::initializePlugin() void PrimitivesGeneratorPlugin::initializePlugin()
...@@ -80,53 +85,42 @@ void PrimitivesGeneratorPlugin::initializePlugin() ...@@ -80,53 +85,42 @@ void PrimitivesGeneratorPlugin::initializePlugin()
void PrimitivesGeneratorPlugin::pluginsInitialized() { void PrimitivesGeneratorPlugin::pluginsInitialized() {
if ( OpenFlipper::Options::gui()) { if ( OpenFlipper::Options::gui()) {
// Primitives Menu
QMenu *primitivesMenu;
emit getMenubarMenu(tr("&Primitives"), primitivesMenu, true ); emit getMenubarMenu(tr("&Primitives"), primitivesMenu_, true );
QIcon* icon;
QAction* action; QAction* action;
action = primitivesMenu->addAction("Cube (Triangle Mesh)" ,this,SLOT(addTriangulatedCube())); action = primitivesMenu_->addAction("Cube (Triangle Mesh)" ,this,SLOT(addTriangulatedCube()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_cube.png"); action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_cube.png"));
action->setIcon(*icon);
WhatsThisGenerator whatsThisGen("PrimitivesGenerator"); WhatsThisGenerator whatsThisGen("PrimitivesGenerator");
whatsThisGen.setWhatsThis(action,tr("Create a Cube."),"Cube"); whatsThisGen.setWhatsThis(action,tr("Create a Cube."),"Cube");
action = primitivesMenu->addAction("Dodecahedron" ,this,SLOT(addDodecahedron())); action = primitivesMenu_->addAction("Dodecahedron" ,this,SLOT(addDodecahedron()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_dodecahedron.png"); action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_dodecahedron.png"));
action->setIcon(*icon);
whatsThisGen.setWhatsThis(action,tr("Create a Dodecahedron."), "Dodecahedron"); whatsThisGen.setWhatsThis(action,tr("Create a Dodecahedron."), "Dodecahedron");
action = primitivesMenu->addAction("Icosahedron" ,this,SLOT(addIcosahedron())); action = primitivesMenu_->addAction("Icosahedron" ,this,SLOT(addIcosahedron()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_icosahedron.png"); action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_icosahedron.png"));
action->setIcon(*icon);
whatsThisGen.setWhatsThis(action,tr("Create a Icosahedron.","Icosahedron")); whatsThisGen.setWhatsThis(action,tr("Create a Icosahedron.","Icosahedron"));
action = primitivesMenu->addAction("Octahedron" ,this,SLOT(addOctahedron())); action = primitivesMenu_->addAction("Octahedron" ,this,SLOT(addOctahedron()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_octahedron.png"); action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_octahedron.png"));
action->setIcon(*icon);
whatsThisGen.setWhatsThis(action,tr("Create an Octahedron."),"Octahedron"); whatsThisGen.setWhatsThis(action,tr("Create an Octahedron."),"Octahedron");
action = primitivesMenu->addAction("Pyramid" ,this,SLOT(addPyramid())); action = primitivesMenu_->addAction("Pyramid" ,this,SLOT(addPyramid()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_pyramid.png"); action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_pyramid.png"));
action->setIcon(*icon);
whatsThisGen.setWhatsThis(action,tr("Create a Pyramid."),"Pyramid"); whatsThisGen.setWhatsThis(action,tr("Create a Pyramid."),"Pyramid");
action = primitivesMenu->addAction("Cylinder (Triangle Mesh)" ,this,SLOT(addTriangulatedCylinder())); action = primitivesMenu_->addAction("Cylinder (Triangle Mesh)" ,this,SLOT(addTriangulatedCylinder()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_cylinder.png"); action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_cylinder.png"));
action->setIcon(*icon);
action = primitivesMenu->addAction("Sphere",this,SLOT(addSphere())); action = primitivesMenu_->addAction("Sphere",this,SLOT(addSphere()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_sphere.png"); action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_sphere.png"));
action->setIcon(*icon);
whatsThisGen.setWhatsThis(action,tr("Create a Sphere. "),"Sphere"); whatsThisGen.setWhatsThis(action,tr("Create a Sphere. "),"Sphere");
action = primitivesMenu->addAction("Tetrahedron",this,SLOT(addTetrahedron())); action = primitivesMenu_->addAction("Tetrahedron",this,SLOT(addTetrahedron()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_tetrahedron.png"); action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_tetrahedron.png"));
action->setIcon(*icon);
whatsThisGen.setWhatsThis(action,tr("Create a Tetrahedron."),"Tetrahedron"); whatsThisGen.setWhatsThis(action,tr("Create a Tetrahedron."),"Tetrahedron");
} }
......
...@@ -140,6 +140,8 @@ private: ...@@ -140,6 +140,8 @@ private:
int slices_; int slices_;
int stacks_; int stacks_;
QMenu* primitivesMenu_;
}; };
#endif //PRIMITIVESGENERATORPLUGIN_HH #endif //PRIMITIVESGENERATORPLUGIN_HH
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment