Commit 9b1aba79 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 2889f038
......@@ -89,9 +89,8 @@ void ColorPlugin::pluginsInitialized()
// Add a Menu for color selection
// =============================================================================
QMenu *colorMenu = new QMenu(tr("&Color schemes"));
QIcon icon;
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"format-stroke-color.png");
colorMenu->setIcon(icon);
colorMenu->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"format-stroke-color.png"));
emit addMenubarAction(colorMenu->menuAction(), VIEWMENU );
// =============================================================================
......@@ -102,24 +101,21 @@ void ColorPlugin::pluginsInitialized()
QAction* AC_set_Default_color = new QAction(tr("&Default colors"), this);
AC_set_Default_color->setStatusTip(tr("Set Default Colors"));
AC_set_Default_color->setWhatsThis(tr("Set colors to default colors. ")+whatsThis.generateLink());
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-default.png");
AC_set_Default_color->setIcon(icon);
AC_set_Default_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-default.png"));
connect(AC_set_Default_color, SIGNAL(triggered()), this, SLOT(setDefaultColor()));
colorMenu->addAction(AC_set_Default_color);
QAction* AC_set_Presentation_color = new QAction(tr("&Presentation colors"), this);
AC_set_Presentation_color->setStatusTip(tr("Set Presentation Colors"));
AC_set_Presentation_color->setWhatsThis(tr("Set colors to presentation colors. ")+whatsThis.generateLink());
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-powerpoint.png");
AC_set_Presentation_color->setIcon(icon);
AC_set_Presentation_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-powerpoint.png"));
connect(AC_set_Presentation_color, SIGNAL(triggered()), this, SLOT(setPresentationColor()));
colorMenu->addAction(AC_set_Presentation_color);
QAction* AC_set_Paper_color = new QAction(tr("&Paper colors"), this);
AC_set_Paper_color->setStatusTip(tr("Set Paper Colors"));
AC_set_Paper_color->setWhatsThis(tr("Set colors to colors for papers. ")+whatsThis.generateLink());
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-paper.png");
AC_set_Paper_color->setIcon(icon);
AC_set_Paper_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-paper.png"));
connect(AC_set_Paper_color, SIGNAL(triggered()), this, SLOT(setPaperColor()));
colorMenu->addAction(AC_set_Paper_color);
......
......@@ -76,6 +76,15 @@ InfoMeshObjectPlugin::InfoMeshObjectPlugin() :
{
}
InfoMeshObjectPlugin::~InfoMeshObjectPlugin() {
if ( OpenFlipper::Options::gui()) {
delete infoBar_;
delete info_;
}
}
void InfoMeshObjectPlugin::initializePlugin() {
......
......@@ -122,7 +122,7 @@ class InfoMeshObjectPlugin : public QObject, BaseInterface, InformationInterface
InfoMeshObjectPlugin();
// default destructor
~InfoMeshObjectPlugin() {};
~InfoMeshObjectPlugin();
/// Name of the Plugin
QString name(){ return (QString("InfoMeshObject")); };
......
......@@ -52,7 +52,8 @@ PrimitivesGeneratorPlugin::PrimitivesGeneratorPlugin() :
triMesh_(0),
polyMesh_(0),
slices_(50),
stacks_(50)
stacks_(50),
primitivesMenu_(0)
{
}
......@@ -60,6 +61,10 @@ PrimitivesGeneratorPlugin::PrimitivesGeneratorPlugin() :
PrimitivesGeneratorPlugin::~PrimitivesGeneratorPlugin()
{
if ( OpenFlipper::Options::gui()) {
delete primitivesMenu_;
}
}
void PrimitivesGeneratorPlugin::initializePlugin()
......@@ -80,53 +85,42 @@ void PrimitivesGeneratorPlugin::initializePlugin()
void PrimitivesGeneratorPlugin::pluginsInitialized() {
if ( OpenFlipper::Options::gui()) {
// Primitives Menu
QMenu *primitivesMenu;
emit getMenubarMenu(tr("&Primitives"), primitivesMenu, true );
emit getMenubarMenu(tr("&Primitives"), primitivesMenu_, true );
QIcon* icon;
QAction* action;
action = primitivesMenu->addAction("Cube (Triangle Mesh)" ,this,SLOT(addTriangulatedCube()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_cube.png");
action->setIcon(*icon);
action = primitivesMenu_->addAction("Cube (Triangle Mesh)" ,this,SLOT(addTriangulatedCube()));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_cube.png"));
WhatsThisGenerator whatsThisGen("PrimitivesGenerator");
whatsThisGen.setWhatsThis(action,tr("Create a Cube."),"Cube");
action = primitivesMenu->addAction("Dodecahedron" ,this,SLOT(addDodecahedron()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_dodecahedron.png");
action->setIcon(*icon);
action = primitivesMenu_->addAction("Dodecahedron" ,this,SLOT(addDodecahedron()));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_dodecahedron.png"));
whatsThisGen.setWhatsThis(action,tr("Create a Dodecahedron."), "Dodecahedron");
action = primitivesMenu->addAction("Icosahedron" ,this,SLOT(addIcosahedron()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_icosahedron.png");
action->setIcon(*icon);
action = primitivesMenu_->addAction("Icosahedron" ,this,SLOT(addIcosahedron()));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_icosahedron.png"));
whatsThisGen.setWhatsThis(action,tr("Create a Icosahedron.","Icosahedron"));
action = primitivesMenu->addAction("Octahedron" ,this,SLOT(addOctahedron()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_octahedron.png");
action->setIcon(*icon);
action = primitivesMenu_->addAction("Octahedron" ,this,SLOT(addOctahedron()));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_octahedron.png"));
whatsThisGen.setWhatsThis(action,tr("Create an Octahedron."),"Octahedron");
action = primitivesMenu->addAction("Pyramid" ,this,SLOT(addPyramid()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_pyramid.png");
action->setIcon(*icon);
action = primitivesMenu_->addAction("Pyramid" ,this,SLOT(addPyramid()));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_pyramid.png"));
whatsThisGen.setWhatsThis(action,tr("Create a Pyramid."),"Pyramid");
action = primitivesMenu->addAction("Cylinder (Triangle Mesh)" ,this,SLOT(addTriangulatedCylinder()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_cylinder.png");
action->setIcon(*icon);
action = primitivesMenu_->addAction("Cylinder (Triangle Mesh)" ,this,SLOT(addTriangulatedCylinder()));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_cylinder.png"));
action = primitivesMenu->addAction("Sphere",this,SLOT(addSphere()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_sphere.png");
action->setIcon(*icon);
action = primitivesMenu_->addAction("Sphere",this,SLOT(addSphere()));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_sphere.png"));
whatsThisGen.setWhatsThis(action,tr("Create a Sphere. "),"Sphere");
action = primitivesMenu->addAction("Tetrahedron",this,SLOT(addTetrahedron()));
icon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_tetrahedron.png");
action->setIcon(*icon);
action = primitivesMenu_->addAction("Tetrahedron",this,SLOT(addTetrahedron()));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"primitive_tetrahedron.png"));
whatsThisGen.setWhatsThis(action,tr("Create a Tetrahedron."),"Tetrahedron");
}
......
......@@ -140,6 +140,8 @@ private:
int slices_;
int stacks_;
QMenu* primitivesMenu_;
};
#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