fix -Wextra & -Wdeprecated in TechDraw

This commit is contained in:
wmayer 2016-09-22 19:32:16 +02:00
parent fa0b094e6a
commit c457fc468c
32 changed files with 76 additions and 35 deletions

View File

@ -65,32 +65,32 @@ PyObject* DrawPagePy::removeView(PyObject* args)
// double getPageWidth() const;
PyObject* DrawPagePy::getPageWidth(PyObject *args)
PyObject* DrawPagePy::getPageWidth(PyObject *)
{
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
return 0;
}
// double getPageHeight() const;
PyObject* DrawPagePy::getPageHeight(PyObject *args)
PyObject* DrawPagePy::getPageHeight(PyObject *)
{
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
return 0;
}
// const char* getPageOrientation() const;
PyObject* DrawPagePy::getPageOrientation(PyObject *args)
PyObject* DrawPagePy::getPageOrientation(PyObject *)
{
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
return 0;
}
PyObject *DrawPagePy::getCustomAttributes(const char* attr) const
PyObject *DrawPagePy::getCustomAttributes(const char* ) const
{
return 0;
}
int DrawPagePy::setCustomAttributes(const char* attr, PyObject *obj)
int DrawPagePy::setCustomAttributes(const char* , PyObject *)
{
return 0;
}

View File

@ -26,7 +26,6 @@
# include <sstream>
#endif
#include <strstream>
#include <Base/Console.h>
#include <Base/Writer.h>

View File

@ -50,7 +50,7 @@ PyObject* DrawProjGroupPy::removeProjection(PyObject* args)
return PyInt_FromLong((long) i);;
}
PyObject* DrawProjGroupPy::purgeProjections(PyObject* args)
PyObject* DrawProjGroupPy::purgeProjections(PyObject* /*args*/)
{
DrawProjGroup* projGroup = getDrawProjGroupPtr();
int i = projGroup->purgeProjections();

View File

@ -15,7 +15,7 @@ std::string DrawSVGTemplatePy::representation(void) const
return std::string("<DrawSVGTemplate object>");
}
PyObject *DrawSVGTemplatePy::getCustomAttributes(const char* attr) const
PyObject *DrawSVGTemplatePy::getCustomAttributes(const char* ) const
{
return 0;
}

View File

@ -126,7 +126,7 @@ App::DocumentObjectExecReturn *DrawTemplate::execute(void)
return App::DocumentObject::execute();
}
void DrawTemplate::getBlockDimensions(double &x, double &y, double &width, double &height) const
void DrawTemplate::getBlockDimensions(double & /*x*/, double & /*y*/, double & /*width*/, double & /*height*/) const
{
throw Base::Exception("implement in virtual function");
}

View File

@ -29,7 +29,6 @@
#endif
#include <strstream>
#include <App/Application.h>
#include <Base/Writer.h>
#include <Base/Reader.h>

View File

@ -91,12 +91,12 @@ PyObject* DrawViewClipPy::getChildViewNames(PyObject* args)
return result;
}
PyObject *DrawViewClipPy::getCustomAttributes(const char* attr) const
PyObject *DrawViewClipPy::getCustomAttributes(const char* ) const
{
return 0;
}
int DrawViewClipPy::setCustomAttributes(const char* attr, PyObject *obj)
int DrawViewClipPy::setCustomAttributes(const char* , PyObject *)
{
return 0;
}

View File

