fix (Qt) issues found by clang's clazy tool:
+ -Wclazy-incorrect-emit + -Wclazy-strict-iterators + -Wclazy-overloaded-signal + -Wclazy-qstring-arg + -Wclazy-unused-non-trivial-variable + -Wclazy-container-anti-pattern + -Wclazy-range-loop-reference + -Wclazy-const-signal-or-slot + -Wclazy-detaching-temporary + -Wclazy-qfileinfo-exists
This commit is contained in:
@@ -288,17 +288,17 @@ void Placement::applyPlacement(const QString& data, bool incremental)
|
||||
if (incremental)
|
||||
cmd = QString::fromLatin1(
|
||||
"App.getDocument(\"%1\").%2.%3=%4.multiply(App.getDocument(\"%1\").%2.%3)")
|
||||
.arg(QLatin1String((*it)->getDocument()->getName()))
|
||||
.arg(QLatin1String((*it)->getNameInDocument()))
|
||||
.arg(QLatin1String(this->propertyName.c_str()))
|
||||
.arg(data);
|
||||
.arg(QString::fromLatin1((*it)->getDocument()->getName()),
|
||||
QString::fromLatin1((*it)->getNameInDocument()),
|
||||
QString::fromLatin1(this->propertyName.c_str()),
|
||||
data);
|
||||
else {
|
||||
cmd = QString::fromLatin1(
|
||||
"App.getDocument(\"%1\").%2.%3=%4")
|
||||
.arg(QLatin1String((*it)->getDocument()->getName()))
|
||||
.arg(QLatin1String((*it)->getNameInDocument()))
|
||||
.arg(QLatin1String(this->propertyName.c_str()))
|
||||
.arg(data);
|
||||
.arg(QString::fromLatin1((*it)->getDocument()->getName()),
|
||||
QString::fromLatin1((*it)->getNameInDocument()),
|
||||
QString::fromLatin1(this->propertyName.c_str()),
|
||||
data);
|
||||
}
|
||||
|
||||
Gui::Command::runCommand(Gui::Command::App, cmd.toLatin1());
|
||||
@@ -329,7 +329,7 @@ void Placement::onPlacementChanged(int)
|
||||
applyPlacement(plm, incr);
|
||||
|
||||
QVariant data = QVariant::fromValue<Base::Placement>(plm);
|
||||
/*emit*/ placementChanged(data, incr, false);
|
||||
Q_EMIT placementChanged(data, incr, false);
|
||||
}
|
||||
|
||||
void Placement::on_centerOfMass_toggled(bool on)
|
||||
@@ -382,7 +382,7 @@ void Placement::on_selectedVertex_clicked()
|
||||
//of the same object the rotation still gets applied twice
|
||||
Gui::Selection().clearSelection();
|
||||
//reselect original object that was selected when placement dlg first opened
|
||||
for (auto it : selectionObjects)
|
||||
for (const auto& it : selectionObjects)
|
||||
Gui::Selection().addSelection(it);
|
||||
|
||||
if (picked.size() == 1) {
|
||||
@@ -562,7 +562,7 @@ void Placement::reject()
|
||||
applyPlacement(plm, true);
|
||||
|
||||
QVariant data = QVariant::fromValue<Base::Placement>(plm);
|
||||
/*emit*/ placementChanged(data, true, false);
|
||||
Q_EMIT placementChanged(data, true, false);
|
||||
|
||||
revertTransformation();
|
||||
|
||||
@@ -611,7 +611,7 @@ bool Placement::onApply()
|
||||
applyPlacement(getPlacementString(), incr);
|
||||
|
||||
QVariant data = QVariant::fromValue<Base::Placement>(plm);
|
||||
/*emit*/ placementChanged(data, incr, true);
|
||||
Q_EMIT placementChanged(data, incr, true);
|
||||
|
||||
if (ui->applyIncrementalPlacement->isChecked()) {
|
||||
QList<Gui::QuantitySpinBox*> sb = this->findChildren<Gui::QuantitySpinBox*>();
|
||||
@@ -658,7 +658,7 @@ void Placement::bindObject()
|
||||
void Placement::directionActivated(int index)
|
||||
{
|
||||
if (ui->directionActivated(this, index)) {
|
||||
/*emit*/ directionChanged();
|
||||
Q_EMIT directionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -889,7 +889,7 @@ void TaskPlacement::setPlacement(const Base::Placement& p)
|
||||
|
||||
void TaskPlacement::slotPlacementChanged(const QVariant & p, bool incr, bool data)
|
||||
{
|
||||
/*emit*/ placementChanged(p, incr, data);
|
||||
Q_EMIT placementChanged(p, incr, data);
|
||||
}
|
||||
|
||||
bool TaskPlacement::accept()
|
||||
|
||||
Reference in New Issue
Block a user