[TD]CI clang warnings
This commit is contained in:
@@ -198,10 +198,6 @@ TaskLeaderLine::TaskLeaderLine(TechDraw::DrawView* baseFeat,
|
||||
|
||||
}
|
||||
|
||||
TaskLeaderLine::~TaskLeaderLine()
|
||||
{
|
||||
}
|
||||
|
||||
void TaskLeaderLine::saveState()
|
||||
{
|
||||
if (m_lineFeat) {
|
||||
@@ -227,9 +223,9 @@ void TaskLeaderLine::updateTask()
|
||||
// blockUpdate = false;
|
||||
}
|
||||
|
||||
void TaskLeaderLine::changeEvent(QEvent *e)
|
||||
void TaskLeaderLine::changeEvent(QEvent *event)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
if (event->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
@@ -270,11 +266,11 @@ void TaskLeaderLine::setUiPrimary()
|
||||
|
||||
//switch widgets related to ViewProvider on/off
|
||||
//there is no ViewProvider until some time after feature is created.
|
||||
void TaskLeaderLine::enableVPUi(bool b)
|
||||
void TaskLeaderLine::enableVPUi(bool enable)
|
||||
{
|
||||
ui->cpLineColor->setEnabled(b);
|
||||
ui->dsbWeight->setEnabled(b);
|
||||
ui->cboxStyle->setEnabled(b);
|
||||
ui->cpLineColor->setEnabled(enable);
|
||||
ui->dsbWeight->setEnabled(enable);
|
||||
ui->cboxStyle->setEnabled(enable);
|
||||
}
|
||||
|
||||
void TaskLeaderLine::setUiEdit()
|
||||
@@ -365,13 +361,13 @@ void TaskLeaderLine::createLeaderFeature(std::vector<Base::Vector3d> converted)
|
||||
std::string PageName = m_basePage->getNameInDocument();
|
||||
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Create Leader"));
|
||||
Command::doCommand(Command::Doc,"App.activeDocument().addObject('%s','%s')",
|
||||
m_leaderType.c_str(),m_leaderName.c_str());
|
||||
Command::doCommand(Command::Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",
|
||||
PageName.c_str(),m_leaderName.c_str());
|
||||
Command::doCommand(Command::Doc, "App.activeDocument().addObject('%s', '%s')",
|
||||
m_leaderType.c_str(), m_leaderName.c_str());
|
||||
Command::doCommand(Command::Doc, "App.activeDocument().%s.addView(App.activeDocument().%s)",
|
||||
PageName.c_str(), m_leaderName.c_str());
|
||||
if (m_baseFeat) {
|
||||
Command::doCommand(Command::Doc,"App.activeDocument().%s.LeaderParent = App.activeDocument().%s",
|
||||
m_leaderName.c_str(),m_baseFeat->getNameInDocument());
|
||||
Command::doCommand(Command::Doc, "App.activeDocument().%s.LeaderParent = App.activeDocument().%s",
|
||||
m_leaderName.c_str(), m_baseFeat->getNameInDocument());
|
||||
}
|
||||
|
||||
App::DocumentObject* obj = m_basePage->getDocument()->getObject(m_leaderName.c_str());
|
||||
@@ -379,7 +375,7 @@ void TaskLeaderLine::createLeaderFeature(std::vector<Base::Vector3d> converted)
|
||||
throw Base::RuntimeError("TaskLeaderLine - new markup object not found");
|
||||
if (obj->isDerivedFrom(TechDraw::DrawLeaderLine::getClassTypeId())) {
|
||||
m_lineFeat = static_cast<TechDraw::DrawLeaderLine*>(obj);
|
||||
m_lineFeat->setPosition(Rez::appX(m_attachPoint.x),Rez::appX(- m_attachPoint.y), true);
|
||||
m_lineFeat->setPosition(Rez::appX(m_attachPoint.x), Rez::appX(- m_attachPoint.y), true);
|
||||
if (!converted.empty()) {
|
||||
m_lineFeat->WayPoints.setValues(converted);
|
||||
if (m_lineFeat->AutoHorizontal.getValue()) {
|
||||
@@ -420,7 +416,7 @@ void TaskLeaderLine::updateLeaderFeature()
|
||||
{
|
||||
// Base::Console().Message("TTL::updateLeaderFeature()\n");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Edit Leader"));
|
||||
//waypoints & x,y are updated by QGILeaderLine (for edits only!)
|
||||
//waypoints & x, y are updated by QGILeaderLine (for edits only!)
|
||||
commonFeatureUpdate();
|
||||
App::Color ac;
|
||||
ac.setValue<QColor>(ui->cpLineColor->color());
|
||||
@@ -450,13 +446,13 @@ void TaskLeaderLine::removeFeature()
|
||||
// Base::Console().Message("TTL::removeFeature()\n");
|
||||
if (!m_lineFeat)
|
||||
return;
|
||||
|
||||
|
||||
if (m_createMode) {
|
||||
try {
|
||||
std::string PageName = m_basePage->getNameInDocument();
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().%s.removeView(App.activeDocument().%s)",
|
||||
PageName.c_str(),m_lineFeat->getNameInDocument());
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().removeObject('%s')",
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "App.activeDocument().%s.removeView(App.activeDocument().%s)",
|
||||
PageName.c_str(), m_lineFeat->getNameInDocument());
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "App.activeDocument().removeObject('%s')",
|
||||
m_lineFeat->getNameInDocument());
|
||||
}
|
||||
catch (...) {
|
||||
@@ -474,9 +470,9 @@ void TaskLeaderLine::removeFeature()
|
||||
}
|
||||
|
||||
//********** Tracker routines *******************************************************************
|
||||
void TaskLeaderLine::onTrackerClicked(bool b)
|
||||
void TaskLeaderLine::onTrackerClicked(bool clicked)
|
||||
{
|
||||
Q_UNUSED(b);
|
||||
Q_UNUSED(clicked);
|
||||
// Base::Console().Message("TTL::onTrackerClicked() m_pbTrackerState: %d\n",
|
||||
// m_pbTrackerState);
|
||||
if (m_vpp->getMDIViewPage() == nullptr) {
|
||||
@@ -521,7 +517,7 @@ void TaskLeaderLine::onTrackerClicked(bool b)
|
||||
|
||||
QString msg = tr("Pick a starting point for leader line");
|
||||
getMainWindow()->statusBar()->show();
|
||||
Gui::getMainWindow()->showMessage(msg,3000);
|
||||
Gui::getMainWindow()->showMessage(msg, 3000);
|
||||
ui->pbTracker->setText(tr("Save Points"));
|
||||
ui->pbTracker->setEnabled(true);
|
||||
ui->pbCancelEdit->setEnabled(true);
|
||||
@@ -547,7 +543,7 @@ void TaskLeaderLine::onTrackerClicked(bool b)
|
||||
qgLead->startPathEdit();
|
||||
QString msg = tr("Click and drag markers to adjust leader line");
|
||||
getMainWindow()->statusBar()->show();
|
||||
Gui::getMainWindow()->showMessage(msg,3000);
|
||||
Gui::getMainWindow()->showMessage(msg, 3000);
|
||||
ui->pbTracker->setText(tr("Save changes"));
|
||||
ui->pbTracker->setEnabled(true);
|
||||
ui->pbCancelEdit->setEnabled(true);
|
||||
@@ -564,7 +560,7 @@ void TaskLeaderLine::onTrackerClicked(bool b)
|
||||
|
||||
QString msg = tr("Pick a starting point for leader line");
|
||||
getMainWindow()->statusBar()->show();
|
||||
Gui::getMainWindow()->showMessage(msg,3000);
|
||||
Gui::getMainWindow()->showMessage(msg, 3000);
|
||||
ui->pbTracker->setText(tr("Save changes"));
|
||||
ui->pbTracker->setEnabled(true);
|
||||
ui->pbCancelEdit->setEnabled(true);
|
||||
@@ -597,14 +593,14 @@ void TaskLeaderLine::startTracker()
|
||||
setEditCursor(Qt::CrossCursor);
|
||||
QString msg = tr("Left click to set a point");
|
||||
Gui::getMainWindow()->statusBar()->show();
|
||||
Gui::getMainWindow()->showMessage(msg,3000);
|
||||
Gui::getMainWindow()->showMessage(msg, 3000);
|
||||
}
|
||||
|
||||
void TaskLeaderLine::onTrackerFinished(std::vector<QPointF> pts, QGIView* qgParent)
|
||||
{
|
||||
//in this case, we already know who the parent is. We don't need QGTracker to tell us.
|
||||
(void) qgParent;
|
||||
// Base::Console().Message("TTL::onTrackerFinished() - parent: %X\n",qgParent);
|
||||
// Base::Console().Message("TTL::onTrackerFinished() - parent: %X\n", qgParent);
|
||||
if (pts.empty()) {
|
||||
Base::Console().Error("TaskLeaderLine - no points available\n");
|
||||
return;
|
||||
@@ -647,9 +643,9 @@ void TaskLeaderLine::removeTracker()
|
||||
}
|
||||
}
|
||||
|
||||
void TaskLeaderLine::onCancelEditClicked(bool b)
|
||||
void TaskLeaderLine::onCancelEditClicked(bool clicked)
|
||||
{
|
||||
Q_UNUSED(b);
|
||||
Q_UNUSED(clicked);
|
||||
// Base::Console().Message("TTL::onCancelEditClicked() m_pbTrackerState: %d\n",
|
||||
// m_pbTrackerState);
|
||||
abandonEditSession();
|
||||
@@ -675,18 +671,18 @@ QGIView* TaskLeaderLine::findParentQGIV()
|
||||
ViewProviderDrawingView* vpdv = dynamic_cast<ViewProviderDrawingView*>(gvp);
|
||||
if (!vpdv)
|
||||
return nullptr;
|
||||
|
||||
|
||||
return vpdv->getQView();;
|
||||
}
|
||||
|
||||
void TaskLeaderLine::setEditCursor(QCursor c)
|
||||
void TaskLeaderLine::setEditCursor(QCursor cursor)
|
||||
{
|
||||
if (!m_vpp->getQGSPage()) {
|
||||
return;
|
||||
}
|
||||
if (m_baseFeat) {
|
||||
QGIView* qgivBase = m_vpp->getQGSPage()->findQViewForDocObj(m_baseFeat);
|
||||
qgivBase->setCursor(c);
|
||||
qgivBase->setCursor(cursor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,7 +693,7 @@ void TaskLeaderLine::trackerPointsFromQPoints(std::vector<QPointF> pts)
|
||||
m_trackerPoints.clear();
|
||||
for (auto& p: pts) {
|
||||
QPointF mapped = p - pts.front();
|
||||
Base::Vector3d convert(mapped.x(),mapped.y(),0.0);
|
||||
Base::Vector3d convert(mapped.x(), mapped.y(), 0.0);
|
||||
m_trackerPoints.push_back(convert);
|
||||
}
|
||||
}
|
||||
@@ -724,7 +720,7 @@ void TaskLeaderLine::abandonEditSession()
|
||||
}
|
||||
QString msg = tr("In progress edit abandoned. Start over.");
|
||||
getMainWindow()->statusBar()->show();
|
||||
Gui::getMainWindow()->showMessage(msg,4000);
|
||||
Gui::getMainWindow()->showMessage(msg, 4000);
|
||||
|
||||
m_pbTrackerState = TRACKEREDIT;
|
||||
ui->pbTracker->setText(tr("Edit points"));
|
||||
@@ -742,10 +738,10 @@ void TaskLeaderLine::saveButtons(QPushButton* btnOK,
|
||||
m_btnCancel = btnCancel;
|
||||
}
|
||||
|
||||
void TaskLeaderLine::enableTaskButtons(bool b)
|
||||
void TaskLeaderLine::enableTaskButtons(bool enable)
|
||||
{
|
||||
m_btnOK->setEnabled(b);
|
||||
m_btnCancel->setEnabled(b);
|
||||
m_btnOK->setEnabled(enable);
|
||||
m_btnCancel->setEnabled(enable);
|
||||
}
|
||||
|
||||
int TaskLeaderLine::getPrefArrowStyle()
|
||||
@@ -789,7 +785,7 @@ bool TaskLeaderLine::accept()
|
||||
m_trackerMode = QGTracker::TrackerMode::None;
|
||||
removeTracker();
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
if (m_vpp->getMDIViewPage() != nullptr) {
|
||||
m_vpp->getMDIViewPage()->setContextMenuPolicy(m_saveContextPolicy);
|
||||
@@ -822,8 +818,8 @@ bool TaskLeaderLine::reject()
|
||||
removeTracker();
|
||||
|
||||
//make sure any dangling objects are cleaned up
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
if (m_vpp->getMDIViewPage()) {
|
||||
m_vpp->getMDIViewPage()->setContextMenuPolicy(m_saveContextPolicy);
|
||||
@@ -837,7 +833,7 @@ TaskDlgLeaderLine::TaskDlgLeaderLine(TechDraw::DrawView* baseFeat,
|
||||
TechDraw::DrawPage* page)
|
||||
: TaskDialog()
|
||||
{
|
||||
widget = new TaskLeaderLine(baseFeat,page);
|
||||
widget = new TaskLeaderLine(baseFeat, page);
|
||||
taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/TechDraw_LeaderLine"),
|
||||
widget->windowTitle(), true, nullptr);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
|
||||
Reference in New Issue
Block a user