+ cppcheck fixes
This commit is contained in:
parent
9ff1908a30
commit
7f874b9767
|
@ -273,10 +273,13 @@ void InterpreterSingleton::runFile(const char*pxFileName, bool local)
|
||||||
dict = PyDict_Copy(dict);
|
dict = PyDict_Copy(dict);
|
||||||
if (PyDict_GetItemString(dict, "__file__") == NULL) {
|
if (PyDict_GetItemString(dict, "__file__") == NULL) {
|
||||||
PyObject *f = PyString_FromString(pxFileName);
|
PyObject *f = PyString_FromString(pxFileName);
|
||||||
if (f == NULL)
|
if (f == NULL) {
|
||||||
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (PyDict_SetItemString(dict, "__file__", f) < 0) {
|
if (PyDict_SetItemString(dict, "__file__", f) < 0) {
|
||||||
Py_DECREF(f);
|
Py_DECREF(f);
|
||||||
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Py_DECREF(f);
|
Py_DECREF(f);
|
||||||
|
|
|
@ -910,7 +910,7 @@ void StdCmdSetAppearance::activated(int iMsg)
|
||||||
|
|
||||||
bool StdCmdSetAppearance::isActive(void)
|
bool StdCmdSetAppearance::isActive(void)
|
||||||
{
|
{
|
||||||
return Gui::Selection().size() != 0;
|
return !Gui::Selection().empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -435,10 +435,13 @@ void PythonDebugger::runFile(const QString& fn)
|
||||||
dict = PyDict_Copy(dict);
|
dict = PyDict_Copy(dict);
|
||||||
if (PyDict_GetItemString(dict, "__file__") == NULL) {
|
if (PyDict_GetItemString(dict, "__file__") == NULL) {
|
||||||
PyObject *f = PyString_FromString((const char*)pxFileName);
|
PyObject *f = PyString_FromString((const char*)pxFileName);
|
||||||
if (f == NULL)
|
if (f == NULL) {
|
||||||
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (PyDict_SetItemString(dict, "__file__", f) < 0) {
|
if (PyDict_SetItemString(dict, "__file__", f) < 0) {
|
||||||
Py_DECREF(f);
|
Py_DECREF(f);
|
||||||
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Py_DECREF(f);
|
Py_DECREF(f);
|
||||||
|
|
|
@ -433,7 +433,8 @@ void ViewProviderFemConstraint::checkForWizard()
|
||||||
QWidget* wd = sa->widget(); // This is the reason why we cannot use findChildByName() right away!!!
|
QWidget* wd = sa->widget(); // This is the reason why we cannot use findChildByName() right away!!!
|
||||||
if (wd == NULL) return;
|
if (wd == NULL) return;
|
||||||
QObject* wiz = findChildByName(wd, QObject::tr("ShaftWizard")); // FIXME: Actually, we don't want to translate this...
|
QObject* wiz = findChildByName(wd, QObject::tr("ShaftWizard")); // FIXME: Actually, we don't want to translate this...
|
||||||
if (wiz != NULL)
|
if (wiz != NULL) {
|
||||||
wizardWidget = static_cast<QVBoxLayout*>(wiz);
|
wizardWidget = static_cast<QVBoxLayout*>(wiz);
|
||||||
wizardSubLayout = wiz->findChild<QVBoxLayout*>(QObject::tr("ShaftWizardLayout"));
|
wizardSubLayout = wiz->findChild<QVBoxLayout*>(QObject::tr("ShaftWizardLayout"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user