@ -540,7 +540,7 @@ TechDrawGeometry::Vertex* DrawViewPart::getProjVertexByIndex(int idx) const
//! returns existing geometry of 2D Face(idx)
//version 1 Face has 1 wire
std::vector<TechDrawGeometry::BaseGeom*> DrawViewPart::getProjFaceByIndex(int idx) const
std::vector<TechDrawGeometry::BaseGeom*> DrawViewPart::getProjFaceByIndex(int /*idx*/) const
{
std::vector<TechDrawGeometry::BaseGeom*> result;
const std::vector<TechDrawGeometry::Face *>& faces = getFaceGeometry();

View File

@ -49,7 +49,7 @@ using namespace TechDrawGui;
//
/* module functions */
static PyObject *
tdGuiPlaceholder(PyObject *self, PyObject *args)
tdGuiPlaceholder(PyObject * /*self*/, PyObject *args)
{
char* Name;
if (!PyArg_ParseTuple(args, "et","utf-8",&Name))
@ -65,6 +65,6 @@ tdGuiPlaceholder(PyObject *self, PyObject *args)
/* registration table */
struct PyMethodDef TechDrawGui_Import_methods[] = {
{"tdGuiPlaceholder" ,tdGuiPlaceholder , METH_VARARGS}, /* method name, C func ptr, always-tuple */
{NULL, NULL} /* end of table marker */
{"tdGuiPlaceholder" ,tdGuiPlaceholder , METH_VARARGS, ""}, /* method name, C func ptr, always-tuple */
{NULL, NULL, 0, NULL} /* end of table marker */
};

View File

@ -148,6 +148,7 @@ CmdTechDrawNewPageDef::CmdTechDrawNewPageDef()
void CmdTechDrawNewPageDef::activated(int iMsg)
{
Q_UNUSED(iMsg);
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw");
@ -217,6 +218,7 @@ CmdTechDrawNewPage::CmdTechDrawNewPage()
void CmdTechDrawNewPage::activated(int iMsg)
{
Q_UNUSED(iMsg);
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw");
@ -296,6 +298,7 @@ CmdTechDrawNewView::CmdTechDrawNewView()
void CmdTechDrawNewView::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPage(this);
if (!page) {
return;
@ -371,6 +374,7 @@ CmdTechDrawNewViewSection::CmdTechDrawNewViewSection()
void CmdTechDrawNewViewSection::activated(int iMsg)
{
Q_UNUSED(iMsg);
//TODO: should just use BaseView's page
TechDraw::DrawPage* page = _findPage(this);
if (!page) {
@ -440,6 +444,7 @@ CmdTechDrawProjGroup::CmdTechDrawProjGroup()
void CmdTechDrawProjGroup::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPage(this);
if (!page) {
return;
@ -510,6 +515,7 @@ CmdTechDrawAnnotation::CmdTechDrawAnnotation()
void CmdTechDrawAnnotation::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPage(this);
if (!page) {
return;
@ -550,6 +556,7 @@ CmdTechDrawClip::CmdTechDrawClip()
void CmdTechDrawClip::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPage(this);
if (!page) {
return;
@ -593,12 +600,13 @@ CmdTechDrawClipPlus::CmdTechDrawClipPlus()
void CmdTechDrawClipPlus::activated(int iMsg)
{
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
if (selection.size() != 2) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select 1 DrawViewClip and 1 DrawView."));
return;
}
Q_UNUSED(iMsg);
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
if (selection.size() != 2) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select 1 DrawViewClip and 1 DrawView."));
return;
}
TechDraw::DrawViewClip* clip = 0;
TechDraw::DrawView* view = 0;
@ -671,6 +679,7 @@ CmdTechDrawClipMinus::CmdTechDrawClipMinus()
void CmdTechDrawClipMinus::activated(int iMsg)
{
Q_UNUSED(iMsg);
auto dObj( getSelection().getObjectsOfType(TechDraw::DrawView::getClassTypeId()) );
if (dObj.empty()) {
QMessageBox::warning( Gui::getMainWindow(),
@ -736,6 +745,7 @@ CmdTechDrawSymbol::CmdTechDrawSymbol()
void CmdTechDrawSymbol::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPage(this);
if (!page) {
return;
@ -785,6 +795,7 @@ CmdTechDrawDraftView::CmdTechDrawDraftView()
void CmdTechDrawDraftView::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPage(this);
if (!page) {
return;
@ -835,6 +846,7 @@ CmdTechDrawSpreadsheet::CmdTechDrawSpreadsheet()
void CmdTechDrawSpreadsheet::activated(int iMsg)
{
Q_UNUSED(iMsg);
const std::vector<App::DocumentObject*> spreads = getSelection().getObjectsOfType(Spreadsheet::Sheet::getClassTypeId());
if (spreads.size() != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
@ -883,6 +895,7 @@ CmdTechDrawExportPage::CmdTechDrawExportPage()
void CmdTechDrawExportPage::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPage(this);
if (!page) {
return;

View File

@ -148,6 +148,7 @@ CmdTechDrawNewDimension::CmdTechDrawNewDimension()
void CmdTechDrawNewDimension::activated(int iMsg)
{
Q_UNUSED(iMsg);
bool result = _checkSelection(this,2);
if (!result)
return;
@ -283,6 +284,7 @@ CmdTechDrawNewRadiusDimension::CmdTechDrawNewRadiusDimension()
void CmdTechDrawNewRadiusDimension::activated(int iMsg)
{
Q_UNUSED(iMsg);
bool result = _checkSelection(this,1);
if (!result)
return;
@ -370,6 +372,7 @@ CmdTechDrawNewDiameterDimension::CmdTechDrawNewDiameterDimension()
void CmdTechDrawNewDiameterDimension::activated(int iMsg)
{
Q_UNUSED(iMsg);
bool result = _checkSelection(this,1);
if (!result)
return;
@ -459,6 +462,7 @@ CmdTechDrawNewLengthDimension::CmdTechDrawNewLengthDimension()
void CmdTechDrawNewLengthDimension::activated(int iMsg)
{
Q_UNUSED(iMsg);
bool result = _checkSelection(this,2);
if (!result)
return;
@ -566,6 +570,7 @@ CmdTechDrawNewDistanceXDimension::CmdTechDrawNewDistanceXDimension()
void CmdTechDrawNewDistanceXDimension::activated(int iMsg)
{
Q_UNUSED(iMsg);
bool result = _checkSelection(this,2);
if (!result)
return;
@ -671,6 +676,7 @@ CmdTechDrawNewDistanceYDimension::CmdTechDrawNewDistanceYDimension()
void CmdTechDrawNewDistanceYDimension::activated(int iMsg)
{
Q_UNUSED(iMsg);
bool result = _checkSelection(this,2);
if (!result)
return;
@ -775,6 +781,7 @@ CmdTechDrawNewAngleDimension::CmdTechDrawNewAngleDimension()
void CmdTechDrawNewAngleDimension::activated(int iMsg)
{
Q_UNUSED(iMsg);
bool result = _checkSelection(this,2);
if (!result)
return;
@ -863,6 +870,7 @@ CmdTechDrawLinkDimension::CmdTechDrawLinkDimension()
void CmdTechDrawLinkDimension::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPageCCD(this);
if (!page) {
return;

View File

@ -124,6 +124,7 @@ CmdTechDrawNewHatch::CmdTechDrawNewHatch()
void CmdTechDrawNewHatch::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (!_checkSelectionHatch(this)) {
return;
}
@ -184,6 +185,7 @@ CmdTechDrawToggleFrame::CmdTechDrawToggleFrame()
void CmdTechDrawToggleFrame::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = _findPageCD(this);
if (!page) {
return;

View File

@ -30,6 +30,7 @@ using namespace TechDrawGui;
DlgTemplateField::DlgTemplateField( QWidget* parent )
{
Q_UNUSED(parent);
setupUi(this);
leInput->setFocus();
}

View File

@ -462,7 +462,7 @@ bool MDIViewPage::orphanExists(const char *viewName, const std::vector<App::Docu
}
bool MDIViewPage::onMsg(const char *pMsg, const char **ppReturn)
bool MDIViewPage::onMsg(const char *pMsg, const char **)
{
Gui::Document *doc(getGuiDocument());

View File

@ -30,7 +30,6 @@
# include <QMessageBox>
# include <QMouseEvent>
# include <QPainter>
# include <strstream>
#endif
#include <App/Document.h>
@ -129,6 +128,7 @@ void QGIDrawingTemplate::draw()
void QGIDrawingTemplate::updateView(bool update)
{
Q_UNUSED(update);
draw();
}

View File

@ -31,7 +31,6 @@
# include <QMessageBox>
# include <QMouseEvent>
# include <QPainter>
# include <strstream>
#endif
#include <App/Document.h>

View File

@ -28,7 +28,6 @@
#include <QPen>
#include <QSvgRenderer>
#include <QGraphicsSvgItem>
#include <strstream>
#include <boost/regex.hpp>
#endif // #ifndef _PreComp_
@ -78,7 +77,7 @@ QVariant QGISVGTemplate::itemChange(GraphicsItemChange change,
void QGISVGTemplate::openFile(const QFile &file)
{
Q_UNUSED(file);
}
void QGISVGTemplate::load(const QString &fileName)
@ -132,6 +131,7 @@ void QGISVGTemplate::draw()
void QGISVGTemplate::updateView(bool update)
{
Q_UNUSED(update);
draw();
}

View File

@ -71,6 +71,7 @@ void QGITemplate::clearContents()
void QGITemplate::updateView(bool update)
{
Q_UNUSED(update);
draw();
}

View File

@ -38,7 +38,6 @@
#include <QStyleOptionGraphicsItem>
#include <QTextOption>
#include <QTransform>
#include <strstream>
#endif
#include <App/Application.h>
@ -180,6 +179,7 @@ void QGIView::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
void QGIView::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event);
// TODO don't like this but only solution at the minute (MLP)
if (isSelected()) {
m_colCurrent = getSelectColor();
@ -195,6 +195,7 @@ void QGIView::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void QGIView::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event);
if(isSelected()) {
m_colCurrent = getSelectColor();
} else {

View File

@ -72,7 +72,7 @@ public:
/** @} */
void alignTo(QGraphicsItem*, const QString &alignment);
void setLocked(bool state = true) { locked = true; }
void setLocked(bool /*state*/ = true) { locked = true; }
virtual void toggleCache(bool state);
virtual void updateView(bool update = false);

View File

@ -30,7 +30,6 @@
# include <QMessageBox>
# include <QMouseEvent>
# include <QPainter>
# include <strstream>
#endif
#include <App/Document.h>

View File

@ -36,7 +36,6 @@
# include <QPaintDevice>
# include <QSvgGenerator>
# include <strstream>
# include <math.h>
#endif
@ -213,6 +212,7 @@ void QGIViewDimension::hover(bool state)
void QGIViewDimension::updateView(bool update)
{
Q_UNUSED(update);
auto dim( dynamic_cast<TechDraw::DrawViewDimension*>(getViewObject()) );
if( dim == nullptr )
return;

View File

@ -24,7 +24,6 @@
#ifndef _PreComp_
#include <cmath>
#include <qmath.h>
#include <strstream>
#include <QAction>
#include <QApplication>
#include <QContextMenuEvent>

View File

@ -33,7 +33,6 @@
#include <QPainterPathStroker>
#include <QPainter>
#include <QTextOption>
#include <strstream>
#endif
#include <qmath.h>
@ -104,5 +103,6 @@ void QGIViewSection::updateView(bool update)
void QGIViewSection::drawSectionLine(bool b)
{
Q_UNUSED(b);
//override QGIVP::drawSectionLine
}

View File

@ -34,7 +34,6 @@
# include <QPaintEvent>
# include <QSvgGenerator>
# include <QWheelEvent>
# include <strstream>
# include <cmath>
#endif

View File

@ -134,6 +134,8 @@ void TaskLinkDim::updateDims()
void TaskLinkDim::onCurrentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous)
{
Q_UNUSED(current);
Q_UNUSED(previous);
//if (previous) {
//picked item on "selected" side
//}
@ -188,6 +190,7 @@ void TaskDlgLinkDim::open()
void TaskDlgLinkDim::clicked(int i)
{
Q_UNUSED(i);
}
bool TaskDlgLinkDim::accept()

View File

@ -267,6 +267,7 @@ void TaskProjGroup::setFractionalScale(double newScale)
void TaskProjGroup::scaleManuallyChanged(int i)
{
Q_UNUSED(i);
//TODO: See what this is about - shouldn't be simplifying the scale ratio while it's being edited... IR
if(blockUpdate)
return;

View File

@ -212,9 +212,9 @@ void TaskSectionView::updateValues()
m_base->getDocument()->recompute();
}
void TaskSectionView::onHorizontalClicked(bool b)
{
Q_UNUSED(b);
ui->cbHoriz->blockSignals(true);
ui->cbVert->blockSignals(true);
ui->cbHoriz->setChecked(true);
@ -225,6 +225,7 @@ void TaskSectionView::onHorizontalClicked(bool b)
void TaskSectionView::onVerticalClicked(bool b)
{
Q_UNUSED(b);
ui->cbHoriz->blockSignals(true);
ui->cbVert->blockSignals(true);
ui->cbVert->setChecked(true);
@ -235,6 +236,7 @@ void TaskSectionView::onVerticalClicked(bool b)
void TaskSectionView::onNormalClicked(bool b)
{
Q_UNUSED(b);
ui->cbNormal->blockSignals(true);
ui->cbReverse->blockSignals(true);
ui->cbNormal->setChecked(true);
@ -245,6 +247,7 @@ void TaskSectionView::onNormalClicked(bool b)
void TaskSectionView::onReverseClicked(bool b)
{
Q_UNUSED(b);
ui->cbReverse->blockSignals(true);
ui->cbNormal->blockSignals(true);
ui->cbReverse->setChecked(true);
@ -256,12 +259,14 @@ void TaskSectionView::onReverseClicked(bool b)
void TaskSectionView::onCalcClicked(bool b)
{
Q_UNUSED(b);
calcValues();
updateValues();
}
void TaskSectionView::onResetClicked(bool b)
{
Q_UNUSED(b);
resetValues();
updateValues();
m_section->Label.setValue(saveLabel.c_str());
@ -332,6 +337,7 @@ void TaskDlgSectionView::open()
void TaskDlgSectionView::clicked(int i)
{
Q_UNUSED(i);
}
bool TaskDlgSectionView::accept()

View File

@ -73,6 +73,7 @@ void TemplateTextField::execDialog()
void TemplateTextField::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event);
if (!ui) {
ui = new DlgTemplateField(dlgOwner);
ui->setFieldName(fieldNameStr);

View File

@ -245,6 +245,7 @@ std::vector<App::DocumentObject*> ViewProviderPage::claimChildren(void) const
void ViewProviderPage::unsetEdit(int ModNum)
{
Q_UNUSED(ModNum);
static_cast<void>(showMDIViewPage());
return;
}

View File

@ -109,12 +109,16 @@ void ViewProviderProjGroup::updateData(const App::Property* prop)
void ViewProviderProjGroup::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)
{
Q_UNUSED(menu);
Q_UNUSED(receiver);
Q_UNUSED(member);
//QAction* act;
//act = menu->addAction(QObject::tr("Show drawing"), receiver, member);
}
bool ViewProviderProjGroup::setEdit(int ModNum)
{
Q_UNUSED(ModNum);
// When double-clicking on the item for this sketch the
// object unsets and sets its edit mode without closing
// the task panel

View File

@ -117,18 +117,23 @@ void ViewProviderProjGroupItem::updateData(const App::Property* prop)
void ViewProviderProjGroupItem::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)
{
Q_UNUSED(menu);
Q_UNUSED(receiver);
Q_UNUSED(member);
//QAction* act;
//act = menu->addAction(QObject::tr("Show drawing"), receiver, member);
}
bool ViewProviderProjGroupItem::setEdit(int ModNum)
{
Q_UNUSED(ModNum);
doubleClicked();
return true;
}
void ViewProviderProjGroupItem::unsetEdit(int ModNum)
{
Q_UNUSED(ModNum);
Gui::Control().closeDialog();
}